on 10-26-2015 8:33 AM
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.
Move your code to Page_Init, search and you would have found this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.