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)
how to add all the datasets in one column and display
birt_ag
<p>Hi,</p><p> </p><p>I'm using xml as a datasource, </p><p> </p><div>currently i'm using a grid and putting all the elements of a dataset in individual column.</div><div>But this results in lot space b/w columns.</div><div>The text size of all the elements can also vary so i'm not able to prefix the size of any of the columns.</div><div>is there any way to overcome this ?</div><div> </div><div>Attached image shows how i'm using the dataset.</div><div> </div><div>What i require is element of A.3.1.3d + A.3.1.3c + A.3.2.2a + A.3.2.2c + A.3.2.2f + A.3.2.2d</div><div> </div><div>I tried adding all the dataset rows in expression builder like this -
dataSetRow["A.3.1.3d"] + dataSetRow["A.3.1.3c"] + dataSetRow["A.3.2.2a"] + ..............and so on</div><div> </div><div>But since there is a possibility of all the tags mentioned above not appearing in xml , this is resulting in NULL displayed in the report.
How can o overcome this ?</div><div> </div><div>Any help on this would be of great use !!</div><div> </div><div>Thank U .. </div>
Find more posts tagged with
Comments
micajblock
<p>Use an if condition to check for null of the data set rows.</p>
birt_ag
<p>There are 6 elements of a dataset.. If there was two i could have used if-else</p>
micajblock
<blockquote class="ipsBlockquote" data-author="birt_ag" data-cid="123256" data-time="1389197334"><div><p>There are 6 elements of a dataset.. If there was two i could have used if-else</p></div></blockquote><p>Not true. if you post sample data in a CSV file I can post an example. BTW, what version of BIRT are you using?</p>
birt_ag
<p> Hi mblock,</p><p> </p><p>I'm using xml as datasource and I'm attaching the same.</p><p> </p><p>Thanks for the quick help</p>
micajblock
<p>OK, not very helpful example as there is only one row and none of them are nulls. Never mind about the sample data, I can improvise. Still I need to know which version of BIRT you are using.</p>
birt_ag
<p>I'm extremely sorry, using BIRT 4.2.0</p><p> </p><p>Just to re-confirm, there will be only one row of all the tags. But the length of characters in each tag can vary.</p><p> </p><p>Thank U</p>
micajblock
<p>In the attached file I am solving your problem in two different ways. The first is in the expression of the data item where the expression looks like this:</p><div><pre class="_prettyXprint">var myTextArray =new Array();if (dataSetRow["String1"] != null) {myTextArray.push( dataSetRow["String1"]);} if (dataSetRow["String2"] != null) {myTextArray.push( dataSetRow["String2"]);} if (dataSetRow["String3"] != null) {myTextArray.push( dataSetRow["String3"]);} if (dataSetRow["String4"] != null) {myTextArray.push( dataSetRow["String4"]);} if (dataSetRow["String5"] != null) {myTextArray.push( dataSetRow["String5"]);} myTextArray.join(" ");</pre><p>The other is calling a function written in an external JavaScript file (also included) with similar code.</p></div><p> </p>
birt_ag
<p>Hi,</p><p> </p><p>Thanks a lot for the solution mblock. It was of great help
</p>
micajblock
<p>You're welcome</p>