Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreports Post Reply Post New Topic
Author Message
paul_birm
Newbie
Newbie
Avatar

Joined: 10 Jul 2008
Online Status: Offline
Posts: 25
Quote paul_birm Replybullet Topic: Subreports
     Posted: 03 Oct 2010 at 11:49pm
Hi.  I am trying to add a sub-report to an existing report.
 
my MAIN report uses an odbc link to connect to my erp system but my subreport is trying to pull data from an access database, using a desptach no which is on both the erp system and the access data table.
 
the problem is that when i run the report i get all my data for a specific despatch no on my print but then when the subreport kicks in and should report back one line of "serial no " data from the corresponding data on the access dbase, it pulls up and lists EVERY Serial no on the database, so instead of page 1 equalling a 1 page print, it now equals 1722 page print !!!!
Ouch
any ideas please.
Paul
Birmingham
England
{A friend in need is a pain in the a***}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2010 at 4:00am
are you linking the subreport?
are you passing any paramters to the subreport?
IP IP Logged
paul_birm
Newbie
Newbie
Avatar

Joined: 10 Jul 2008
Online Status: Offline
Posts: 25
Quote paul_birm Replybullet Posted: 04 Oct 2010 at 4:03am
ok, had a read of my "official Guide to crystal reports" book and found how to link the sub-report
 
have now linked the subreport, but when i run the report i get a blank block where the subreport data SHOULD be
 
Cry
Paul
Birmingham
England
{A friend in need is a pain in the a***}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2010 at 4:09am
How did you link?
what secion in the main report are you running the sub-report?
 
IP IP Logged
paul_birm
Newbie
Newbie
Avatar

Joined: 10 Jul 2008
Online Status: Offline
Posts: 25
Quote paul_birm Replybullet Posted: 04 Oct 2010 at 4:15am
hi.
 
i) linked by right clicking within main report and using the LINK tab, chose the correct field from the "available fields" and added to the fileds to link to box with the ' > ' button
 
ii) the sub report is in the "Details b" section of the report
 
hope that helps
 
thanks
Paul
Paul
Birmingham
England
{A friend in need is a pain in the a***}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2010 at 4:28am
Open the subreport and look at the select expert statement.
you shold see something like:
table.field = ?pm-table.field
the blue section is the field you want to filter on in the sub-report and the red section is the value from the main reprot that was passed in via your linking.
Does the statement in the subreport makes sense as far as both parts being accurate?
 
as an aside, I don't like to put subreports in the detail section as they run for every row but
IP IP Logged
paul_birm
Newbie
Newbie
Avatar

Joined: 10 Jul 2008
Online Status: Offline
Posts: 25
Quote paul_birm Replybullet Posted: 04 Oct 2010 at 11:42pm
hi db.
 
have checked the select expert statement and it looks ok
table.field equal to ?pm-table.field
{tbl_serialNumbers.delvno} equal to ?pm_delv.delvno
ie the delvno on the Access SerialNumbers table must equate to the SQL table delv with the same delvno
 
thanks
 
Paul
Birmingham
England
{A friend in need is a pain in the a***}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Oct 2010 at 4:12am
as a test, add your Access table to the main report and join using the same link to see what you get.
make sure to drop a field fromt he access table into the report to 'enforce' the join.
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