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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Sub-Report Value to Main, but for display above the sub-report?

Status
Not open for further replies.

PJA

Technical User
Jul 9, 2003
63
CA

I am using CR V8.5 Pro, connected to an SQL 2000 server using the ODBC components in Windows XP.

I have a Customer Credit report that states the final due date of payment in the top section of the main report. There is a sub-report in the Details section of the Main report that displays the separate invoices and displays a total owed. The sub-report is passed the customer ID and the cut-off date from the main report. As part of the sub-report, there is a formula calculating the date of the last customer invoice before the cut-off date.

How do pass that last invoice date back up to the Main report AND have it displayed at the top of the main report?

The problem happens when a customer has not purchased anything for about 2 months, but asks for a statement. You supply the customer account number and today's date...the sub-report shows the last invoice to be 30th May 2003, but the Payment Due date in the main report is August 20th; when it should be June 20th. If I could pass the last date of a customer's invoice backup to the main report, I could display the 20th day of the month following that last invoice.

I have been experimenting with Shared variables with no luck. It works fine if the date is displayed on the main report after the sub-report. I would really like to avoid changing the Customer Credit report layout...but maybe it's the only way.

I need a "Don't Process This Formula Until Everything Else In This Report Has Finished" function.

Advice welcome...

Paul :)
 
It sounds like you understand it correctly, you need to execute the subreport prior to displaying the shared variable value.

What I don't understand is what you expect to see at the top of the main report, is it a summary of all of the shared variables passed from the sub?

If so, and the cut-off date is the same for all customers, create another subreport in a seperate Report Header section and execute it for all customers.

Otherwise you'll probably have to redesign the report.

-k
 

Thanks K,

99% of the time it's fine. You give the report the customer ID and the date, (by default, today's date). The report, (and sub-report), displays the customers invoices up to today's date. The "Payment Due" date at the top of the main report is calculated by simply adding 1 to the month and displaying the 20th.

For example: Today's date is 07/10/03. The Payment Due at the top of the main report would say 08/20/03, (20th day of the following month).

The problem is that every now and again, there is a customer who hasn't purchased anything for two months or paid any of the bills. They ask for another credit statement. The sub-report shows the last invoice date as 30th April, but the payment due date shows 20th August 2003. The credit statement gets sent out without double checking and the customer thinks they have ANOTHER month to pay up; when in fact they have owed us money for quite a while.

I think I shall re-write the report to search the database for the last invoice date for that customer before the supplied date and use that in the Main report, and then pass it down to the sub-report.

I wanted to post here to see if there was something I hadn't tried.

Paul
 
There is a technique that allows you to display a value from the subreport above the subreport - but I am not sure it will help you. Split your subreport section into A and B and make A twice as big as B. Put the subreport in the bottom half of A and the captured value in B. Then underlay section A. The B section will occur after the subreport (so that it can get the variable), but will print immediately above it.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top