cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CrystalReportViewer Refresh

Former Member
0 Likes
238

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

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

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Likes

Thank you Ludek:

Updated to SP4 and removed the EnableRefresh = True as suggested.  No joy.  Problem still persists with report asking for the report parameters.

Former Member
0 Likes

I just downloaded CR2008 SP6 and it looks like this is still a problem. Any update on this issue?

Answers (0)