Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport help needed 1

Status
Not open for further replies.

rrtraverse

Programmer
Jul 2, 2002
26
US
I am running a report in v.8.5 where I pull a "Repaid Date" from a subreport into the Main report to use in a "Number of Days" formula. There is not a one to one relation between records in the sub and records in the main report, and everytime there is not a "Repaid Date" match to a recod in the main report, the main report uses the value of the last record with a repaid date. Why won't the report reflect a null record?
 
You need to reset the shared variable in the section where the subreport is located. Otherwise, if the subreport has no records, a formula placed in the subreport GH/GF/Detail section would never get executed and hence the shared variable value would never get reset.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Are you saying I need to move the shared variable in the subreport to a new spot in the subreport? Currently it is in the GH2 section - the Group by LoanID section of the Sub. I then have the subreport in GH2b of the Main report -the Group by LoanID section in the Main report. I also have a copy of the subreport in GH2a which is performing the function of supressing a blank subreport. The Details of the main report are printing on GH2c - Group by Loan ID.

If this makes sense to you, can you tell what I am doing wrong?

Thanks
 
ok, I remember a reset formula when I used running totals in Crystal Reports v.6.0, but I really don't remember a reset formula for this. Is there documentation regarding this?

Thanks so much for your help and your patience!
 
I have just had the same problem.

Use the following formula:-

whileprintingrecords;
shared numbervar {your field name}:=0;

Add this formula to GH#2 in your main report, although its placement made need a bit of testing. It will depend on when you need each reset. (on change of group or other)

Hope this helps
 
Maybe you can reset the shared variable in the RH of the subreport, so if there is no record in the sub, you can test it for this reset value in the main report

--------------------------------------------------
[highlight]Django[/highlight] [thumbsup]
bug exterminator
tips'n tricks addict
 
As soon as I put the reset formula into the main report my report worked and the world is a wonderful place. Thanks so much for your help.
You all are great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top