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

Record selection based on the selection on the Subreport

Status
Not open for further replies.

SuperTime

Programmer
Dec 21, 2004
183
US
Crystal 9
Sql server 200 ODBC connection

I have a table tblLinks with primary Key tblLinks.LinkID and other two fields tblLinks.ParentCustomerID and tblLinks.CustomerID.Both the Customer ID fields link to the table tblCustomers.CustomerID.
The main report shows the Parent Customer Information and there is a subreport that shows Customer Information related to the parent customer

Issue Is:

I have a selection criteria on the sub report that the JobStatus for the Customer to only show Jobs that are Completed.

I dont want to see the Parent Customer record related to it on the main report if the Subreport is blank..

Eg:

Parent Customer ABC: - > Linked to Customer XYZ has no Completed Job

Then the subreport data is not selected but I dont want to show the Customer ABC data on the main report..



Please Adivce
Thanks,,.,

 
You have a few options here.

One would be to make the subreport the main report.

Another would be to add the same tables (perhaps they are the exact same, you just need to add the same table in a second time?) into the main report and use the same record selection criteria there.

Another would be to not display anything in the main report until after the subreport executes.

-k
 
I can try to make the subrport the main report...but that will be time consuming and i will have to redo all the formatting and basically start from scratch..

I have tried the second option but as soon as I drop the JobStatusID on the main report...my running total on the main report is getting messed up...

Can you please tell me how can I make the main report to print only after the subreport and if the JobStatus on the subreport is not Completed then not show the main report record..

Thanks..
 
eond Option: Make the join a left outer from your current main report table to the join of the second copy of the same table.

Also, try to use technical terms rather than "messed up". That doesn't convey whether it is now lower, higher, or your monitor melted ;) People can't help you unless you explain your problem.

As for your last question, whatever you are displaying on the Main report, display it in a section AFTER the subreport.

Depending on twhat is in the subreport, you can even return those values using shared variables so that they can be used anywhere subsequent to the subreport firing.

Since I have no idea how the report is being displayed, I can't advise you with specifics.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top