Hi all,
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
[CODE="xml"]
<?xml version="1.0" encoding="utf-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xmlns:o="urn:sc hemas-microsoft-com:office:offi ce"
xmlns:x="urn:sc hemas-microsoft-com:office:exce l"
xmlns:s="urn:sc hemas-microsoft-com:office:spre adsheet"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ut f-8" />
<style>
.xlText{mso-number-format:"@";text-align:left;font-family:新細明體;fon t-size:12px;}
.xlHeader{font-family:新細明體;fon t-size:12px;backg round:#CCFFCC;}
.xlEach{font-family:新細明體;fon t-size:12px;}
.xlTitle{font-size:20px;font-family:新細明體;fon t-weight:bold;bac kground:#FFFF99 ;height:30px;}
.xlDate{mso-number-format:"yyyy/mm/dd_ ";}
</style>
<xml>
<x:ExcelWorkboo k>
<x:ExcelWorkshe ets>
<x:ExcelWorkshe et>
<x:Name>summary </x:Name>
<x:WorksheetOpt ions>
<x:ProtectConte nts>False</x:ProtectConten ts>
<x:ProtectObjec ts>False</x:ProtectObject s>
<x:ProtectScena rios>False</x:ProtectScenar ios>
</x:WorksheetOpti ons>
</x:ExcelWorkshee t>
<x:ExcelWorkshe et >
<x:Name>GateMov es</x:Name>
<Table x:name="GateMov es" 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="NewData Set/Table">
<tr>
<td class="xlEach">
<xsl:value-of select="Month" />
</td>
<td class="xlEach">
<xsl:value-of select="Activit y" />
</td>
<td class="xlEach">
<xsl:value-of select="count" />
</td>
</tr>
</xsl:for-each>
</tr>
</Table>
<x:WorksheetOpt ions>
<x:ProtectConte nts>False</x:ProtectConten ts>
<x:ProtectObjec ts>False</x:ProtectObject s>
<x:ProtectScena rios>False</x:ProtectScenar ios>
</x:WorksheetOpti ons>
</x:ExcelWorkshee t>
</x:ExcelWorkshee ts>
</x:ExcelWorkbook >
</xml>
</head>
<body >
<table border="1" cellpadding="0" cellspacing="0" width="100%" x:worksheet="Ga teMoves">
<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="NewData Set/Table">
<tr>
<td class="xlEach">
<xsl:value-of select="Month" />
</td>
<td class="xlEach">
<xsl:value-of select="Activit y" />
</td>
<td class="xlEach">
<xsl:value-of select="count" />
</td>
</tr>
</xsl:for-each>
</tr>
</table>
</body >
</html>
</xsl:template>
</xsl:stylesheet>[/CODE]
With Thanks,
Sudha
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
[CODE="xml"]
<?xml version="1.0" encoding="utf-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xmlns:o="urn:sc hemas-microsoft-com:office:offi ce"
xmlns:x="urn:sc hemas-microsoft-com:office:exce l"
xmlns:s="urn:sc hemas-microsoft-com:office:spre adsheet"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ut f-8" />
<style>
.xlText{mso-number-format:"@";text-align:left;font-family:新細明體;fon t-size:12px;}
.xlHeader{font-family:新細明體;fon t-size:12px;backg round:#CCFFCC;}
.xlEach{font-family:新細明體;fon t-size:12px;}
.xlTitle{font-size:20px;font-family:新細明體;fon t-weight:bold;bac kground:#FFFF99 ;height:30px;}
.xlDate{mso-number-format:"yyyy/mm/dd_ ";}
</style>
<xml>
<x:ExcelWorkboo k>
<x:ExcelWorkshe ets>
<x:ExcelWorkshe et>
<x:Name>summary </x:Name>
<x:WorksheetOpt ions>
<x:ProtectConte nts>False</x:ProtectConten ts>
<x:ProtectObjec ts>False</x:ProtectObject s>
<x:ProtectScena rios>False</x:ProtectScenar ios>
</x:WorksheetOpti ons>
</x:ExcelWorkshee t>
<x:ExcelWorkshe et >
<x:Name>GateMov es</x:Name>
<Table x:name="GateMov es" 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="NewData Set/Table">
<tr>
<td class="xlEach">
<xsl:value-of select="Month" />
</td>
<td class="xlEach">
<xsl:value-of select="Activit y" />
</td>
<td class="xlEach">
<xsl:value-of select="count" />
</td>
</tr>
</xsl:for-each>
</tr>
</Table>
<x:WorksheetOpt ions>
<x:ProtectConte nts>False</x:ProtectConten ts>
<x:ProtectObjec ts>False</x:ProtectObject s>
<x:ProtectScena rios>False</x:ProtectScenar ios>
</x:WorksheetOpti ons>
</x:ExcelWorkshee t>
</x:ExcelWorkshee ts>
</x:ExcelWorkbook >
</xml>
</head>
<body >
<table border="1" cellpadding="0" cellspacing="0" width="100%" x:worksheet="Ga teMoves">
<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="NewData Set/Table">
<tr>
<td class="xlEach">
<xsl:value-of select="Month" />
</td>
<td class="xlEach">
<xsl:value-of select="Activit y" />
</td>
<td class="xlEach">
<xsl:value-of select="count" />
</td>
</tr>
</xsl:for-each>
</tr>
</table>
</body >
</html>
</xsl:template>
</xsl:stylesheet>[/CODE]
With Thanks,
Sudha
Comment