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

Jump to content


 

No Latest Open Poll.

Page 1 of 1

Last Week in the Forums: BIRT and R Statistical Language, Specified Sort Order for a Table, and more...

Posted by mwilliams  Icon, 17 October 2011 - 05:17 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 maintained high traffic all year. If the rest of the year continues how it has been going, we'll have a record number of posts and a higher community contribution percentage, which are both very good things! Great work, community! 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 I'll cover for this week is an unanswered one. I did this last week as well, and I think I'll continue posting an unanswered post each week to see if we can't help find it an answer. :) The unanswered post for this week is about the R Statistical Language. The poster is wanting to know if anyone has had any success using the R project with BIRT. If anyone has used these two together and can supply an answer, that would be great!

The second topic for this week is sorting a table in a specified order. The poster wants to be able to specify an order for the rows by a parameter. The solution provided is to use your SQL query to create this order and then use that. A sample query can be found in the thread. Another alternative if not using SQL or even if you are would be to create a computed column that assigns a numerical value to the rows in the order that you want them to be. Say you have row values a, b, c, and d, but you want them to show up in the order, b, d, c, a. In your computed column, you'd assign 1 to b, 2 to d, etc. Then you could use this numerical sort column to order your data with standard BIRT sorting.

The last topic for this week is alternating row colors in crosstabs. Because of how a crosstab is created, simply adding a highlight rule to do alternating highlights doesn't work. The solution to alternate highlighting in rows in a crosstab is to use script. You'll have to keep variables and check dimension values to keep your alternating colors the correct color since a crosstab works by cell rather than row or column. An example showing how to highlight the crosstab, including grand totals can be found 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, forums, R Statistical Language, Sort Order, Crosstab, Alternating Highlight

Last Week in the Forums: Sending a Report to a Different than Default Printer, Adding Hierarchy Numbers to Groups, and more...

Posted by mwilliams  Icon, 10 October 2011 - 07:21 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. We're in the 4th quarter now and the BIRT Exchange community continues to be very strong and active! 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 I'll bring up from last week is sending a report to a specific printer. The question being asked is if a different printer can be set up for a specific report that creates labels and print all other reports normally on the default printer. There is not yet a solution for this question, so if you have a good answer, please post it! :)

The second topic for this week is about adding hierarchy numbers to your titles. The poster wanted to be able to add numbers for the groupings and paragraphs in the report. For example, they have a main group title and then sub titles underneath this main title. They'd like to add numbers like:

1 Main Group 1
1 1 MG1 Sub Group 1
1 2 MG1 Sub Group 2
2 Main Group 2
2 1 MG2 Sub Group 1
etc...

The suggested answer is to use script. Some small example scripts showing this can be found in the thread.

The last topic for this week is setting a dynamic column width within a grid. The poster had a grid that they wanted to be able to size the columns of, dynamically. There is an example linked in the forum thread that shows how you can dynamically size the columns of the grid in script.

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, Forums, Print, Hierarchy, Dynamic Width

Last Week in the Forums: Using the Same Masterpage for All Reports, Stopping SQL Execution when You Don't Want to Display Your Sub Report, and more...

Posted by mwilliams  Icon, 03 October 2011 - 06:42 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 are staying steadily busy as we push into quarter number 4. I'll be gone most of this coming week at JavaOne, so I'll be scarce in the forums. If anyone has time to step in and answer some questions, that would be helpful! :) 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 I'll cover from the past week's posts is how to use the same masterpage across multiple reports. In many instances, your reports you make will all have the same page size and page header and footer information. Rather than making the same masterpage over and over again, BIRT allows you to store a masterpage in a report library. You can then attach this library to all of your reports and use the masterpage. If you need to make changes in the masterpage for all of your reports, you don't need to change each individually. A change to the masterpage in your library will be inherited by all reports that use this library masterpage. Another option suggested in the thread would be to create a template that has this masterpage linked in it so that the report developer has this masterpage from the start.

The second topic we'll cover this week is preventing your SQL from running when you don't display your subreport. If you have a parameter that decides whether you want to show detail information that is in a subreport, you don't have to just hide the table. If you know you want to hide a table by a parameter, you can simply drop the table from the design in your beforeFactory method and the database will not be accessed. The code to do this is shown in the forum thread.

The last topic for this week is changing the title of the report viewer. If you're looking to change the title of the BIRT viewer, you can simply use the url parameter __title to set whatever value you'd like. If you'd like another option, you can go into the viewer's FramesetFragment.jsp page and change the title value there.

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, Eclipse, Actuate, Masterpage, Forum, Sub Report, SQL, Viewer

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

Last Week in the Forums: Exploding the Largest Slice of a Pie Chart, Script Tag Issue with Firefox 5, and more...

Posted by mwilliams  Icon, 12 September 2011 - 06:57 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 remain extremely busy. I'm finding less time to step into the forums, so there are many opportunities to contribute back to the community sitting there! 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 exploding the largest slice of a pie chart. When you create a pie chart, there are options to explode the slices of a pie chart, but there is not an option to explode only the largest slice. To do this, you'll need to use script to grab the largest slice value and then use the expression builder in the chart editor, for what value to explode, to grab the variable you set so that the largest slice is the only one that separates from the pie. An example is included in the forum thread.

The second topic I'll discuss is the script tag issue with BIRT and Firefox 5+. It seems that there is a bug with HTML script tags and Firefox when using BIRT. When using client side scripting in an HTML text box in your BIRT report, the script tag seems to be ignored in Firefox 5 and 6. I have checked this up to BIRT 3.7.1 with the same issue. They do still work with IE, so I'm not sure if this is a BIRT change issue or a change in how FF looks at script tags that hasn't been addressed in BIRT yet. A bug has been raised on this. You can view it in the forum thread.

The last topic for this week is how to grab data from your dataSet and store it in a variable for use elsewhere in your report. The poster wanted to be able to grab the value from all lines of their dataSet and store them all in their own individual variables to manipulate within their report. The solution given was to store the values in persistent global variables in the dataSet's onFetch method. With this approach, you can name each variable uniquely according to another value in the row or with a standard base name and an incrementing value concatenated to the end of this base value to make the name. Another possible way would be to create an array and store the values in it. Then, you'd have an array of values you could step through anywhere in your report to manipulate and do what you want.

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, Pie Chart, Firefox, BIRT-Exchange

Page 1 of 1

« May 2013 »

S M T W T F S
1234
567891011
12131415161718
1920212223 24 25
262728293031

My Picture

0 user(s) viewing

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

Categories

Search My Blog

Twitter