Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Passing parameter from main report to subreport Post Reply Post New Topic
Author Message
Yudi
Newbie
Newbie


Joined: 03 Aug 2009
Online Status: Offline
Posts: 13
Quote Yudi Replybullet Topic: Passing parameter from main report to subreport
     Posted: 03 Aug 2009 at 2:42am
Hi All, please help me...

I'm using CR XI, Mysql 5.0 w/ mysql odbc connector v5.1

i have created two subreports which are placed in the detail section of main report.

Both of subreports take data from Mysql stored procedure which use 1 parameter, that is 'CustCode'.

Now, how to pass the value of 'custcode' field in detail section of main report to the subreport parameter ?

until this time, my effort still fail

Thanks b4
IP IP Logged
Allany
Newbie
Newbie


Joined: 03 Aug 2009
Online Status: Offline
Posts: 12
Quote Allany Replybullet Posted: 03 Aug 2009 at 3:03am
Hi Yudi,
 
I think in your main report you need to create a parameter called CustCode which is the same datatype as the one in your stored proc.
 
Then just right click the subreport from the design page and choose "change sub report links.."
 
Then choose CustCode from the left pane, and move to the right, and then choose from the drop down your parameter from the sub report.
 
 
IP IP Logged
Yudi
Newbie
Newbie


Joined: 03 Aug 2009
Online Status: Offline
Posts: 13
Quote Yudi Replybullet Posted: 03 Aug 2009 at 4:05am
Thanks for ur reply Allany

before i post this matter, i have tried the way as you suggest.

I link 'custcode' field in detail section of main report to 'custcode' parameter field in both subreports. but, this way still result in error

mysql odbc connector said that :

" unknown field list 'IFBT1' in where clause..."

'IFBT1' is the value of 'custcode' field in detail section. Provided this way was successfull, the subreport should display the payment summary of each customer.

I have tested the mysql stored procedure w/ some inputs, and they can result the correct value.

I also have tested the same way w/ MS. Access, and this also results in error. but the error provided by Access is "..Data type mismatch.."

actually i already able to show the report, but the time is too long. i just want to get the better performance with other technique of passing parameter


Edited by Yudi - 05 Aug 2009 at 7:06pm
IP IP Logged
Allany
Newbie
Newbie


Joined: 03 Aug 2009
Online Status: Offline
Posts: 12
Quote Allany Replybullet Posted: 04 Aug 2009 at 8:36am
strange.  It sounds like a datatype problem as your error messages have suggested.  I dunno if I have any other ideas.  what is your data type?  strings?
IP IP Logged
brainsoup
Newbie
Newbie
Avatar

Joined: 30 Jul 2009
Location: India
Online Status: Offline
Posts: 17
Quote brainsoup Replybullet Posted: 05 Aug 2009 at 5:51am
Are you storing your query in a variable and then executing it using EXECUTE method? In that case this could be because of the quotes mismatch
IP IP Logged
Yudi
Newbie
Newbie


Joined: 03 Aug 2009
Online Status: Offline
Posts: 13
Quote Yudi Replybullet Posted: 05 Aug 2009 at 6:55pm
Thanks to all members who had replied my question and i'm sorry if i'm too late for giving the response.
 
during the last 2 days, i also post this matter @ asp.net forum. Actually my report has worked, i just want to get the better peformance because it took time too long to display the report.
 
And someone at that forum had proposed me to not use subreport at detail section of main report, and proposed me to use grouping instead of using subreport.
 
Actually, what i'm doing now is converting report from access 97 to CRXI. I use the same technique like Access did. it is work for me, but the performance is too slow if compared with the report in access (almost 4x slower)
 
you can see my current report design (using subreport) @ http://yudi-purwanto.blogspot.com/
 
 
Thanks.
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