SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy how can I pass parameter to crystal report in vb.net

    I want to pass value of the textbox to crystal report how can I do that. can somebody write me code. thanks.

  2. #2
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code below should work for you. I got it from the following link:

    http://www.dotnetspider.com/resource...stal-repo.aspx

    There's also instructions on how to add the parameter field to your crystal report at that link.

    Code:
    Dim param1Fields As New ParameterFields
                Dim param1Field As New ParameterField
                Dim param1Range As New ParameterDiscreteValue
    
                param1Field.ParameterFieldName = "sessiontype"
                param1Range.Value = txtSessionType.Text
                param1Field.CurrentValues.Add(param1Range)
                param1Fields.Add(param1Field)
                CrystalReportViewer1.ParameterFieldInfo = param1Fields
    
    
                CrystalReportViewer1.ReportSource = "CrystalReport.rpt" 
                CrystalReportViewer1.Visible = True


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •