on 07-22-2008 2:35 PM
I have a list of items in the details section of the main report which are numbered 1,2,3.......etc. The numbers in this list correspond to the item number defined in the database. I then have a list of items in a sub report which are displayed directly below the main list. I would like to continue the numbering, but these items do not have a previously defined item number.
eg,
Main report - details section:
Item No. (note these 4 item number are defined in the database)
1
2
3
4
Sub report - details section:
Item No. (I believe a rformula is required to define these numbers)
5
6
7
Any suggestions would be much appreciated. I am relatively new to Crystal Reports and know very little about generating formulae.
If the issue is carrying the number list from the main report to the subreport and the subreport is called after the detail report is completed, you could use a subreport link, with the last value of the main report item being passed to the subreport. Then you can use that value to initiate a variable that you then incriment for each subreport detail record.
Alternately you could maintain an independent shared variable that counts each main and subreport detail record.
Fuskie
Who hopes that makes sense...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe your first suggestion is exactly what I am aiming for, thankyou.
I have placed the sub report in the Report Footer of the main report. How do I know if this sub report is 'called after the detail report is completed'?
I have never used the formula functionality of Crystal Reports - is it relatively simpel to write the code required for your suggestion.
Thanks for the help, I really appreciate it.
Crystal Reports will process top down so the details section will process before the Report Footer with the subreport.
If you are linked on the database field that increments in the main report then it will pass the last value to the subreport.
You can then create a formula in the subreport similar to the following;
whileprintingrecords;
Numbervar x;
if onfirstrecord then
x:= x + 1 + {?parameter_field_generated_by_subreport_link}
else x:= x + 1
I get the following error....... any idea why?
This field name is not know.
Details: errorKind
Error in File SingleLevelBOM {DBDBDF£F-551C-A7F0-.........}.rpt:
Error in formula Counting;
'whileprintingrecords
'
This field name is not know.
Details errorKind
I have created the formula and named it "Counting". The formula checker says that there are no errors, but then when I try to actually create a report then the error above is displayed.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.