Hello everyone,
I need help creating an asp page to view a crystal report, which requires that that I change the database connection dynamically. I thought I had this problem licked in CR7 (the version of crystal the report has been designed in) but when I tried to deploy CR7 to my server I found that I could not install the ASP components on IIS 6.0 (even using the manual installation method). I had a CR9 dev edition update, which came with a copy of RAS. I installed CR9 and RAS and successfully deployed the report with a surprisingly small amount of code. The problem is that it prompts for all parameters and the database logon. I need to be able to change the name of the database that the report uses through my ASP (not ASP.net) web page, instead of allowing the report to connent to the database saved with the report. I would also like to be able to pass it the log on credentials and parameters. I've included the code I'm currently using below.
Thanks in advance
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252" %>
<% Option Explicit
Response.ExpiresAbsolute = Now() -1
Dim HTMLViewer
Dim ObjectFactory
Set ObjectFactory=CreateObject("Crystalreports.ObjectF actory.2")
Set HTMLViewer = ObjectFactory.CreateObject("CrystalReports.Crystal ReportViewer")
With HTMLViewer
.ReportSource = "C:\Program Files\Crystal Decisions\Report Application Server 9\Reports\ClaimReview\Invoice_SQL_Works.rpt"
.IsOwnPage = true
End With
On Error Resume Next
call HTMLViewer.ProcessHttpRequest (Request, Response)
if Err.number <> 0 then
Response.Write Err.Description
Err.Clear
end if
%>