on 2013 May 03 7:32 PM
I am using Visual Studio 2008 with Crystal Reports 2008 SP3 for a winforms project. The issue I have is that when I launch a report using the CrystalReportViewer control and the user clicks on the Refresh button on the viewer, a dialog pops up asking for parameters. I have flagged the CrystalReportViewer control to ReuseParameterValuesOnRefresh and EnableRefresh.
My users need to be able to refresh the report to see changes made in the underlying database.
The method used to launch the preview follow:
Public Sub PreviewReport(ByVal ReportPath As String, ByVal ORDERID As Integer)
Dim rptv As New frmPreview
Dim Report As New ReportDocument
Dim pv As New ParameterValues
Dim pdv As ParameterDiscreteValue
Try
pdv = New ParameterDiscreteValue
pdv.Value = ORDERID
pv.Add(pdv)
Report.Load(ReportPath)
Report.PrintOptions.PrinterName = ""
Report.SetParameterValue("ORDERID", pv)
rptv.Preview(Report)
Catch Ex As Exception
MsgBox("Error generating report. Error: " & Ex.Message, MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "Error")
End Try
End Sub
frmPreview is a simple Windows.Form with a CrystalReportViewer on it and not special handling. The Preview method of the form follows:
Private myReport As ReportDocument
Public Sub Preview(ByVal rpt As ReportDocument)
myReport = rpt
crv1.EnableRefresh = True
crv1.ReuseParameterValuesOnRefresh = True
Me.Show()
rpt.PrintOptions.PrinterName = ""
Me.crv1.ReportSource = rpt
crv1.Show()
End Sub
Request clarification before answering.
Hello Shane
1) Update to SP4:
http://scn.sap.com/docs/DOC-27917
2) See if removing crv1.EnableRefresh = True will help
- Ludek
Senior Support Engineer AGS Primary Support, Global Support Center Canada
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.