2001 JI Open Discussion Posted August 21, 2006 Share Posted August 21, 2006 By: tommy - tommy2381 Flexible reports 2005-03-02 01:34Hi. I'm new here so I don't know if I will explain this well. I need to use JasperReports and I have to do something like this: - in my template I have all available fields for the report: field1, field2, field3...and so on - to the use this fields are diplayed for selection - so the user can choose the fields that he needs for the report and the order in which these fields appears If u have any ideas ? besides modifying jasper...plz help By: ToRaX - torax RE: Flexible reports 2005-03-03 01:17Queries can be put together dynamically too, iirc. By: tommy - tommy2381 RE: Flexible reports 2005-03-03 01:20not the queries are the problem, the problem are the groups, static texts from column header...which i don't want them if some columns are not there By: Craig O'Shannessy - shanness RE: Flexible reports 2005-03-03 23:50See teodor's post about programmatically creating reports. https://sourceforge.net/forum/message.php?msg_id=1945081 I have not yet used this, but there is an example bundled with Jasper, and it seems very powerful for dynamic report generation. Craig By: ToRaX - torax RE: Flexible reports 2005-03-03 00:27You could mark the fields as "forPrompting" in your report template. Then, in your application, parse the XML report template to find out which fields need to be set. Then set them using something similar to this: jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, connection); where the Map parameters contains the fields you need to set. That's it... I did something similar. By: tommy - tommy2381 RE: Flexible reports 2005-03-03 01:07thanks.. but these fields are coming has a result an HQL query. So I need to diplayed only those static texts, groups etc... refering to those fields. I don't want to diplay a static text that reffers to col2, if I don't this field to be in the reports. By: Craig O'Shannessy - shanness RE: Flexible reports 2005-03-04 06:32But you still have the problem of positioning (i.e. if you don't want the 3rd column, the 4th and subsequent columns should move left). In this case, I believe you must adjust the report programmatically (Teodord, please correct me if I'm wrong). You can find some good info on this by searching this forum for the word "programatically". For example, this thread. https://sourceforge.net/forum/message.php?msg_id=2859012 Teodord, please consider adding JavaDoc, this would make using the API for altering reports SO MUCH more friendly in an IDE :) Will donate money for JavaDoc! Craig By: tommy - tommy2381 RE: Flexible reports 2005-03-05 00:38thanks... i already know how to handlw through the API a report design, but another requirement to this problem is that the user can change the some layout things for the template. So I hasve to keep the template. And positioning is also a problem :(... thanks again... By: Craig O'Shannessy - shanness RE: Flexible reports 2005-03-06 21:22I don't think this is a problem, you can design a report using XML, and modify it using the API I suppose the hardest thing is going to be the user interface? How were you thinking of allowing them to change layout things for the template? By: tommy - tommy2381 RE: Flexible reports 2005-03-07 05:14yes...i think static texts are a problem...because some texts should appear only when some columns are displayed... to modify a layout template...I consider something like jasperassistent...i don't know exactly..but the user can change only some texts...not the whole template... thanks for the answer... By: Craig O'Shannessy - shanness RE: Flexible reports 2005-03-08 00:32You can't modify / remove static blocks programmatically? I would have thought you could, but I've only glanced at the API, not used it. By: tommy - tommy2381 RE: Flexible reports 2005-03-08 03:24no ...u don't understand... it's possible to remove a static text... but how i know which static texts to remove ? By: Craig O'Shannessy - shanness RE: Flexible reports 2005-03-08 06:20Hi, Sorry, as I said, I haven't used the programmatic interface to jasper, but I assume you'll be able to somehow name and access the static text blocks, then you'll just have to pair them with the dynamic content . Someone reading this must have done this before? Teodord? Sorry I can't help any more Tommy, I think you need an answer from someone that has used the programmatic interface. I haven't actually even used Jasper for about 6 months, although I've got a big block of it coming up soon. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now