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

Jump to content


 

No Latest Open Poll.

  • (12 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

Creating a "Tabbed" HTML Report Design

Posted by mwilliams  Icon, 11 June 2013 - 07:40 PM

I responded to a forum post the other day about having a "tabbed" output so that the user could choose what section of the report they wanted to see by selecting a tab at the top of the report. To do this, you would set up a design with a grid at the top of the design with a single row and a column for each section/table. A HTML text box should be placed in each cell. The text box will contain a title for the section and a link that calls a javascript function that we'll create later. The contents of the text box will look like this:

<a style="text-align:center;" href="javascript:changeTab('Customers');">Customers</a>



Each text box is styled to be a tab. The farthest left tab is styled white with borders on the top, left, and right to appear selected. The other three tabs are grayed out with a border all the way around to appear deselected. Once this is done, our tabs will look like this:



Next, you'd create the sections of the report. In this simple example, tables for Customers, Employees, Orders, and Payments from the sample database were created. A bookmark was then added to each table to allow us to access the table in our client side script. If you had more than just a simple table, you could put each section's elements in a grid and bookmark the grid.

Finally, a HTML text box is placed at the bottom of the report with our script. The script takes the section value from the tab link when the user clicks on it. Based on the passed value, the style for the tab is changed to show that the tab has changed. Also, the section display style is set so that the selected section is shown. Here is a look at the full script:

&#60;script>
function changeTab(tabName){
	if(tabName == "Customers"){
		document.getElementById("Customers").style.display = "block";
		tab = document.getElementById("CustomersLabel");
		tab.style.backgroundColor = "white";
		tab.style.borderBottomColor = "white";
			
		t1 = document.getElementById("EmployeesLabel");
		t2 = document.getElementById("OrdersLabel");
		t3 = document.getElementById("PaymentsLabel");
		t1.style.backgroundColor = "silver";
		t1.style.borderBottomColor = "black";
		t2.style.backgroundColor = "silver";
		t2.style.borderBottomColor = "black";
		t3.style.backgroundColor = "silver";
		t3.style.borderBottomColor = "black";
		document.getElementById("Employees").style.display = "none";
		document.getElementById("Orders").style.display = "none";
		document.getElementById("Payments").style.display = "none";
	}
	if(tabName == "Employees"){
		document.getElementById("Employees").style.display = "block";
		tab = document.getElementById("EmployeesLabel");
		tab.style.backgroundColor = "white";
		tab.style.borderBottomColor = "white";
			
		t1 = document.getElementById("CustomersLabel");
		t2 = document.getElementById("OrdersLabel");
		t3 = document.getElementById("PaymentsLabel");
		t1.style.backgroundColor = "silver";
		t1.style.borderBottomColor = "black";
		t2.style.backgroundColor = "silver";
		t2.style.borderBottomColor = "black";
		t3.style.backgroundColor = "silver";
		t3.style.borderBottomColor = "black";
		document.getElementById("Customers").style.display = "none";
		document.getElementById("Orders").style.display = "none";
		document.getElementById("Payments").style.display = "none";
	}
	if(tabName == "Orders"){
		document.getElementById("Orders").style.display = "block";
		tab = document.getElementById("OrdersLabel");
		tab.style.backgroundColor = "white";
		tab.style.borderBottomColor = "white";
		
		t1 = document.getElementById("CustomersLabel");
		t2 = document.getElementById("EmployeesLabel");
		t3 = document.getElementById("PaymentsLabel");
		t1.style.backgroundColor = "silver";
		t1.style.borderBottomColor = "black";
		t2.style.backgroundColor = "silver";
		t2.style.borderBottomColor = "black";
		t3.style.backgroundColor = "silver";
		t3.style.borderBottomColor = "black";
		document.getElementById("Customers").style.display = "none";
		document.getElementById("Employees").style.display = "none";
		document.getElementById("Payments").style.display = "none";
	}
	if(tabName == "Payments"){
		document.getElementById("Payments").style.display = "block";
		tab = document.getElementById("PaymentsLabel");
		tab.style.backgroundColor = "white";
		tab.style.borderBottomColor = "white";
		
		t1 = document.getElementById("CustomersLabel");
		t2 = document.getElementById("EmployeesLabel");
		t3 = document.getElementById("OrdersLabel");
		t1.style.backgroundColor = "silver";
		t1.style.borderBottomColor = "black";
		t2.style.backgroundColor = "silver";
		t2.style.borderBottomColor = "black";
		t3.style.backgroundColor = "silver";
		t3.style.borderBottomColor = "black";
		document.getElementById("Customers").style.display = "none";
		document.getElementById("Employees").style.display = "none";
		document.getElementById("Orders").style.display = "none";
	}
}
</script>



This report has to be ran in straight HTML to work. Here is what the report looks like when clicking across the four tabs:



The example from this blog can be downloaded in the devShare.

Filed in client side script, tabbed report

Plug In 2 BIRT Contest - Spring 2013 Ends Soon

Posted by mwilliams  Icon, 26 April 2013 - 08:33 AM

There are only a few days left to get your entry in for the Plug In 2 BIRT Contest - Spring 2013. Be sure to get your entry in by 11:59pm PST on April 30th. If you're still looking to get started, take a look at the contest page. There are some ideas and tutorials there that should help get you started.

Any eligible entry is in the running to win an iPad®. We'll be giving three away, so there are multiple chances to win! Good luck! We look forward to seeing your entry!

Filed in contest, plug-in, devShare

Creating Derived Cube Measures and More with BIRT and ActuateOne

Posted by mwilliams  Icon, 14 March 2013 - 05:46 AM

The usability of a product is a very important factor in the productivity of its users. With enhanced usability features such as derived cube measures, filters that don't impact totals, an enhanced expression builder, and more, Actuate 11 SP4 is doing its part to keep productivity high. In this post, I'm going to shed some light on these features and demonstrate their value.

Gone are the days when BIRT Data Analyzer users and BIRT report authors are forced to define derived measures on their own. In Actuate 11 SP4, the data cube author can define the needed derived measures based on other measures from the cube, allowing the cube consumer to use them as if they are normal, non-derived measures. They won't be able to notice a difference.

On top of that, the new derived measures don't increase the size or generation time of the cube. Unlike a normal cube measure, derived measures are only computed when they are used, allowing you to save some processing time, when a measure is not used. The learning curve on this is very small, as well. The only difference between creating a standard cube measure and a derived cube measure is that the "Is Derived Measure" checkbox must be checked, as seen in the image below.

Attached Image

Have you ever filtered a table or crosstab, but then wanted to do a calculation based on the entire result set? For example, say you had a table with sales by country, but wanted to only show the top 10, so you put a filter on the table. Now, you want to figure out the percent of total sales for each of these countries. In past versions, with the filter, you could no longer do a calculation like this, over the entire, original result set. Well, now you can.

In 11 SP4, BIRT Designer Pro table and crosstab filter dialogs now allow for totals to not be recalculated to exclude the filtered values. In BIRT Data Analyzer, the filter dialogs also have the option to control whether the totals should be recalculated or not, when a crosstab is filtered.

Attached Image

Another enhancement made is to the expression builder for creating new computed columns in both the Interactive Viewer and BIRT Data Analyzer. The provided functions are now categorized into different groups, like Math, Financial, Text, etc. Additional functions have also been added to both products. Some of the new functions included are:

  • %OF - calculates the percentage for the selected column value in the scope of the selected base group. For the selected column value, the base group can be other column values, Aggregations like Group Total, Grand Total etc.
  • %OF DIFFERENCE - calculates the percentage of the difference between values in two numbers
  • RUNNINGSUM - Calculates the running total for the selected Column at the specified base group level
  • RANK - Calculates the rank for the Column value at the specified level and in specified direction

Attached Image

Creating filters in BIRT Studio also gets easier. The BIRT Studio Table Builder Wizard adds functionality to help users the option to easily define complex, composite filters. Related to this is a performance enhancement for BIRT Studio. Filters defined in the Table Builder Wizard are pushed to the underlying database, in all possible cases, allowing for data to be more efficiently filtered at the source.

Attached Image

With Actuate 11 SP4, BIRT Designer Pro also adds the capability to define which table groups start expanded or collapsed, depending on the granularity needed by creating a Named Expression called “__ac_group_collapse_level” on the containing table. The value is a comma separated list of the groups that are to start collapsed. 1 is starting value for the most outer group. The expand/collapse operations are also more efficient than ever, as they are handled completely on the client side, now, with no calls to the server.

Attached Image

Last, but not least, report authors using BDPro can now use aggregation fields in a table's sort key expression.

Thanks for reading. Next time, I'll talk about the feature upgrades for data connectivity and the iHub. In the meantime, download a free trial version of Actuate BIRT iServer and BIRT Designer Pro, to check it out for yourself.

Filed in BIRT Studio, ActuateOne, 11 SP4, Ineractive Viewer, BDPro, Data Analyzer, filter, sort, computed column, data cube

Drop Elements Depending on Output Format

Posted by mwilliams  Icon, 08 March 2013 - 06:34 PM

Sometimes when designing a report, you want to only show certain elements in certain output formats. Not just hide them, but actually drop them, so the bound dataSet doesn't run or for saved processing time. Say you want to drop a certain element from your report when you run your report to the XLS output. To do this, you'd simply name your report element in the property editor, then put the following in your beforeFactory script:

if(reportContext.getOutputFormat() == "xls"){

	reportContext.getDesignHandle().findElement("elementName").drop();

}


Attached Image

This works as you would expect, for most outputs. However, when you try this for pdf, while it does drop the correct element when you run the report in pdf, it also drops the element when you run the report in the web viewer. This is because getOutputFormat returns pdf when you run your report with the web viewer.

Attached Image

Attached Image


Luckily, there is a way around this. You also have access to the HttpServletRequest, so if you use a script like the following, in your beforeFactory, the correct format will be returned.

if(reportContext.getHttpServletRequest().getAttribute("attributeBean").format == "pdf"){
	reportContext.getDesignHandle().findElement("elementName").drop();
}


With this method, we now see that the web viewer is actually HTML and the correct element is dropped from the report.

Attached Image

This solution will only work in open-source BIRT, as the HttpServletRequest is not available in the commercial version. The sample report used in this post can be downloaded here.

Filed in drop, xls, html, pdf, web viewer

Solving a TOC Bookmark Issue by Using Multiple Fields in a Single Group Expression

Posted by mwilliams  Icon, 15 February 2013 - 09:51 PM

Using multiple fields to create a single grouping has been a solution to several different questions I've seen over the years. So, after responding to another post, today, with the same, I decided to do a little write up on it.

The question that inspired the blog post was actually about an issue with the table of contents (TOC). In the designer, when you group your table, a TOC entry is automatically created, if you simply select a field from the drop down. When you run your report to the web viewer or to PDF, there will be a bookmark link in the TOC to allow you to jump right to your grouping. The image below shows the group editor TOC expression and the corresponding TOC entries in the PDF.

Attached Image


But what if you don't want a TOC entry for a group, like our question poster? A bug fix back in BIRT 2.2.0 created a solution for this issue. If you leave the TOC entry expression blank, the group won't appear in the TOC. In this example, we'll remove the TOC expression shown above and you'll see that the orders bookmark no longer appears in the PDF output.

Attached Image


That's great. So, problem solved, right? Hold on, just a minute. In the question asked, the poster wanted to hide the middle group, but show the grouping below that one. If we go back to our example and re-add the orders TOC expression and remove the expression for the customer group, instead, all of a sudden we have an issue. The TOC show's the grouping, but just doesn't have a value next to it. You can see what I'm talking about in the image below.

Attached Image


This probably isn't going to be acceptable for hiding the TOC entry. So, what do we do now. Well, one possible solution to get around this is to join the group you're wanting to hide, with the group below it. In our example, we'll delete the orders group and write a group expression that uses both fields in the customers group.

row["CUSTOMERNAME"] + "-" + row["ORDERNUMBER"];


Now, for the TOC expression, we can simply use the inner grouping field, since we're not wanting to see the customer group. You can see the values I entered in the image below.

Attached Image


After accepting the changes to the group, we only have a couple cosmetic issues to take care of to get the exact same report look as before. I added a second row for the group and moved the order info into it, like it was before. I also changed the styling of this row to match the way it was before.

Also, now that we don't have a separate group for the customername, it will repeat for each order. To fix this, we write a little script to only show the customer name when the value changes. Now, when we preview the report, we have what we were wanting.

Attached Image


Being able to write expressions for different things within BIRT allows you to work around many of the issues you encounter. There are many of them around that come in very handy when customizing your report designs.

Thanks for reading. The example used in this blog can be found in the devShare. If you have any questions, feel free to ask them in the comment section, below.

Filed in grouping, TOC, expression builder

Visualizing the Impact of Database Changes with BIRT and ActuateOne

Posted by mwilliams  Icon, 17 January 2013 - 12:50 PM

As the business world changes with time, so does your data source's schema, i.e. changing table names, removing columns, changing data types, etc. In doing so, IT must spend lots of valuable resources updating applications that are impacted by these changes.


To help soften the blow, Actuate 11SP4 introduces new Impact and Dependency Analysis capabilities. This allows the developer to identify what applications and content must be updated with the change to the database schema, giving a much clearer picture on the cost and resources needed to complete the update, before it even begins. Additionally, such analysis allows the development team to easily identify which BIRT designs depend upon certain libraries, Information Objects, or Data Object, to easily assess the impact of updating or removing these resources.

The Database Search also allows BIRT developers to easily identify files that use and are dependent on the selected database component. With a couple clicks of the mouse, a BIRT developer can access a diagram, showing the dependency tree, for the project. The diagram also highlights the dependency path from the selected BIRT item, to all other items that would be affected by a change to this element.

The dependency Impact Analysis view can also be invoked by clicking on any file in the Outline view of the BIRT designer, such as a BIRT design, a Data Object, an Information Object, BIRT Library, etc. This gives the developer another way to access the dependency analysis information for a given file, before making any changes.

Attached Image


Another new feature, in Actuate 11SP4, is the ability to create and preview Information Objects within BIRT Designer Pro, rather than having to deploy them to a BIRT iServer as part of the authoring process. BIRT developers will still have the familiar experience they're used to, when creating the Information Object, they just no longer have to specify an iServer, though, Information Objects published to an iServer will still be available when creating designs, just like in the past. Also, to make things easier on the developer, report designs and Information Objects no longer have to be created in separate projects, allowing the BIRT developer to create Information Objects and the designs that consume them, at the same time, as part of the same project.

Publishing to your BIRT iServer, in Actuate 11SP4, has also been made easier, providing a single BIRT Designer Pro dialog for publishing your designs and resources. The dialog allows BIRT developers to choose the files they'd like to publish and also choose whether or not they should overwrite the previous version, if it exists, already, on the server. Publishing to the iServer isn't the only thing that's gotten simpler. BIRT Designer Pro also provides a new download dialog to download published or user created content, for re-use or enhancement.

Attached Image


Next time, I'll show how Actuate 11SP4 enhances the usability of the BIRT product line. In the meantime, download a free trial version of Actuate BIRT iServer and BIRT Designer Pro, to check it out for yourself.

Filed in BIRT Exchange, BIRT, Actuate, iServer, Information Objects, rptdesign, Data Object, rptlibrary, Impact Analysis

Actuate's 11SP4 Release Provides Many Powerful New Capabilities, Including HTML5 Charts and more!

Posted by mwilliams  Icon, 30 October 2012 - 05:15 PM

Actuate 11SP4 builds on the already powerful ActuateOne™ platform, by bringing many, new capabilities, to the table, like developer productivity, visualization and interactivity, end user usability, and more. These capabilities include:

  • HTML5 charts to enable consistent user experience and enhanced interactivity across conventional and mobile platforms
  • New data source types, such as, Hadoop and Salesforce.com
  • Impact and dependency analysis to ease develpment and management of applications
  • Simplified publishing to the BIRT iServer
  • Performance Optimization in BIRT Studio and Information Objects
  • Relative time period support, enabling more powerful and dynamic comparisons across time
  • and more...

One of the more major enhancements, of the bunch, is that all commonly used BIRT chart types now support HTML5 output format, along with the existing formats, SVG, JPG, PNG, and BMP. Catching your user's attention will be easier than ever with the out-of-the-box animation effects and new levels of interactivity. Custom animation effects and interactivity can also be defined, through scripting, making being forced to rely on pre-determined visualizations, a thing of the past.


Adding an HTML5 chart to your report is easy. Simply drag a chart from the palette, into your report layout, as you've always done. Only, choose HTML5 from the dropdown, instead of one of the other supported formats. Upgrading charts to HTML5, from one of the existing formats can be done by changing this same setting.

Posted Image

Making this change exposes the HTML5 chart specific properties, allowing you to preview the chart animation effects in the preview window of the chart builder. A script tab is now present in the chart builder, where custom animations, for HTML5 charts, are scripted. This script tab is also available with the other formats, for convenience of seeing everything in one place. Starting in 11SP4, theme functionality is available for all chart-specific formatting properties, like legend formatting, chart title formatting, etc. These themes can be used across all charts to give a common look/feel to your BIRT visualizations. The themes can also be exported to a library for reusability.


Next time, I'll detail how developer productivity will get a boost with Actuate 11SP4. In the meantime, download a free trial version of Actuate BIRT iServer and BIRT Designer Pro, to check it out for yourself.

Filed in Actuate, BIRT, SP4, iServer, HTML5

Getting a Marker in the Middle of a Gantt Chart Bar, Multi-Level HTML List Numbering, and more...

Posted by mwilliams  Icon, 24 September 2012 - 07:11 PM

Last Week in the Forums - 9/24/12

The first post, for this week, is about placing a marker in the middle of a gantt series bar. The poster wanted to be able to have a marker in the middle of a gantt chart bar, that was not at the beginning or the end. A gantt chart only has the option to have a marker at the beginning or end of a series. An example is provided that shows how two series can be used to make it appear as if there is a marker in the middle of the bar.

The next post, for this week, is about getting multi-level numbering in html lists. The poster wanted to be able to take an HTML list like:

<ul class="numericbullets"> 
<li>Cats</li> 
<li>Dogs 
    <ul> 
        <li>Birds</li> 
        <li>Rats
                                <ul> 
                                                <li>Birds</li> 
                                                <li>Rats</li> 
                                                <li>Rats</li> 
                                                <li>Rats</li> 
                                </ul> 
                
                </li> 
    </ul> 
</li> 
<li>Rabbits</li> 
<li>Ants 
    <ul> 
        <li>Lions</li> 
        <li>Rats</li> 
        <li>Rats</li> 
        <li>Rats</li> 
    </ul> 
</li> 
<li>Ducks</li> 
</ul>


and make it look like:

    1. Cats
    2. Dogs
        2.1 Birds
        2.2 Rats
            2.2.1 Birds
            2.2.2 Rats
            2.2.3 Rats
            2.3.4 Rats
    3. Rabbits
    4. Ants
        4.1 Lions
        4.2 Rats
        4.3 Rats
        4.4 Rats
    5. Ducks


The needed CSS styles to make this happen were failing to upload into the design. The solution that was found to work was to take the css styles:

ul.numericbullets { counter-reset:section; list-style-type:none; } 
ul.numericbullets li { list-style-type:none; } 
ul.numericbullets li ul { counter-reset:subsection; } 
ul.numericbullets li ul li ul{ counter-reset:subsubsection; } 
ul.numericbullets li:before{ 
    counter-increment:section; 
    content:counter(section) ". ";
} 
ul.numericbullets li ul li:before { 
    counter-increment:subsection; 
    content:counter(section) "." counter(subsection) " "; 
} 
ul.numericbullets li ul li ul li:before { 
    counter-increment:subsubsection; 
    content:counter(section) "." counter(subsection) "." counter(subsubsection) " "; 
}


and place them in style.css in webcontet -> birt -> styles. This style sheet is used in run and frameset. It won't work with preview, so don't be worried if you don't see this in any output that uses the preview option.

Here are a few more :


Here are a few unanswered posts, from last week:


If you have a suggestion or solution for any of these, please post in the thread!

Thanks for reading this weeks blog! 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, reporting, html lists, gantt chart, https, dataset parameters, iserver, crosstab, global function

Switch to a Default Table if no Values Returned in Query, Parameterize the From Portion of an SQL Query, and more...

Posted by mwilliams  Icon, 17 September 2012 - 06:45 PM

Last Week in the Forums - 9/17/12

The first post, for this week, is about showing a default result set if the main one is empty. The poster wanted to be able to show a default table if the parameter entered by the user returned no results. An example is posted in the thread that shows how to set the visibility of the two tables based on a variable that is set in the onFetch of the parameterized dataSet.

The next post, for this week, is about how to parameterize the from portion of an SQL query. The poster wanted to be able to use a parameter value to choose which table to use in the from portion of an SQL query. The solution provided was to use the report parameter in the beforeOpen of the dataSet, like:

this.queryText = "select * from " + params["myparameter"];


Here are a few more :


Here are a few unanswered posts, from last week:


If you have a suggestion or solution for any of these, please post in the thread!

Thanks for reading this weeks blog! 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, reporting, table, SQL, parameter, osgi, chart, svg, newspaper

Adding Text to an Image, Using Table Data for a Crosstab's Data, and more...

Posted by mwilliams  Icon, 10 September 2012 - 05:42 PM

Last Week in the Forums - 9/10/12

The first post, for this week, is about adding text to an image. The poster wanted to be able to add text to an image, within BIRT. One option could be to use the image as a background image on a grid or text element. The poster wasn't able to use this method, because background images don't export to Excel. Another solution that adds the text to the image, in script, using the image data, is attached in the forum thread.

The next post, for this week, is about using a table's output as input to a crosstab. The poster wanted to be able to feed the final results of their table to a crosstab. An example is posted in the thread that shows how to grab the table data and use it in a scripted dataSet that is used to build the cube.

Here are a few more :


Here are a few unanswered posts, from last week:


If you have a suggestion or solution for any of these, please post in the thread!

Thanks for reading this weeks blog! 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, reporting, image, pie chart, jquery, stored procedure, report engine

  • (12 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

« June 2013 »

S M T W T F S
1
2345678
9101112131415
161718 19 202122
23242526272829
30

My Picture

0 user(s) viewing

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

Categories

Search My Blog

Twitter