on 01-09-2012 3:25 PM
I am using Crystal Reports for Visual Studio 2010.
I want to prompt for some input from my .aspx page and allow the user to click a botton to run the report.
The following code works from the Page_Load subroutine but when I try to run the code from the click event of the button. I answer my Crystal parameter prompt and the report page displays the message:
"No valid report source is available."
Here is the visual basic code:
Protected Sub PreviewLabels_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PreviewLabels.Click
If (Session("report") Is Nothing) Then
Dim rd As New ReportDocument
rd.Load(Server.MapPath("ExpirationNoticesMailingLabels.rpt"))
Dim boConnectionInfo As CrystalDecisions.Shared.IConnectionInfo
For Each boConnectionInfo In rd.DataSourceConnections
boConnectionInfo.SetLogon("Username", "Password")
Next
Session.Add("report", rd)
End If
CrystalReportViewer1.ReportSource = Session("report")
End Sub
Hi Mark,
Looks like the application is not able to access the rpt file.
things you could try
- Apply [CR for VS 2010 SP2.|http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_2.exe]
- Check if the path of the report is correct.-
- Check if the application is able to access the report file, check the permissions for the app.
- Try removing the sessions, and see if the app can access the report.
Hope this helps,
Bhushan.
Edited by: Bhushan Hyalij on Jan 9, 2012 5:51 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.