Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the Login and Parameter info using ASP

Status
Not open for further replies.

frycdf

IS-IT--Management
Aug 5, 2003
1
US
I am using the CrystalReport viewer object in ASP to show some reports. The reports show up fine except for the fact that I need to pass the parameters and the login info to the report rather than having the clunky Crystal interface pop-up requesting that info. Our users don't like to have to login each time when they run a report. I also have other pages that collect the parameter data for the report and don't want the Crystal to do the prompting.

So how do I pass that info to the report at runtime via ASP?

here is what I have so far:

-------------------------

Dim viewer
Set viewer = objectFactory.CreateObject("CrystalReports.CrystalReportViewer")
viewer.Name = "page"
viewer.IsOwnForm = true
viewer.IsOwnPage = true

Dim theReportName
theReportName = Request.Form("ReportName")
if theReportName = "" then theReportName = Request.QueryString("ReportName")
viewer.URI = "pageViewer.asp?ReportName=" + Server.URLEncode(theReportName)


viewer.ReportSource = theReportName
viewer.ProcessHttpRequest Request, Response, NUll
viewer.EnableLogonPrompt = false
viewer.DatabaseLogonInfos(0).UserName = "SYSADM"
viewer.DatabaseLogonInfos(0).Password = "SYSADM"
viewer.ParameterFields(0) = "AIKEN"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top