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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP and Linked Subreports

Status
Not open for further replies.

Jill50

Programmer
Apr 11, 2001
21
US
I have searched Tek-Tips and Crystal Decisions knowledge base for information on how to pass logon parameters in ASP to linked subreports. I found some code examples in FORUM: Crystal Decisions: Crystal Reports 4 Other topics SUBJECT: Running reports from the web; however, it is not working for us. I also downloaded the asp examples from Crystal Decisions which included a Subreport example .asp and .rpt, but the subreports are not linked to the main report, so it did not help much either. Can someone please tell me how to pass not only the logon information for the subreport, but also the field it is linked to on the main report?
Thanks in advance for any help!
 
I am having the same problem, did exactly what you did, and still no luck. I have searched throughout the Crystal Decisions support and knowledge base to no avail.

Guess you could say I have "Nahta' Klu".
 
hi here this might hekp you
In Crystal Reports version 8 and 8.5 ASP applications main report parameters must be set on the main report and subreport parameters must be set on the subreport. Below is some example code for passing values to a main report and subreport.
-----------------------------------------------------------

In this example the report is seen as having 4 main report parameters and 2 subreport parameters.

Note: Subreport-linking parameters do not need to be set with version 8 and 8.5.

set ReportDatabase = Session("oRpt").Database

'Set the Table object and logon (1 table only)
set crdatabasetables = ReportDatabase.Tables
set crtable = crdatabasetables.Item(1)
crtable.SetLogonInfo "ODBCDSNname", "", cstr(userid), cstr(password)

'Create subreport database object, get table(s), login
set CRSubreports = session("oRpt").OpenSubReport("testsub.rpt")
set ReportDatabase2 = CRSubreports.Database
Set crdatabasetables2 = ReportDatabase2.tables
Set CRtable2 = crdatabasetables2.Item(1)
crtable2.SetLogonInfo "ODBCDSNname", "", cstr(userid), cstr(password)

'Get handles to parameters in main report (there are 2)
set Session("ParamCollection") = Session("oRpt").Parameterfields
Set ThisParam1 = Session("ParamCollection").item(1)
Set ThisParam2 = Session("ParamCollection").item(2)

'Set values for the parameters
ThisParam1.SetCurrentValue cstr("paramvalue1"),12
ThisParam2.SetCurrentValue cstr("paramvalue2"),12

'Get handles to parameters in SUB report (there are 2)
set Session("SubRptParamCollection") = CRSubreports.Parameterfields
Set ThisParam1 = Session("SubRptParamCollection").item(1)
Set ThisParam2 = Session("SubRptParamCollection").item(2)

'Set values for the parameters (these were previously set in the main report.
ThisParam1.SetCurrentValue cstr("paramvalue4"),12
ThisParam2.SetCurrentValue cstr("paramvalue3"),12

For more sample ASP applications to use as templates for your Crystal Reports web applications please download the file aspxmps8.exe (for version 8.0) or aspxmps85.exe (for version 8.5) from our support site at:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top