• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

styling in excel sheet

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I am genearting a excel file from a XML file using XSLT. But I am not able to do any styling on that genearted file. I am following the below approach.

<?xml version="1.0" encoding="iso-8859-1" ?>

<xsl:stylesheet version="1.0"
xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:my-scripts"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:ixext="com.ingenix.app.report.xsl" >

<xsl:import href="../../../reportcommon.csv.xsl" />
<xsl:output method="text" omit-xml-declaration="yes" encoding="iso-8859-1"/>

<xsl:template match="/">
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
<ss:Styles>
<ss:Style ss:ID="Default" ss:Name="Normal">
<ss:Font ss:Color="red"/>
</ss:Style>
<ss:Style ss:ID="xl1">
<ss:Font ss:Bold="1"/>
</ss:Style>
</ss:Styles>
<xsl:apply-templates select="object" />
</Workbook>
</xsl:template>

<xsl:template match="object">
<Worksheet>
<xsl:apply-templates select="auditReports" />
<xsl:call-template name="ama-csv-template" />
</Worksheet>

</xsl:template>

<xsl:template match="auditReports">
<xsl:variable name="is-all"><xsl:value-of select="auditValue/rowNum/node()" /></xsl:variable>
<Table x:FullColumns="1" x:FullRows="1">
<Row><Cell ss:StyleID="Default"><Data ss:Type="String">
Audit Trail Report
</Data></Cell></Row>
<xsl:apply-templates select="reportHeader">
<xsl:with-param name="is-header"><xsl:value-of select="1"/>
</xsl:with-param>
</xsl:apply-templates>
</Table>
--------------------
I want to display "Audit Trial Report" bold and colorful. For that currently we are using <Row><Cell ss:StyleID="Default">..

Please how can solve this problem.... is there any other way I can solve this ??
Thanks in advance. Waiting for your replies......
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe the best way to approach this is to create a file in Excel that contains everything you're trying to create, and then saving it in the XML format. Then you could look at it to see which parts you're missing.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf Dettmer , we have mistakenly put <xsl:output method="text" > and we haven't given any name for the <worksheet> . after removing the <xsl:output method="text" > (by default 'xml') and adding the <worksheet> name it works fine.
 
reply
    Bookmark Topic Watch Topic
  • New Topic