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)
JDBC DataSource - DetailRow as DetailColumn
Miss_Anonymus
<p>Hello,</p>
<p> </p>
<p>I'm new in the BIRT World, so I don't have much experience. I hope you can help me with my problem.</p>
<p> </p>
<p>I have created a JDBC DataSource on my Report (I'm using the drag and drop plug in by eclipse) and I have a Database connected with one table. It looks like that:</p>
<p> </p>
<p><strong>user</strong> <strong>function</strong> <strong>description</strong></p>
<p>Julia cooking very fine</p>
<p>Julia washing no good idea</p>
<p>Julia do the dishes ok</p>
<p>Peter cooking fine</p>
<p>Peter washing very fine</p>
<p>Peter do the dishes ok</p>
<p>Laura cooking the worst</p>
<p>Laura washing super</p>
<p>Laura do the dishes no good idea</p>
<p> </p>
<p>Now I want to create a table in BIRT which has to look like that:</p>
<p> </p>
<p><strong>user</strong> <strong>cooking</strong> <strong>washing</strong> <strong>do the dishes</strong></p>
<p><strong>Julia</strong> very fine no good idea ok</p>
<p><strong>Peter </strong> fine very fine ok</p>
<p><strong>Laura</strong> the worst super no good idea</p>
<p> </p>
<p> </p>
<p>So, that the names are on the left and the functions on the top, under which the descriptions are listed.</p>
<p> </p>
<p>I haven't any idea how to do that. When I create a DataSet in BIRT with</p>
<pre class="_prettyXprint">
Select user, function, description
from table;
</pre>
<p>I only get the listing in the first picture. When I drag an drop the DataSet into the white area, I get a table where the three attributes are listed. There are only "DetailRows", but the function should be a "DetailColumn", how can I do that? And how can I then list the descriptions below?</p>
<p> </p>
<p>Do I have to make two DataSets, or a JavaScript Function or something else? I'm perplexed.</p>
<p> </p>
<p>Thank you so much for your help!</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>Two ways to do this:</p>
<p> </p>
<p>1. You use a cross-tab item in your report to let BIRT pivot the data. I have attached an example based on your data, but using a flat file;</p>
<p> </p>
<p>2. Pivot the data in SQL. Many commercial have proprietary SQL extensions to pivot row data into column; I'll let you find them based on the database your are using. You can also use this SQL statement to pivot your sample data; it should work everywhere:</p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;">select t1.USER<br>
, min(t1.COOKING) as cooking<br>
, min(t1.WASHING) as washing<br>
, min(t1.DO_THE_DISHES) as do_the_dishes<br>
from<br>
(select user<br>
, case when function = 'cooking' then description end as "cooking"<br>
, case when function = 'washing' then description end as "washing"<br>
, case when function = 'do the dishes' then description end as "do_the_dishes"<br>
from test) t1<br>
group by t1.USER</span></p>
<p> </p>
<p>Once pivoted, you can use a simple table to display the results in BIRT</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
Miss_Anonymus
<p>Thank you so much for your help!</p>
<p> </p>
<p>I used your rtpdesign File as example and adapted it to my JDBC Connection...it works fine! The crosstable was the exact result I wanted.</p>
Miss_Anonymus
<p>Just one more question... how can I insert a default message like "no description", when in field description nothing is found? Now there is just a white, blank space.I tried clicking on the measure summary cell and wrote at the alternate text option something...but doesen't work.</p>
<p> </p>
<p>What can i do?</p>
Miss_Anonymus
<p>....And how can I adapt the word wrap for the column headers, the functions?</p>
<p>There is an automatic break after a white space, that's ok, but I want to break it after a letter, when the word is too long, for example:</p>
<p> </p>
<p>Hello this is a </p>
<p>veryveryvery<em>veryvery long <-- </em><strong>the italic part is cut of</strong></p>
<p> </p>
<p>but I want</p>
<p> </p>
<p>Hello this is a</p>
<p>veryveryvery</p>
<p>veryvery long</p>
<p> </p>
<p> </p>
<p>Just cut of at a letter where it gets too long. </p>
<p>Which approach is that?</p>
<p> </p>
<p>I hope you can help me.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>The first question is easy: you can set a string that will appear in a cell if the value is null. You can find this property in the CrossTab Property Editor under Empty Rows/Columns as shown in this screen shot:</p>
<p>
Miss_Anonymus
<p>Thank you much ! I finally got it...</p>