|
-
Nov 3rd, 2008, 09:26 PM
#1
Thread Starter
Addicted Member
[VB.Net 2005] Passing a Parameter to a Sub-Report
Hi guys,
I'm having trouble on my project right now. I've been searching threads for passing a parameter to a sub-report.
In my main report, I have only 1 sub-report and I need to pass the value to it. How will I do this? I'm using VB.net 2005 Crystal Report. I use stored procedure in CR and the parameter I want to pass is @CutOff. I use SQL Server 2000.
Thank you very much.
Last edited by rpc86; Nov 4th, 2008 at 12:22 AM.
-
Nov 4th, 2008, 08:35 PM
#2
Hyperactive Member
Re: [VB.Net 2005] Passing a Parameter to a Sub-Report
I usually use the subreport links to push a parameter on the main report to the subreport. However, you then mention @CutOff which sounds more like a formula. So when you set up a variable in the @CutOff formula, set it as Shared. Then you can use it in a formula in the subreport by declaring it as Shared again.
The formula must be declared and set in a section above the subreport's section.
-
Nov 6th, 2008, 02:26 AM
#3
Addicted Member
Re: [VB.Net 2005] Passing a Parameter to a Sub-Report
I hope that ur sub report is connected to the main report.
now you need to pass that parameter with the main report object , like i mean to say that pass it like that u have a parameter in the main report.
so it work fine. let me know if you have not understand what i am saying. if there is a parameter in sub report and if sub report is connected then it act like a parameter in main report.
Thanks and Regards,
Muhammad Abbas
-
Nov 6th, 2008, 07:35 PM
#4
Thread Starter
Addicted Member
Re: [VB.Net 2005] Passing a Parameter to a Sub-Report
thanks for the input. i have already solved my problem.
Code:
crPaySlip.SetParameterValue("@CutOff",dCutOff,"subReport1")
Wherein @CutOff is a parameter from a stored procedure. I use stored procedure as my datasource in CR.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|