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

To subreport or not?

Status
Not open for further replies.

mdjoin

Programmer
Jun 22, 2007
9
US
Hey all,

New to Crystal Reports, currently using XI - I'm having an issue with a sub-query...I am making an invoice report and as its listing every item it is supposed to be checking a different table for allowances or discounts, then if there is a discount it should print it below the item.

Would it be best if I do this in a sub-report, since adding the allowance item causes the query to return null due to there being multiple records returning every time?

Example:

Item Description
1234 Flatscreen TV
1236 LCD Monitor
*If allownaces put them here
1237 Toaster Oven

Any ideas on how I might best approach this for speed and aesthetic appeal?

Thanks,
 
I don't know what you mean "adding the allowance item causes the query to return null". You should be able to use a left join from your main table to the one containing the allowances/discounts, linking it on the item field, and then insert a group on your main table item and place the allowance/discount data in the detail section. In the section expert, highlight detail->check "suppress blank section".

-LB
 
You're right, I solved this issue by using a left outer join...for some reason I thought I would have multiple allowances for each item, which would not work with a left outer join, but there should only be one allowance per item.


Thanks for the reply.
 
Well, you could have multiple allowances per item, but a left join would still work in that case.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top