Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Problem refreshing report after printing.

$
0
0

Hello,

     I have a simple aspx page that has inputs for start date, end date and userName.  A "go" button sets report parameters and crystalReportsViewer1.reportsource.  This works great when changing parameters and pressing go.  However, after printing a report, changing parameters and pressing go does nothing until the crystalReportViewer is clicked on.  Even after that the report does not load correctly.  I have tried refreshReport() on the viewer, but it just asks me for the parameters again.

 

My environment

.NET 4.5

CR for .NET v13.0.5.891

 

Here is go button onclick event:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim cryRpt As New ReportDocument

        Dim crtableLogoninfos As New TableLogOnInfos

        Dim crtableLogoninfo As New TableLogOnInfo

        Dim crConnectionInfo As New ConnectionInfo

        Dim CrTables As Tables

        Dim CrTable As Table

 

 

        Session("Report") = cryRpt

 

 

        cryRpt.Load("C:\Users\jcassel\Documents\Visual Studio 2012\WebSites\CrystalReportsWebSite4\totalsReport.rpt")

 

 

        With crConnectionInfo

            .ServerName = "sbs"

            .DatabaseName = "a3"

            .UserID = "a1_Usr"

            .Password = "Escher1"

        End With

 

 

        CrTables = cryRpt.Database.Tables

        For Each CrTable In CrTables

            crtableLogoninfo = CrTable.LogOnInfo

            crtableLogoninfo.ConnectionInfo = crConnectionInfo

            CrTable.ApplyLogOnInfo(crtableLogoninfo)

        Next

 

 

        ' set parameters

        cryRpt.SetParameterValue("userName", userName.SelectedValue)

        cryRpt.SetParameterValue("startDate", startDate.Value)

        Dim endDateVal As Date = CDate(endDate.Value)

        endDateVal = endDateVal.AddDays(1)

        endDateVal = endDateVal.AddMilliseconds(-1)

        cryRpt.SetParameterValue("endDate", endDateVal)

 

 

        CrystalReportViewer1.ReportSource = cryRpt

 

 

        If reportReadOnly.Value = "n" Then

            CrystalReportViewer1.HasExportButton = True

            CrystalReportViewer1.HasPrintButton = True

        End If

    End Sub


Viewing all articles
Browse latest Browse all 3636

Trending Articles



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