Wednesday, 15 February 2012

java - Birt Report with Dynamic Column -


I want to create a Birt table report with a dynamic number of columns from the XML data source. How can I go about it?

By searching I have read that it can be done with a scripted script, but I can not get an example or document how to use a scripted data source with a XML data source.

I have also tried cross tab which works only for certain form groups (it does not work with strings).

Here's a sample xml:

  & lt; Table & gt; & Lt; Line & gt; & Lt; Name & gt; & Lt; / Name & gt; & Lt; Question_1 & gt; The answer & lt; Question_1 & gt; & Lt; Question_2 & gt; The answer & lt; Question_2 & gt; & Lt; / Row & gt; & Lt ;! - Or it may be this way that I can control how XML is generated - & gt; & Lt; Line & gt; & Lt; Name & gt; & Lt; / Name & gt; & Lt; Question & gt; The answer & lt; Question & gt; & Lt; Question & gt; The answer & lt; Question & gt; & Lt; / Row & gt; & Lt; / Table & gt;  

The number of questions for different XML is different but they are similar to the rows within an XML I want the data to be shown in table form in this form

< Pre> names | Question_1 | Question_2

As you mention this question, I think that The easiest way is to have a crosstab; Actually the datacobules work with numerical measures, but we can solve it by making a dummy measurement as an expression in the underlying datacube with "answer". Set the type of "string" to measure and the "first" set, then the crosstab should display each question in the cells


No comments:

Post a Comment