Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Despaly data from XML which is kept in VARCHAR data type column!!
santoshsingh1056
<p>I am new to BIRT report. In my current project there is requirement to show data from xml. The xml is kept in DB column which is of varchar data type. From select query written in DataSet we can get the data but this is XML. Now I need to bind the data in report designer from that XML so that end user will see actual detail only in designed format.</p>
<p> </p>
<p>The BIRT version I am using is<strong> 3.2.23.</strong> We use <strong>eclipse-reporting-indigo-SR2-win32</strong> to write or edit reports.</p>
<p> </p>
<p>help please!!!</p>
Find more posts tagged with
Comments
Clement Wong
<p>What's the XML string look like?</p>
<p> </p>
<p>Is it a single value that needs to be displayed to the end user? If so, there was a sample on DevShare (archived @ <a data-ipb='nomediaparse' href='
http://birtdemo.googlecode.com/svn/trunk/design/datasource/parsing xml string/)'>http://birtdemo.googlecode.com/svn/trunk/design/datasource/parsing xml string/)</a>that
uses a computed column to retrieve that single node.</p>
<p> </p>
<p>Or multiple values? You will first need to execute the SQL to retrieve the XML from the db with either of these two options:</p>
<p> </p>
<p>[Option 1]</p>
<p>You can either create a Data Source/Data Set, drag that table to the Layout (but change the Visibility to False) -- the query will be executed but the contents will not be displayed. You can save off the XML to a global variable in the onFetch event of the Data Set. </p>
<p> </p>
<p>[Option 2]</p>
<p>Write code in the beforeFactory to execute the SQL to get the XML. Look at this DevShare @ <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/822-data-engine-api-to-check-data-set-values/'>http://developer.actuate.com/community/forum/index.php?/files/file/822-data-engine-api-to-check-data-set-values/</a>
; if you are not familiar with this technique.</p>
<p> </p>
<p>Once you have the XML, for both the options, you will create/use a Scripted Data set to iterate over the XML to populate the values you need.</p>
<p> </p>
<p> </p>
<p>Please note that parsing XML in BIRT is very easy. You can use the included <a>Mozilla Rhino JavaScript extension </a><a>E4X</a>. There's an example <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/1122-parsing-xml-in-birt-with-e4x/'>DevShare
here</a>.</p>