rizmerc Posted August 5, 2006 Share Posted August 5, 2006 Hi,I have a requirement that needs me to create variables at run time which will store counts. I cannot create these variables at compile time as I do not know what they will be and how many there will be. Here is the exact scenario. Our model has 3 types of services, "Receiving", "Shipping" and "Accessorial"The user can define as many subtypes under these types...so the services might be something like this.. Receiving - BoxesReceiving - PalletsShipping - BoxesShipping - EnvelopesAccessorial - Shrink Wrap We receive in our jasper reports a list of services rendered. I would like to keep count of the number of each sub type rendered. So for example, the reports summary would say SERVICE RENDERED TOTAL UNITS--------------------------------------Receiving - Boxes 6Receiving - Pallets 7Shipping - Boxes 4Shipping - Envelopes 2Accessorial - Shrink Wrap 10 Can this be done in jasper reports?? Please help! thanks,-Riz Link to comment Share on other sites More sharing options...
Alexander Merz Posted August 5, 2006 Share Posted August 5, 2006 Sounds like you want to add a subreport holding this information. Link to comment Share on other sites More sharing options...
rizmerc Posted August 5, 2006 Author Share Posted August 5, 2006 not sure if subreports can help me. i need a summary of subtypes which are user defined. how would i create a counting variable for the subtype "Boxes" of type "Receiving" when I do not know at compile time what the subtype name is? Link to comment Share on other sites More sharing options...
Teodor Danciu Posted August 7, 2006 Share Posted August 7, 2006 Hi, I think the scriptlet functionality would give you the flexibility you need.You could pass to the report the list of subtypes as a parameter of type Collection.Then, in the scriptlet implementation, you would have the freedom to build the complex data structure you hold those counts and in the mean time you would have the instruments to perform conditinal incrementing of those counts using your own code. In the end, you'll probably use a small subreport to displat those counts, because you don't know at design time how many counts there'll be. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
Alexander Merz Posted August 9, 2006 Share Posted August 9, 2006 Instead of using a scriptlet, you can also extend the datasource class to collect the data and pack the collected data into a second datasource class (ie. JRMapCollectionDataSource) and pass this object to the subreport. Link to comment Share on other sites More sharing options...
prancius Posted August 31, 2006 Share Posted August 31, 2006 Did you solved the problem? 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