Skip to Content
0
Former Member
Aug 04, 2009 at 10:35 AM

CR2008 - XSLT not being applied

152 Views

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>