on 11-01-2012 2:43 PM
Hi,
I am using VS2010 and Crystal Report 2011 Version=13.0.2000.0 in the web application.
When the first time report is loaded the next button on toolbar works fine but after printing a report, next button shows message "Please wait while the document being processed".
I have tested it both on my local machine and on the web server, and i am getting the same results.
I am saving a report in session.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Session("Rep") = Nothing
Else
'--Has report previously been loaded if Yes then use a session report.
If hdHasViewed.Value = "YES" Then
If Not Session("Rep") Is Nothing Then
ShowResults()
End If
End If
End If
End Sub
Private
Sub ShowResults(Optional ByRef ds As DataSet = Nothing)
If Session("Rep") Is Nothing Then
Dim dsTem As DataSet
Dim r() As DataRow
myRpt = New ReportDocument
If Not ds Is Nothing Then
dsTem = ds
r = dsTem.Tables(0).Select("EMPCODE IS NOT NULL")
If r.Length <= 0 Then
CreateErrorString("No data returned")
placeResults.Visible = False
Exit Sub
Else
placeResults.Visible = True
End If
Else
CreateErrorString("Dataset is set to Nothing")
Exit Sub
End If
myRpt.Load(Server.MapPath("Reports/crEuProject.rpt"))
myRpt.SetDataSource(ds.Tables(0))
Session("Rep") = myRpt
End If
With crViewer
.ReportSource = Session("Rep") 'myRpt
.DataBind()
End With
End Sub
Hi Umar,
What Service pack you are using?
Could you test the app with CR for VS 2010 SP3?
http://scn.sap.com/docs/DOC-7824
- Bhushan
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Getting started and moving ahead with Crystal Reports .NET applications.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhushan,
I don't know which service pack i am using but the CR version in .Net framework 4.0 is as follow:
Version: 13.0.2000.0
Runtime: v2.0.50727 (is it service pack 2?)
Do i need to install service pack 3 or 4? Because 4 is also available.
Also, do you think it is something to do with my code? not with a service pack? Because if i create a simple crystal report website and without any code then it works fine.
CR:CrystalReportViewer ID="crViewer" Runat="server" AutoDataBind="True"
Height="947px" Width="845px" ReportSourceID="CrystalReportSource1" />
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="Reports/crEuProject.rpt">
</Report>
</CR:CrystalReportSource>
Bhushan Hyalij wrote:
Use SP3, SP4 has issues with web viewer.
Try not to bind the report to viewer <Report FileName="Reports/crEuProject.rpt"> as you are loding the report in reportdocument at runtime.
- Bhushan
Sorry i didn't get the second bit about binding. Binding at design time works fine for next button functionallity but at problem occurs at runtime binding.
Anyway, do you think my code in the main question is fine?
Umar,
Try the datasets sample app with your reports.
http://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal+Reports+for+.NET+SDK+Samples
Also, make sure that the dataset is getting populated properly every time.
Try
myRpt.SetDataSource(ds)
instead of
myRpt.SetDataSource(ds.Tables(0))
- Bhushan
There is a number of things that can go wrong with reports in a sessions. My recommendation would be to enter the following string in the search box at the top right corner of this web page:
'Session crystal net'
and go over the KBs that come up. Also, see the following blogs:
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/24380
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/25798
- Ludek
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Hi Ludek,
I am glad to inform that this issue is now fixed. I had to go through in very detail testing .
Cause: I was using crystalReport view's error event in code behind page and after removing that event it is working fine. I had to completed remove the error event otherwise it won't work even if comment my code inside the event.
NOTE: e returing message "Unable to evaluate expression." i don't know why. This event is called when i click on the print button of toolbar.
Protected Sub crViewer_Error(ByVal source As Object, ByVal e As CrystalDecisions.Web.ErrorEventArgs) Handles
crViewer.Error
CreateErrorString(e.ErrorMessage)
ShowErrorMessage(ErrMsg)
crViewer.Visible = False
End Sub
Thanks to everyone who responded to my question.
Would like to know more about the root cause of error "Unable to evaluate expression."
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.