I 've created an xsl file to create an excel Workbook with multiple worksheets, thro' xslt. My code works fine for sheet1. Sheet2 was created but has no data. So please help me to fill data in sheet2 also. My code is here
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="utf-8"?>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <html xmlns:o="urn:schemas-microsoft-com:office:office"
- xmlns:x="urn:schemas-microsoft-com:office:excel"
- xmlns:s="urn:schemas-microsoft-com:office:spreadsheet"
- xmlns="http://www.w3.org/TR/REC-html40">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <style>
- .xlText{mso-number-format:"@";text-align:left;font-family:新細明體;font-size:12px;}
- .xlHeader{font-family:新細明體;font-size:12px;background:#CCFFCC;}
- .xlEach{font-family:新細明體;font-size:12px;}
- .xlTitle{font-size:20px;font-family:新細明體;font-weight:bold;background:#FFFF99;height:30px;}
- .xlDate{mso-number-format:"yyyy/mm/dd_ ";}
- </style>
- <xml>
- <x:ExcelWorkbook>
- <x:ExcelWorksheets>
- <x:ExcelWorksheet>
- <x:Name>summary</x:Name>
- <x:WorksheetOptions>
- <x:ProtectContents>False</x:ProtectContents>
- <x:ProtectObjects>False</x:ProtectObjects>
- <x:ProtectScenarios>False</x:ProtectScenarios>
- </x:WorksheetOptions>
- </x:ExcelWorksheet>
- <x:ExcelWorksheet >
- <x:Name>GateMoves</x:Name>
- <Table x:name="GateMoves" x:FullColumns="1" x:FullRows="1">
- <tr>
- <td align="Center" class="xlHeader">Month</td>
- <td align="Center" class="xlHeader">Activity</td>
- <td align="Center" class="xlHeader">count</td>
- <xsl:for-each select="NewDataSet/Table">
- <tr>
- <td class="xlEach">
- <xsl:value-of select="Month" />
- </td>
- <td class="xlEach">
- <xsl:value-of select="Activity" />
- </td>
- <td class="xlEach">
- <xsl:value-of select="count" />
- </td>
- </tr>
- </xsl:for-each>
- </tr>
- </Table>
- <x:WorksheetOptions>
- <x:ProtectContents>False</x:ProtectContents>
- <x:ProtectObjects>False</x:ProtectObjects>
- <x:ProtectScenarios>False</x:ProtectScenarios>
- </x:WorksheetOptions>
- </x:ExcelWorksheet>
- </x:ExcelWorksheets>
- </x:ExcelWorkbook>
- </xml>
- </head>
- <body >
- <table border="1" cellpadding="0" cellspacing="0" width="100%" x:worksheet="GateMoves">
- <tr>
- <td align="Center" class="xlHeader">Month</td>
- <td align="Center" class="xlHeader">Activity</td>
- <td align="Center" class="xlHeader">count</td>
- <xsl:for-each select="NewDataSet/Table">
- <tr>
- <td class="xlEach">
- <xsl:value-of select="Month" />
- </td>
- <td class="xlEach">
- <xsl:value-of select="Activity" />
- </td>
- <td class="xlEach">
- <xsl:value-of select="count" />
- </td>
- </tr>
- </xsl:for-each>
- </tr>
- </table>
- </body >
- </html>
- </xsl:template>
- </xsl:stylesheet>
With Thanks,
Sudha