AaronNance
asked on
How do I pass database credentials to a Crystal Report in an ASP.NET webpage?
How can I pass database login information (username and password) to a crystal report, so that the user is NOT prompted for it?
Here is what I'm using...
Dim strReportName As String = CStr(Request.QueryString(" Report"))
If strReportName = "" Then
'There was a problem. Report Unknown
Else
Dim rptReport As New CrystalDecisions.Web.Repor t
rptReport.FileName = "../Reports/" & strReportName
CRViewer.Report = rptReport
End If
When the User tries to view the report they are getting prompted for the ODBC password. I very much need to make this transparent to my Users. Please help.
Here is what I'm using...
Dim strReportName As String = CStr(Request.QueryString("
If strReportName = "" Then
'There was a problem. Report Unknown
Else
Dim rptReport As New CrystalDecisions.Web.Repor
rptReport.FileName = "../Reports/" & strReportName
CRViewer.Report = rptReport
End If
When the User tries to view the report they are getting prompted for the ODBC password. I very much need to make this transparent to my Users. Please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree the document is long. However tere aren't many examples out there yet for the 2005 version of Crystal.
mlmcc
mlmcc
ASKER
For those that don't want to weed through a helpful but rediculously long pdf...
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalRe
Partial Class _1024_CRViewer
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim strReportName As String = CStr(Request.QueryString("
If strReportName = "" Then
'There was a problem. No Report Name.
'Need to handle this error.
Else
Dim rptReport As New CrystalDecisions.CrystalRe
Dim strReportPath As String = Server.MapPath("../Reports
ReportViewer.ReportSource = strReportPath
ReportViewer.LogOnInfo(0).
ReportViewer.LogOnInfo(0).
ReportViewer.LogOnInfo(0).
ReportViewer.LogOnInfo(0).
End If
End Sub
End Class