Home
Analytics
Get Layout details from XML
Jeffrey
<p>Hello,</p>
<p> </p>
<p>I'm wondering if it is possible to get layout details from the XML source.</p>
<p> </p>
<p>Example:</p>
<p><text>This is a <b> bold </b> text </text></p>
<p> </p>
<p>Is it possible that BIRT uses the bold tags and designs the text with elements like this?</p>
<p> </p>
<p>I tried creating a dynamic text, but this leaves out the "bold" word.</p>
<p>Using a data element leaves this word out too.</p>
<p> </p>
<p>Can someone help me with this?</p>
<p> </p>
<p>Thank you in advance.</p>
<p> </p>
<p>Kind regards,</p>
<p> </p>
<p>Jeffrey</p>
Find more posts tagged with
Magellan BI & Reporting
Comments
Clement Wong
<p>Can you please clarify your requirement? In the attached design (created in OS BIRT 4.4.2) I'm seeing the example text you've typed in as output in both a Text Report Item with HTML format, and in a Dynamic Text item.</p>
<p> </p>
<p> </p>
Jeffrey
<p>Sorry, I haven't made myself clear. In the example you will see what I'm trying to accomplisch.</p>
<p> </p>
<p>I have an XML file as Data Source. In this XML I have the <text>This is a <b> bold </b> text </text> tag.</p>
<p> </p>
<p>When I use a data field or text field I get the following result when I export it to PDF: This is a text</p>
<p> </p>
<p>I'm trying to export it to PDF like: This is a <strong>bold</strong> text</p>
<p> </p>
<p>I don't know if this is possible, or that I'm completly doing this wrong. The reason for trying this is because we want to give layout details in the XML and make BIRT use them to generate a PDF. We generate the XML ourselves, so if I have to give other instructions in the XML that would be possible.</p>
<p> </p>
<p>Thank you.</p>
<p> </p>
<p> </p>
Clement Wong
<p>Using the XML ODA as a data source treats the <text> as a parent node and the <b> as child node, and splits your desired results. The XPATH of /text will strip out the <b> node.</p>
<p> </p>
<p>Can you read the XML file as a flat file source instead? Then you can use the Dynamic Text Report Item and set the HTML format via the <VALUE-OF format="HTML">row["InputText"]</VALUE-OF> syntax?</p>
<p> </p>
<p>Attached is an updated example based on your XML file. Please change the location of XML files to run or put the XML in the same directory as the .rptdesign.</p>
<p> </p>
<p>A second alternative is to use a scripted data source.</p>
Jeffrey
<p>Thank you for your help. The part about seeing the <b> as a child node gave me the right direction.</p>
<p>Using the Flat File Source worked when there was only one line. But in a complex XML I couldn't get it to work.</p>
<p> </p>
<p>I solved it by using: <VALUE-OF format="HTML">row["InputText"]</VALUE-OF></p>
<p>And replaced the <b> in the XML with <b></p>