cancel
Showing results for 
Search instead for 
Did you mean: 

CR viewer not show anything when i click to display (Previous it's working fine.)

Former Member
0 Kudos

CR for VS  ver. 13.0.13.1597

Previous 3-4 months i upload my web app to server (My web app use crystal report)..

Everything it's working fine when i click to show report, throughout the past.

Now crystal report viewer don't show anything. But i don't have error

symptom

When i click button to show report web page has blink (postback) but don't show anything.

(normally, reports will show data on the web page after page has blink.)


Some say it is due maximum report processing jobs limit.

use this code


Protected Overrides Sub OnUnload(e As EventArgs) MyBase.OnUnload(e)

rpt.Close()

rpt.Dispose()

GC.Collect()

End Sub

when page postback i get this error from crystal report viewer

Can't solve the problem. What should I do with this issue?

Thank for advance.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Move your code to Page_Init, search and you would have found this

Former Member
0 Kudos

Hi. Don

previously i have 2 web are use crystal report. and use click event to show report.

Everything worked well during the past four months. i necessary to use the buttons.

I'm not sure what problem it caused. because previously it's working fine.

especially, i don't move code to page_init.

This is code, (previous working fine.)

Public Class Conclusion

    Inherits System.Web.UI.Page

    Protected Overrides Sub OnInitComplete(e As EventArgs)

        If Me.Session("ReportSource") IsNot Nothing Then

            crvReportAllDep.ReportSource = Me.Session("ReportSource")

           

        End If

        MyBase.OnInitComplete(e)

    End Sub

   

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then

            Me.Session("ReportSource") = Nothing

            'เคลียร์ session  

            crvReportAllDep.Visible = False           

        End If

    End Sub

    Protected Sub btnCallReport1_Click(sender As Object, e As EventArgs) Handles btnCallReport1.Click      

      

        Dim objConn As New SqlConnection

        Dim objCmd As New SqlCommand

        Dim dtAdapter As New SqlDataAdapter

        Dim ds As New DataSet

        Dim dt As DataTable

        Dim strConnString As String

        Dim strSQL As String = ""

        strConnString = "Server= WEBSERVER, 1434 ;UID=basz;PASSWORD=xxxx;database=xxxx;Max Pool Size=400;Connect Timeout=600;"

        If txtDateFrom1.Text <> "" Or txtDateTo1.Text <> "" Then

            strSQL = "SELECT * FROM vwReport WHERE Date BETWEEN '" & Me.txtDateFrom1.Text & "' AND '" & Me.txtDateTo1.Text & "'"

        Else

            strSQL = "SELECT * FROM vwReport"

        End If

        objConn.ConnectionString = strConnString

        With objCmd

            .Connection = objConn

            .CommandText = strSQL

            .CommandType = CommandType.Text

        End With

        dtAdapter.SelectCommand = objCmd

        dtAdapter.Fill(ds, "DataTableReport")

        dt = ds.Tables(0)

        dtAdapter = Nothing

        objConn.Close()

        objConn = Nothing

        Dim rpt As New ReportDocument()

        rpt.Load(Server.MapPath("rptShowAllDep.rpt"))

        rpt.SetDataSource(dt)

        Me.Session("ReportSource") = rpt 'Session Report

        Me.crvReportAllDep.ReportSource = rpt

        Me.crvReportAllDep.RefreshReport()

        crvReportAllDep.Visible = True      

    End Sub

0 Kudos

HI Bas,

We changed it, you must now move your code to the Page_Init section and the app should work again.

Don

Former Member
0 Kudos

Hi don

i'm try to uninstall and then reinstall CR for VS 13.0.15

Everything has worked fine again ...

I'm not sure that this is the real solution but CR work again.

0 Kudos

Interesting, appears something corrupted the install and runtime, repairing resolved what ever that was....

Don

Answers (0)