Jump to content
Changes to the Jaspersoft community edition download ×

Generating Dynamic report based on user selected c


kunkasurendra

Recommended Posts

Hai all,

 

 

Subject : Generating Dynamic report based on user selected columns

I am new to JasperReports. I want to generate the Ad Hoc reports using the JasperReports API.

 

For this I am displaying the columns on jsp.

From jsp (Front-end) user may select different columns to get the report. If user select 2 columns (UserID, UserName) and select PDF then on PDF file 2 columns will be displayed with data.

If user select 4 columns (UserName, UserAddress, UserId, Email) then on pdf/html it will display a report with that columns and sequence of columns also can be changed.

 

 

1. How will I send this dynamic columns (database table field name) to Jasper?

 

I want to generate the .JRXML or report file dynamically based on the user selection.

 

 

Is it possible any way Using JasperReport API.

 

Please help me.

 

 

 

Thanks in advance,

 

Surendra Babu. K.

Post edited by: kunkasurendra, at: 2007/08/06 10:18

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hai,

 

I am not taking about parameters passing to to the where cluase.

 

Ii am talking about ad hoc report generation,

 

for example in my table i have 6 columns,

 

suppose user may select 2 columns,it will create the report with two columns,he may select 3 columns,it will create the report with three columns,like that.

 

 

please if have any idea on that help me.

Link to comment
Share on other sites

Hi,

 

Another idea: let the select unchanged, with all columns included. For each column in the select create a flag. If column was selected, set the related flag to true, otherwise let it be false. Pass all those flags as parameters to the report.

For each textfield representing a column, write a printWhenExpression so that the associated flag to be true.

 

Do the same thing for each column header/footer.

 

hth,

sanda

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...