Results 1 to 4 of 4

Thread: [VB.Net 2005] Passing a Parameter to a Sub-Report

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2008
    Location
    Philippines
    Posts
    218

    [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.

  2. #2
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    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.

  3. #3
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    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

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2008
    Location
    Philippines
    Posts
    218

    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
  •  



Click Here to Expand Forum to Full Width