Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Multiple values in subreport? How to put SQL logi Post Reply Post New Topic
Author Message
sa-user
Groupie
Groupie


Joined: 29 Jun 2011
Online Status: Offline
Posts: 65
Quote sa-user Replybullet Topic: Multiple values in subreport? How to put SQL logi
     Posted: 22 Jul 2011 at 1:11pm
Hi
I am passing a id from main report to sub report. Based on this id i display a field in the sub report. The field can have multiple values.
The issue i am having is in the sub report only 1 value is displayed.

I might be missing some link

Below is what i am trying to achieve , name can return multiple values and i am passing the id.

select name from ism.active_ingredient where id in
(select active_ingredient_id from ism.prod_acting where product_id in
(select child_member_product_id from ism.product_tree where parent_member_product_id='8816846'))

I have the tables and links as per the above sql and below is what i have done.
{PRODUCT_TREE.PARENT_MEMBER_PRODUCT_ID} = {?Pm-@product_id}

Thanks in advance
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Jul 2011 at 4:06am
What type of section have you placed your field in inside the subreport?  From the scenario that you've layed out, it needs to be in the Details section.
 
-Dell
IP IP Logged
sa-user
Groupie
Groupie


Joined: 29 Jun 2011
Online Status: Offline
Posts: 65
Quote sa-user Replybullet Posted: 25 Jul 2011 at 2:19am
Yes in the detail section.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Jul 2011 at 8:08am
Go to Show SQL Query in the subreport.  Copy the SQL and run it in a query tool that works witwh your database, such as Toad, SQL Manager, SQL Plus, etc.  See what get's returned.
 
If you've put the field you're trying to display in the details section of the subreport, it should show multiple values if that's what's being returned by the query.  The only reason I can think of why it wouldn't be is that "Can Grow" is turned off for the subreport.  In the main report, right-click on the subreport, select "Format Subreport", go to the Common tab and make sure that "Can Grow" is checked.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum