Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 608
  • Last Modified:

XSL Excel Row Height / Formatting Rows vs Columns/Cells

How can set the "Height" of the FIRST row in an excel sheet, utilizing a xsl file and .NET Transform from a dataset?

I can set the "First Row of CELLS" to any 'Style' in a foreach but I need to have the first row set to a height of 50!
  • 2
1 Solution
In the Row element, set attribute ss:Height="50"
where  xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" is declared in the Workbook node.

You can do that in the xsl, by using something like
<xsl:if test="position() = 1">
  <xsl:attribute name="ss:Height">50</xsl:attribute>
WilliamAuthor Commented:
Thanks !! That did the job!

I only have one other question

Where can you read/learn all this xsl syntax for excel?
Can you recommend any book(s)?
The xml syntax for excel I learn simply by creating an excel spreadsheet in Excel 2003, with my desired result, eg for yours I changed row height and type in some data into the row.  I then exported the excel sheet to xml using Excel.

For xsl, W3Schools has a good beginners tutorial.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now