A program that I use (Tekla Structures) generates an Excel .xls file using a .rpt template which consists of html (and or xml). The final file consists of tables with text data. I am able to edit the html / xml code of the template by modifying the .rpt template. What I would like to do is to force Excel to freeze first n rows of the sheet.
I have tried to add the following code to the head section of the template:
<script>
<!--[if gte mso 9]>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:WorksheetOptions>
<x:FreezePanes/>
<x:SplitHorizontal>5</x:SplitHorizontal>
<x:ActivePane>2</x:ActivePane>
<x:TopRowBottomPane>5</x:TopRowBottomPane>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]>
</script>
After examining the generated file I can see that the added code is there, however it won't work until I remove the script tag in a text editor. Then, if opened in Excel, the rows are frozen as they should be. The problem is that without the script tag xml lines won't apply to the template.
In other words, I as far as I understand I need to insert xml elements in script/script tags, however the same tags prevent the elements to work.
Is there an alternative way to insert the xml code without using the script tag?
Thanks in advance, Nick