Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: datasets and subreport linking Post Reply Post New Topic
Page  of 2 Next >>
Author Message
danm
Newbie
Newbie
Avatar

Joined: 04 Jun 2009
Location: United States
Online Status: Offline
Posts: 8
Quote danm Replybullet Topic: datasets and subreport linking
     Posted: 04 Jun 2009 at 2:46pm
I have a sales report that uses 2 datasets that bind to a main report and a sub report.  The link field is named trans_order for the main and transdetail_order for the sub report. The report is displaying the main report data but not the subreport data.
 
I have tried all kinds of combinations using the "Change subreports links" to show the sub report data but with no luck. 
 
What am I doing wrong.  Any help would be greatly appreciated.
Dan
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 05 Jun 2009 at 2:43am

Hi

What I would suggest is running the Main Report and Subreport separately and see if
 
trans_order  in Main report and transdetail_order in Sub Report retrun the same kind and value of Data
 
also check for record selection formulas in subreport, or any suppression formulas in sub-reports.
 
 
Cheers
Rahul
IP IP Logged
danm
Newbie
Newbie
Avatar

Joined: 04 Jun 2009
Location: United States
Online Status: Offline
Posts: 8
Quote danm Replybullet Posted: 05 Jun 2009 at 8:13am
Rahul,
I ran the sub report seperately and it returns the same type of data and values and the main report. 
 
I forgot to mention that i copied the crystal report and all the code from .net 2003 to .net 2005.  So I am pretty comfortable that the report design and code is working correctly.  I just can't get the subreport to display the data.
 
I believe the problem is in the linking of the two reports.  I just can't figure out how to link the two orders numbers together.
 
Any help is greatly appreciated.
Dan
 
dan m
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 05 Jun 2009 at 11:01am
Hi
 
Right click subreport then select change subreport links,select the field from Main Report to link and move to fields to link once you do that ,a parameter will be created with {?PRM-FILEDNAME},Select data in subreport based on field select the matching field which has some data as main report field.
 
 
trans_order  in Main report move to Field(s) to link to: 
 
Select data in subreport based on field :
transdetail_order
 
cheers
Rahul


Edited by rahulwalawalkar - 05 Jun 2009 at 11:03am
IP IP Logged
danm
Newbie
Newbie
Avatar

Joined: 04 Jun 2009
Location: United States
Online Status: Offline
Posts: 8
Quote danm Replybullet Posted: 05 Jun 2009 at 1:41pm
Rahul,
 
Still no luck.
 
Here is what I am doing:
 
In the "Container Report fields to link to" I am using the "ADO.NET" dataset, field name of trans_ordernumber.  That action puts
 "?PM-ShipAdviceDetailed.trans_ordernumber" in the combo box in the Subreport parameter field to use.  I chose this field.
 
I check box in the "Select data in subreport based on field" and use the
Database fields section and click on the transdetail_orderId field.
 
I run the report and no detail displays.  I believe I am so close in getting this to work but am just missing some fine detail.
 
Again any help would be greatly appreciated.
 
cheers
Dan
dan m
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Jun 2009 at 2:13pm

You indicated you have tried a lot of linking options here. Just a thought but...

Open your sub report and look / double check the parameter fields and the entire select statement. I have found that sometimes legacy fields from my original link remained in the sub report after I had changed them to a "correct field" link .
This corrected my "link" but my select statment was all screwed up with numerous connections in the statement.


Edited by DBlank - 05 Jun 2009 at 2:15pm
IP IP Logged
danm
Newbie
Newbie
Avatar

Joined: 04 Jun 2009
Location: United States
Online Status: Offline
Posts: 8
Quote danm Replybullet Posted: 06 Jun 2009 at 6:56am
DBlank,
 
There is no Select statement in the subreport.  I am using 2 datasets objects as my data input.  One table is the order header information and the other are the order details.  The linked field is the order number. 
 
I wonder if I should put the header order number into both tables?
 
Dan
dan m
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jun 2009 at 7:00am

Since the reports are linked there should be both a paremeter field and a select statement that was created in the sub report via the link process. Something like "{ShipAdviceDetailed.trans_ordernumber}= {?PM-ShipAdviceDetailed.trans_ordernumber}"

IP IP Logged
danm
Newbie
Newbie
Avatar

Joined: 04 Jun 2009
Location: United States
Online Status: Offline
Posts: 8
Quote danm Replybullet Posted: 08 Jun 2009 at 7:09am
DBlank,
Where should I see this select statement and pararmeter fields?
Dan M
dan m
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Jun 2009 at 7:25am

In the main report right click on the sub report and select Edit subreport. This should open a new window with the sub report. Now in the sub report design mode you should see Field explorer. Look in the Parameter fields here to see if you have a parameter (or more than one if you kept changing the link to the main report). Now click on the select expert (the button with the hand grabbing the red ball). THis should have the statement linking your main report (the ?pm paramter field) to the sub report (= table.order#).

 
Unless I missed something earlier your post describing your linking process...
In the "Container Report fields to link to" I am using the "ADO.NET" dataset, field name of trans_ordernumber.  That action puts
 "?PM-ShipAdviceDetailed.trans_ordernumber" in the combo box in the Subreport parameter field to use.  I chose this field.
 
I check box in the "Select data in subreport based on field" and use the
Database fields section and click on the transdetail_orderId field.
 
should have done this process.


Edited by DBlank - 08 Jun 2009 at 7:27am
IP IP Logged
Page  of 2 Next >>
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