BIRT Exchange Forum: BIRT Exchange Forum -> Michael's BIRT Blog

Jump to content


 

BIRT Poll: Have you ever done any development work on mobile?

Yes - lotsYes - someNo - but plan toNo time or interestWhat is mobile?
Page 1 of 1

Last Week in the Forums: Getting Today's String Day in a Chart's Title, Passing Data Between Queries in a Report, and more...

Posted by mwilliams  Icon, 26 September 2011 - 06:45 AM

This blog series takes a look back at the past week in the forums, recalling how active they were and highlights some of the questions asked that seem to frequent the forums or other interesting topics. The forums have been busy all year. Quite a bit busier than last year, it seems, though I don't have the numbers on this in front of me. :) Luckily, many members are contributing answers to help with the extra traffic. Many great questions and answers are being posted every day. As always, thanks to those users who help answer questions! It is a great help to the community!

The first topic for this week is how to get today's string day (Monday, Tuesday, etc.) into your chart title. The poster wanted to grab the day of week from today's date and create their chart title with this value. This can be done by creating a date format that only shows the string day of week and then using the value in your chart script to set the title of the chart. An example is shown in the forum thread that shows how to do this. If you're not interested in setting the day of week in the title, but just want to dynamically set your chart title, this example will also be helpful.

The second topic for this week is about passing data between queries in a report. Sometimes you need to use data from one dataSet to get the appropriate data from another for your report. One way to do this is to create a joint dataSet to join all of the data, but if you have large amounts of data, this can cause processing to be very slow. The ideal way to do this is to take the data from the first dataSet and pass it as a parameter in the second query. There are at least a couple ways to do this in BIRT. One is to use a dataSet parameter in the second dataSet, embed a table for this dataSet into a table for the first dataSet, and use the dataSet parameter binding feature to pass the value from the outer table to the inner table's query to grab only the appropriate data. Another way, that is described in the forum thread is to embed the second dataSet's table into the first dataSet's table and in the onCreate script of the outer table, you'd set a global variable to have the value you want to limit your inner query by, and then in the beforeOpen of the inner dataSet, you can use this variable to set your where clause in your queryText.

The last topic for this week is how to create a rolling sum in your dataSet. There are standard aggregations to create a sum for an entire column or to keep the running sum, but a rolling sum for a specified period is not a standard aggregation. The poster wanted to be able to keep a sum of their data fro the last 12 months. When they reached the 13th month, they wanted to disclude the first month from the total. To do this, you can create a computed column in your dataSet that uses an array to keep track of the previous values so you can create your rolling sum. An example is included in the forum thread.

Again, this is just a small sample of what went through the forums this past week. For more questions and answers that have been posted, check out the forums. As always, if you have a question, feel free to ask it, and if you see a question you know the answer to or have a similar experience to, feel free to post an answer or comment.

Filed in BIRT, BIRT-Exchange, Charts, Parameters, Computed Column, Rolling Sum

Page 1 of 1

« June 2013 »

S M T W T F S
1
2345678
9101112131415
1617 18 19202122
23242526272829
30

My Picture

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)

Categories

Search My Blog

Twitter