-
Add spacing to stacked bar optional grouped chart
When using optional grouping with a bar chart, bars are rendered right next to each other. You can add some space in the beforeDrawSeries event by getting the datapointhints for a particular series and changing the x location. If we have two design series we can use the afterdatasetfilled to determine how many runtime…
-
Setting Marker Size and Type through Script
Example Uses a scatter chart but should work for others. Script to change marker size, type and color based on datapoint. Also provides script to determine series maximum value which is then used to render a special marker for the max value data point. Script only posted.mmax = 0;function beforeDrawMarker( marker, dph,…
-
Collapse columns with client side script
This report uses a script tag in a text element to call a client side javascript function to hide or display column values.
-
Grouping and Table Sorting using DE API
See the beforeFactory script to see how to use the DE API to change group sorting on a table and how to add a sort to a table.
-
Date Validation
In the attached example the report contains two date parameters. The second date parameter must be less than the first. To implement this I added two report elements one table and one text element. I named both of them. The table element just contains data from the sample database. The text element contains a script that…
-
Watermark Examples
Two example reports that show using script to change the background image in a report. See<br /> <br /> http://birtworld.blogspot.com/2010/12/birt-backgroundwatermark-images.html<br /> <br /> For more details.
-
Remove Chart Series Based on Parameter
Look at the beforeFactory script of the report. Based on a report parameter one of the series from the chart is removed.
-
Page Break on height
This example uses a fixed height for each row in a table. A running total is kept for each row added using an onCreate script. The table is also grouped and an aggregation element is used to determine how many rows are in each group. When each group is created the number of rows for the group is multiplied by the size of…
-
Group conditional page break
This example uses an oncreate script on the group to determine whether to do a page break or not. To get to the script select the group in the outline view and then click the script tab in report editor. The script looks like:if( this.getRowData().getColumnValue("ORDERNUMBER") == 10104 ){this.getStyle().pageBreakBefore =…
-
Long Category labels on bar chart scripts
Take a look at the first chart in the example that illustrates the issue when using long labels on the category axis. The plot size is reduced drastically. The next two charts show two work arounds using script.
-
BIRT Duplicate Rows
These examples are explained at Birt World.<br /> <br /> http://birtworld.blogspot.com/2010/10/birt-duplicate-rows.html
-
Example Scripted Data Source using Java Object Data Type
See BIRT World Blog Post for details on the example.<br /> <br /> http://birtworld.blogspot.com/2010/10/birt-java-object-data-type.html
-
Using Chart Simple API to change chart output format
This example uses the chart simple api to change the output format based on the api. The general procedure is to create your chart, then name it eg mychart in the general properties and then use a beforeFactory script to modify the chart before it runs. This example uses the following script:var mychart…
-
DE API open a report and add a chart
This de api project opens an existing rpttemplate with a datasource and dataset and adds a chart to the report. The completed report is saved. Look at the report directory in the project for the template and the report once the app is executed. Also this is an Eclipse project, so update the build path to point to the…
-
Iterate over csv files to change flat file dataset
This report was done in BIRT 2.6. It contains 2 datasources: A scripted data source to iterate over csv files in a directory and a flat file data source. The flat file dataset is nested in the scripted data set table to show a graph using a new csv file per row.<br /> <br /> See script in the report.<br /> <br /> Extract…
-
BIRT Image Examples
This entry contains a zip file with an example report and some images that need to be placed into the resource folder. The report illustrates each of the four ways an image can be included in a report using the image report item. The report contains several onCreate scripts that illustrate how to use custom logic to…
-
DE API Example to create table and group
The attached class is a simple DE API example that creates a report with a table and a group.
-
Page Totals using page variables
If you want to sum a particular column and have the sum show up in a page header or footer, a good solution for this is page variables. For example assume we have a table that lists quantities. We want to put the sum of these quantities per page in the header. First create a page variable named pageqty. Then select the…
-
Set Master Page properties using script
See the beforeFactory Script in the example for details.
-
Hide one bar in a chart using script
This example uses the fill object and sets it transparent using the following script.function beforeDrawDataPoint( dph, fill, icsc ){var hl = icsc.getExternalContext().getScriptable().getParameterValue("HideColumnQty"); if( dph.getOrthogonalValue() == hl ){ importPackage(…
-
BIRT Crosstab Introduction Article
This is an article Virgil and I wrote on crosstabs when they were introduced in version 2.2 of BIRT. While crosstab's have been improved this article is a good starting point for understanding BIRT Crosstabs and Data Cubes.
-
Minimum Group Report
This example report is an order list report and groups on the following key:if( (row["QUANTITYORDERED"]*row["PRICEEACH"]) < 5000){"OTHER";}else{ row["ORDERNUMBER"]; } <br /> So each order line number will either be grouped in the ordernumber or a lumped field called other.
-
BIRT 2.6 Webinar Examples
Contains four projects used in the BIRT 2.6 Webinar linked here:<br /> <br /> http://live.eclipse.org/node/910
-
Set Font/Style information on a report using DE API or Script
<p><span style=""font-size: xx-small;"">You can set style information using the DE API in the following ways</span></p> <p><span style=""font-size: xx-small;"">You can set properties directly <br /> data = elementFactory.newDataItem( null ); <br /> data.setProperty( StyleHandle.FONT_FAMILY_PROP,""Arial""); <br /><br />or…