bilal sidiqui

+ Follow
since Aug 09, 2010
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bilal sidiqui

Hello Tina,

I'm not sure exactly what you are doing, but it appears you need to do some calculations in your report. All calculations are generally part of the *report design procedure* and should not have anything to do with java code. JasperReports provides rich features to do everything from simple sum and average to complex mathematical calculations over whatever records you chose. And you can use all these features of JasperReports with iReport.

My JasperReports book demonstrates the whole *design procedure* of reports that require logical, mathematical, or statistical calculations. You may want to go through the sample chapter (titled "Using Mathematical and Logical Expressions") of the book that is available for free download:

The chapter demonstrates and explains how to calculate the sum/average/maximum of a column or things like that.
Hi Mark,

Yes, Martijn is right. Cookbooks mostly tell how to solve specific problems, address real issues and demonstrate step-by-step solutions. You can check out the free sample chapter of my JasperReports cookbook and compare with your copy of JasperReport 3.5 for Java Developers to understand the difference.
iReport is normally helpful to handle these small things. Did you use the Pattern editor dialog of iReport? The dialog plays with the pattern property of JasperReports and allows you to use different types of patterns for Date, Time, Currency, Number etc. You can use currency symbols directly in the pattern property, see the following JRXML code example.

You can see the pattern property of the text field, which uses the dollar($) symbol.

My JasperReports book demonstrates many of these small but useful things like the pattern editor of iReport. The book also gives you a variety of ways in which you can use these features.
Hi Sandeep,

You are including HTML representation of the jasper report directly into your jsp file. The HTML file in turn always uses images. I guess the problem is due to the cache either on the browser or on the Web server. That’s because two things (the HTML file and accompanying images) are being cached.

So try to fetch the actual HTML code from JasperReprots library and dynamically embed that code instead of including the HTML file. In addition, you may have to develop JSP logic to include some random number in the names of image files.
13 years ago
Hello Gian,

Yes David is right, JasperReports is just a Java library and it can be used anywhere a Java lib can be used. I guess ColdFusion allows using Java libraries, but I have never used ColdFusion.

Any way my book does cover using JasperReports in JSP applications.
Is it possible for you to post the JRXML that you are using to show a parameter in bold? The correct JRXML will be something like the following:

Assuming you are using iReport, when you drop a parameter into your report, what you see in the report is a field associated with a parameter. If you check “Bold” property of the field, it should show as bold.

By the way my JasperReports book has more than a dozen of such examples.
Well I wrote the JasperReports book with version 3.6.0 and one of my colleagues tried all the recipes with 3.7.0. He reported only minor problems while working with 3.7.0. In our company we are still using 3.6.0 and I don’t think it is worth shifting to 3.7.0. I guess there are some features and bug fixes in 3.7.4 but I haven't tried anything after 3.7.0.
Hello Vidhya,

JasperReports provides full flexibility of using a wide variety of datasources including XML.

Acting as a consultant for an energy meter manufacturing company, I designed the XML schema to represent energy consumption data of a metropolitan city. The city had many grid stations, each grid station had several feeders, each feeder was feeding into a number of transformers and eventually each transformer was connected to a few dozen electricity consumers. I used JasperReports to provide a set of very comprehensive reports about the energy consumption data of the entire city consisting of over a million consumers.

So, customized XML is no problem for JasperReports. You can use XPath to map data elements from your XML to JasperReports data fields. Then you design your Jasper report using the data fields.

This extract from my JasperReports book is a step-by-step demonstration of creating a Report from customized XML using XPath.

Please try this recipe and I hope it will show you exactly what you need to do with your customized XML in order to generate a report. And, if you have a spec of time, please let us all know on this forum what you learned from my recipe.
JasperReports can be integrated easily into any Java based framework or application (e.g. Spring or Hibernate). So integration is not an issue at all. I have seen university students playing with JasperReports integration into open source ERPs like ADempiere.

Also I have used JasperReports in real production environments involving huge amounts of data (e.g. millions of records being processed to generate a number of direct as well as summary reports). So I'm sure JasperReports is absolutely reliable in production environments.

But your BIRT vs. JasperReports question is very interesting. I also want to find out the real criteria to compare the two. If some one can actually make the comparison, that will be really helpful.
Hello Yati,

If multiple sources mean multiple tables of the same database, then you can do this just by writing the correct SQL query.

If you want to connect multiple databases, you need to use a subreport component for each new database. Please see the following recipe from my book, which demonstrates how to use different subreports (each connected to its own database) in a master report.

Using Multiple Relational Databases to Generate a Report.

Please also note that my JasperReports book demonstrates the use of variety of datasources including relational databases, XML files, and JavaBeans.
JRXML files actually hold the design of your report. PDF or CSV or Excel are all just file formats and the same JRXML (e.g. abc.jrxml) normally should be able to generate all the different file formats. So I don't know why you are changing your abc.jrxml just to generate another file format. Can you tell me why?
Hello Kaustubh

I am wondering what framework and server you are using. For example, are you doing all this in a JSP or a JSF application?
I think a good practice is to have a folder for all subreports of a particular master report. JasperReports provides a parameter named "SUBREPORT_DIR", which can hold the location of the subreports folder.

Unfortunately relative URL's don't work in JasperReports.

If your subreports are running around, I don't see any way of finding a simpler solution.

Anyway the use of subreports is comprehensively covered in my book.

The book demonstrates integration of JasperReports into JSP/Web applications, but it does not touch Flex at all, because it is a totally different topic. I guess you can follow either of the following two ways to use JasperReports in Flex applications:

1. Embed Flex within a JSP page. This way you can also include your Jasper report into the JSP page.
2. Do the real work. Transform/Embed the html (and corresponding images) from JasperReports into your MXML.
According to my observation, orientation of the master report is applied to all subreports. For example, if a subreport has landscape orientation while the mater report has portrait orientation, the portrait orientation of master report is applied to the whole report. I did not find this idea interesting.

Using subreports is demonstrated in the book but I didn't cover playing with page orientation.