kjhuebner Posted August 1, 2006 Share Posted August 1, 2006 Hi,I have a hierarchical collection of data in a custom datasource -- a list of Employees, where for each employee, there is a list of EmployeeTasks. Whereby, when the report runs, I would like to see for each employee, a display of 0-n rows of EmployeeTasks. Question: Am I required to define a subreport within a master in order to display my data? Might I simply define a subdataset? If this is possible, how do I make this work? Thanks,Ken Link to comment Share on other sites More sharing options...
lucianc Posted August 1, 2006 Share Posted August 1, 2006 Yes, you need subreports to render such master-detail reports. A subdataset can be used to iterate data outside the master dataset, but it can only be connected to a chart or crosstab and not a report-like layout. HTH,Lucian Link to comment Share on other sites More sharing options...
kjhuebner Posted August 1, 2006 Author Share Posted August 1, 2006 This is unfortunate. Why do I need to create a subreport (another file to manage) just to iterate and render detail info within my report? I wish the Jasper engine would allow a SINGLE jrxml template to effectively render both a master "list" of data and an indefinite number of detail "lists" of data. This would lessen the work (and pain) required by application developers like myself in order to use the tool you are supporting in the marketplace. Nonetheless, thanks for sharing your thoughts Lucian! Ken Link to comment Share on other sites More sharing options...
kjhuebner Posted August 1, 2006 Author Share Posted August 1, 2006 Or here's another solution:If it's decided that subreport jrxml templates are required, why can't Jasper compile all templates into a single .jasper file. Again this with reduce the runtime coding overhead (for precompiled reports) I have as an application developer. Thanks,Ken Link to comment Share on other sites More sharing options...
lucianc Posted August 2, 2006 Share Posted August 2, 2006 Currently in JR a subreport is simply an independent report which is embedded into another report. This paradigm was chosen when subreport were introduced in the engine so that the maximum amount of existing logic and code would be reused. Binding a report to a subreport element is only done at run/fill time. This allows full flexibility, although in most of the cases the flexibility is not required and the subreports could be statically resolved at compile time. The features you suggest would, indeed, ease the resource management and deployment effort. The feature request list is always open:http://jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperreports/tracker.feature_requests Regards,Lucian Link to comment Share on other sites More sharing options...
chetan_33 Posted August 4, 2006 Share Posted August 4, 2006 kjhuebner, luciancAlthough I am new to this how about this solution which best fits your need.Y did Lucianc jump to subreport or subdataset? Considering you fetch the data in one go as a array list of array list in a single query with the data in certain columns (like employer, employee) repeating more (Sub reports bring in multiple queries--which affect performance) Then you can use Grouping feature of the Jasper (on employer, employee) and make it display as required I believe the only problem that can occur is if data it contains history for employee task to be displayed as in a crosstab format which can fail. Lucianc can comment more Link to comment Share on other sites More sharing options...
larsjaco Posted December 6, 2010 Share Posted December 6, 2010 (removed by poster) Post Edited by larsjaco at 12/06/2010 10:33 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