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

Sub-report help CR. Ver. 8.0

Status
Not open for further replies.

biobrian

Technical User
Oct 18, 2004
21
US
I have two reports.

1.Shows open orders, with a Date Range parameter selection, sorted by Sales Order Number.

2.Shows the Misc. comments put on sales orders(i.e. releases, shipping instructions) Sorted by sales order.

Both reports work fine when run separately. What I am trying to do is put Report 2 into Report 1 as a sub-report, linking it by the sales order number.

Two things happen, (1) the sub-report does not run after the main report is finished. If I click on the next page of the preview of the report the sub-report then runs, and (2) the sub-report is empty.


Any help would be appreciated.
 
What is the structure of your main report and where are you placing the subreport? I would probably group on sales order number in the main report and then place the subreport (linked on sales order number) in the group header or footer. While in the subreport, suppress all sections except the detail section.

-LB
 
I have no groupings in the main report. It is sorted by due date not by sales order number as I stated before. The sales order number is repeated if there are more than one line items on the sales orders, however each line item can have a different due date, which is why I did not group by sales order number. I have the sub-report in the report footer.

This report is going to be used out on a production floor, and I wanted to use the subreport at the end of the main report as a reference for special instructions, by sales order number.
 
If you want to use it in the report footer, remove the link on sales order number. Use the same selection criteria in the subreport as in the main report, including adding the date parameter to the record selection formula. Then go to edit->subreport links and select the main report date parameter and move it to the right. Then in the bottom left corner, instead of choosing {?pm-date}, use the drop down box to select {?date}.

-LB
 
Thanks for your help so far.

I tried your idea, and the subreport was still empty, and it also did not run by itself, I needed to page over on the preview.

There is a problem in using the same selection criteria for each report. The date I am using is attached to each line item(part number) on the sales order. The comments/special instructions I am trying to get in the sub-report has no date attached to it. I am also selecting a certain product line in the main report, that again is attached to each line item(part number) but not the comments/special instructions. If I just link the sales order in the
Edit->Subreport Links window, and leave the "Select data in subreport based on field" box unchecked I get all the comments/special instructions on the subreport.

Its all or nothing :)
 
Please explain whether the comments are coming from the same table as the sales orders. If they are from a separate table, please identify the fields in the comments table.

-LB
 
Yes the comments are coming from the same table as the sales orders.

The sub-report is basically a list of all comments on the sales orders, sorted by sales order number. If the sales order number in not shown in the main report I dont want to see it in the sub-report. I have tried using the suppress feature a few differnet ways, but no luck.
 
If the comments are coming from the same table, then you can limit the records in the subreport to those in the main report. Just copy the selection formula in the main report (report->edit selection formula->record) and paste it into the subreport (report->edit selection formula->record). Then set up the date parameter as I suggested earlier. This way you will only get the subreport records that apply to records in the main report. I would also add the following at the beginning of the subreport selection formula:

not isnull({table.comments}) and//rest of formula

You must NOT link the subreport by sales order if you are placing it in the report footer, since this will limit the subreport only to the last record shown in the main report.

In terms of order, a subreport in the report footer executes after the main report, but still should be refreshed each time you run the report.

-LB
 
Success at last, thanks for your help.

One other thing that has popped up, now that I can see the sub-report information. The page header for the main report continues on the sub-report pages. Any quick fix for this??

thanks again.

-bh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top