Jump to content
Sign in to follow this  
Guest Walt

Transforming crytal reports schema

Recommended Posts

Guest Walt

I have an XML file that is an export from a crystal report. I would like to transfor or parse the data into a table format that will be used as an include in an asp page. The format of the xml file is new to me. I can work with XML files that have different element names of the same node but the crystal reports schema uses the same element name throughout the XML file. Below is the beginning of the XML file. I also need to rearrange the order of the data. In this case the desciption of the item is after the three cost levels. I am totally lost with this type of XML file.Sorry for the jumbled mess below. Any help would be greatly appreciated. I have highlited the data I need to parse for each node. The preceding FieldName="{inprd.common}" for each element is what describes the data.<?xml version="1.0" encoding="UTF-8" ?><FormattedReport xmlns = 'urn:crystal-reports:schemas' xmlns:xsi = 'http://www.w3.org/2000/10/XMLSchema-instance'><FormattedAreaPair Level="0" Type="Report"><FormattedArea Type="Header"><FormattedSections><FormattedSection SectionNumber="0"><FormattedReportObjects></FormattedReportObjects></FormattedSection></FormattedSections></FormattedArea><FormattedAreaPair Level="1" Type="Group"><FormattedArea Type="Footer"><FormattedSections><FormattedSection SectionNumber="0"><FormattedReportObjects><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="Sum ({@Price_1}, {initm.description})"><ObjectName>Field9</ObjectName><FormattedValue>$11.25</FormattedValue><Value>11.25</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="Sum ({@Price_10}, {initm.description})"><ObjectName>Field10</ObjectName><FormattedValue>$10.50</FormattedValue><Value>10.50</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="Sum ({@Price_50}, {initm.description})"><ObjectName>Field11</ObjectName><FormattedValue>$10.00</FormattedValue><Value>10.00</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{initm.description}"><ObjectName>Field12</ObjectName><FormattedValue>ABELIA EDWARD GOUCHER #3</FormattedValue><Value>ABELIA EDWARD GOUCHER #3</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="{@Available}"><ObjectName>Field13</ObjectName><FormattedValue>51</FormattedValue><Value>51.00</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{inprd.common}"><ObjectName>Field14</ObjectName><FormattedValue>PURPLE-PINK ABELIA</FormattedValue><Value>PURPLE-PINK ABELIA</Value></FormattedReportObject></FormattedReportObjects></FormattedSection></FormattedSections></FormattedArea></FormattedAreaPair>

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...