Help needed

View: New views
1 Messages — Rating Filter:   Alert me  

Help needed

by Abhishek Kaukuntla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
Is there anyway to pass a field value to the subreports so that the subreports can check that value and print the data related to that only value?

If yes, then is there anyway that the group expression in subreports can print values placing a condition on that passed value?

Lemme just give you the structure of my reports.

I have 2 subreports in my master report. My master report is as:

             
------------------------------------------------------------------------------------------------------------------ 
           Page Header: prints <organization1>
------------------------------------------------------------------------------------------------------------------
 Group2_Header: prints <branch1>
-----------------------------------------------------------------------------------------------------------------
Detail Band:
 Subreport1 has to print only requests of <branch1> which is of <organization1>
  Subreport1 also prints the total number.
 Subreport2 has to print only responses of <branch1> which is of <organization1>
  Subreport2 also prints the total number.

  Then, the master report prints the total from both the subreports.

------------------------------------------------------------------------------------------------------------------
 (Group2_Header and detail band continues until they
 print all the values from all the branches of the same <organization1>
        the organizations.
 
------------------------------------------------------------------------------------------------------------------
 
 Group2_Footer: Prints the total of requests and responses from all the branches of <organization1>
------------------------------------------------------------------------------------------------------------------
 If theres <organization2>, etc., this process goes on.
------------------------------------------------------------------------------------------------------------------

   Group1_Footer: Prints the total of requests and responses from all the organizations
------------------------------------------------------------------------------------------------------------------

Now the problem I have is that both the subreports print the values of requests and responses of all the branches in all the branches. They are not breaking when they find a new branch. I know its just a trick away but I'm new to this jasper reports and am finding ways to solve this.

I want the subreport1 to print values of <branch1> first and when it finds the <branch2> it should break and let subreport2 print all the values of <branch1> and then the master report prints the total from these 2 subreports. When there exists <branch2 from the same <organization1> the master report should print it and then the subreports should print the requests and responses of this <branch2> only and break. When all the values are printed I want to add up all the values from all the branches and all the organizations in the master report.

Note:
The webpage has organization and branch fields. If the organization field is entered a value and the branch field is left blank then the report should show up the all the branches of the entered organization. So, I don't think the master report has the <branch> parameter (because that field is empty on the webpage) so that it can pass it to the subreports.

I know if I had the <branch> parameter with the master report things would have been very smooth.

I wonder if there is a way to pass the field value in master report to subreports and have a condition on that and fill the subreports, would work. So, what's the best way to implement this? Am I on the right path?

Any help is really appreciated.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jasperreports-questions mailing list
jasperreports-questions@...
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions