on 08-04-2009 11:35 AM
Hello
Crystal Reports 2008 SP0
I have created a customer XSLT and imported it into a report
When i export the report using XML, and then select My xslt as the transform option, the outputted file is identical to the file generated when i use the Crystal Reports default transform
The workflow i expect is
Report --> Crystal Reports default xml format --> my custom xslt transform --> output similar to CSV
The transform expected by my custom xslt is not happening
Steps to import the cslt file:
File > Export > Manage XML Exporting formats > Add
Enter a name
Enter CSV as the Outpur file extension
Import XML Transform and choose the file listed below
Any help would be great thanks
Best regards
Patrick Coote
The xslt file is below:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b="urn:crystal-reports:schemas:report-detail">
<xsl:output method="text" encoding="utf-8" indent="no"/>
<xsl:template match="/b:CrystalReport">
<xsl:text>"CODE","DESCRIPTION","AMOUNT"</xsl:text>
<xsl:text></xsl:text>
<xsl:for-each select="b:Details">
<xsl:text>"</xsl:text>
<xsl:value-of select="b:Section/b:Field[@Name="CODE1"]/b:Value"/>
<xsl:text>",</xsl:text>
<xsl:text>"</xsl:text>
<xsl:value-of select="b:Section/b:Field[@Name="DESCRIPTION1"]/b:Value"/>
<xsl:text>",</xsl:text>
<xsl:text>"</xsl:text>
<xsl:value-of select="b:Section/b:Field[@Name="AMOUNT1"]/b:Value"/>
<xsl:text>"</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Oops
These lines
<xsl:value-of select="b:Section/b:Field[@Name="CODE1"]/b:Value"/>
should read as
<xsl:value-of select="b:Section/b:Field[@Name='CODE1']/b:Value"/>
That is, single quotes around the field names
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know this is an old, old post. Just came across it doing other searches, so thought I'd fill in the blanks...
Update to SP5:
http://scn.sap.com/docs/DOC-27917
And see the blog Crystal Reports 2008 - Simplify Management of XML Export Formats
- Ludek
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.