How to freeze the header row in an Excel spreadsheet exported from ASP.NET

前端 未结 2 446
暖寄归人
暖寄归人 2020-12-21 18:14

I\'m exporting an ASP.NET gridview to Excel using the following function. The formatting is working really well, except I need to freeze the header row in Excel on the expo

2条回答
  •  生来不讨喜
    2020-12-21 18:55

    Perhaps you can use a trick that I employ when I am trying to do "specialty" formatting, etc...

    Create an XLS with all the row and cell formats you'd like already expressed. Then COPY it, add your data, and SAVE it.

    In this manner you do not need any payed-for plug-ins, and you ALWAYS get EXACTLY whatever formatting you want...

    Need more than one specialty? Create another my_MT_Excel.xls with the needed formatting.

    You could have a folder full of these things all ready to go without resorting to the more intricate programming techniques.

    tob

提交回复
热议问题