Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

crystal report viewer ask to enter parameters when clicking print

$
0
0

I have crystal report viewer on my page and has parameter field that gets data when user clicks Select command in gridview. I get data loaded up in the CR when select is clicked but when I hit print it ask print to PDF and then I click Export now it prompts me again to enter the Parameter value. which I don't want. Can some one help me out?

I place the code in GridView's selected index change event.

 Protected Sub GridView5_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridView5.SelectedIndexChanged
        Label1.Text = GridView5.SelectedRow.Cells(1).Text   'just for testing 

        ' Loads data in Crystal Report to print 6x4 Labels
        
        If Me.Label1.Text.Trim.Length > 0 Then
            Me.CrystalReportViewer1.ReportSource = Server.MapPath("~/label4x6.rpt")

            Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo
            Dim wo_order As New ParameterField
            wo_order.Name = "wo"

            Dim wo_order_Value As New ParameterDiscreteValue
            wo_order_Value.Value = GridView5.SelectedRow.Cells(1).Text 
            wo_order.CurrentValues.Add(wo_order_Value)
            ParamFields.Add(wo_order)


        End If

    End Sub


 


Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>