Author |
Message |
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|
Topic: Main Report - Subreport Link for recursive Posted: 09 Oct 2009 at 11:39am |
Hi,
I desigend a report with subreports.
The main report and the sub-reports are linked in a way that main report produces a set of records say Customer Details (one record per customer) and the sub-report is designed to produce all the transaction details for the list of customers from Main report.
In my case sub-report do produce the output but it produces only for the last customer (i.e its not happening recursively for all customers).
I linked Customer ID between Main and Sub-report in a standard way.
Please help me to solve this issue of getting all transaction details for all customers listed on Main Report.
thanks,
raj
|
Cheers
Raj
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 09 Oct 2009 at 11:45am |
Sounds like you placed it on the report footer and therefore it will run only once and use the last record ID for the link.
You need to either place the sub-report on the detail row if you have one detail row per customer, or a group header or footer if you are grouping on the customer id.
Edited by DBlank - 09 Oct 2009 at 11:45am
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|
Posted: 09 Oct 2009 at 11:49am |
Hi,
Thanks for you reply.
You are absolutely correct, but the main report is getting split by sub-report result.
I want main report to print first and then the sub-report with details.
thx
Raj
|
Cheers
Raj
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 09 Oct 2009 at 11:52am |
If you want your Main report to print all Rows then you have a sub-report to print all rows then unlink your subreport.
The select statement in the subreport should define what data appears and there will likely be no link at all.
Edited by DBlank - 09 Oct 2009 at 11:52am
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|
Posted: 09 Oct 2009 at 12:02pm |
Hi,
So in that case by doing a link I cannot print main report first and go for Sub-report.
Is there anyother approach or design to achive this model??
Thanks in adv.
Raj
|
Cheers
Raj
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 09 Oct 2009 at 12:13pm |
I am not sure what you mean by this.
When you link on a field it becomes part of the data select process in the subreport. Think of it as a parameter field that gets put into your sub-report select statement. Wherever you place the subreport in the main report the data value from that row in the main report will be passed to the subreport as the parameter and limit the data in the subreport to that information (and any other select statement you added to the subreport).
Therefore if you want all records from the table in the subreport to run all at once you do not link it to the main report.
Does that help?
Edited by DBlank - 09 Oct 2009 at 12:14pm
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|
Posted: 09 Oct 2009 at 12:21pm |
Let me give an example here,
First Page of the Report:
"This is from Main report."
Cust ID, Cust name
000001, XXXXXXXX
000002, YYYYYYYY
Second and running Page of the Report:
Transaction Details for Cust 000001, XXXXXXXX
AAAAA,BBBBBBB,CCCCCCC......
................................................
Transaction Details for Cust 000002, YYYYYYYY
AAAAA,BBBBBBB,CCCCCCC......
................................................
This is what I am looking at to achive,
But now what I aam getting is,
First Page of the Report:
"This is from Main report."
Cust ID, Cust name
000001, XXXXXXXX
Transaction Details for Cust 000001, XXXXXXXX
AAAAA,BBBBBBB,CCCCCCC......
................................................
000002, YYYYYYYY
Transaction Details for Cust 000002, YYYYYYYY
AAAAA,BBBBBBB,CCCCCCC......
................................................
Hope this helps to understand my requirement.
Thx
Raj
|
Cheers
Raj
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 09 Oct 2009 at 12:39pm |
You can add subreports to main report and NOT LINK THEM and they can still function.
If you place the SubReport in the Report Footer (like you originally did) and then right click on it and select Change Sub Report Links, click on the left arrow button to remove the link and then select OK.
This gets rid of the LINK but the sub report will still RUN.
Make sense?
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|
Posted: 09 Oct 2009 at 1:02pm |
This prompts for the CusTID on sub-report.
Because I have a parameter CustID on sub-report which I am linking now which gets it from main report's result.
thx
Raj
|
Cheers
Raj
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 09 Oct 2009 at 1:04pm |
Remove it from the sub-report and your select statment in the subreport.
The only reason to have it is if you need to limit the data scope with it.
although you likely did not group on customer in the subreport which you will likely wnat to do.
make the subreport run and look exactly like you want it to (as if it were its own report). Once you get that looking right that is what it will do in the main report to.
Edited by DBlank - 09 Oct 2009 at 1:06pm
|
IP Logged |
|
|