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

ASP problem with SubReports

Status
Not open for further replies.

aleksandarn

Programmer
May 11, 2001
4
CA
I have created one big report that exists of many subreports. Using ASP help file from Crystal Decisions we, WEB designer and I, tried to make it work, but it usually gives us one or more errors. At the end we did it but only with report that does not have any subreports. WEB designer did not include any code for subreports because it treated subreports as finished part of main report. Do we have to open database connection for each subreport and what else has to be done in order to work. I would appreciate some code if it's possible.
We are using MS Access database and FrontPage as Publisher.
 
Here is the part of the ASP code we use for our subreport part...hope this helps.


'Set the userid and password for your database.
userid = "userid"
password = "password"

'Create a reference to the tables collection of the main report
Set mainReportTableCollection = Session("oRpt").Database.Tables

For Each Table in mainReportTableCollection
Table.SetLogonInfo "Time-Deltek", "Deltek", CStr(Userid), CStr(Password)

'Create a reference to the subreport object by opening the subreport
'by using its name as specified in the report designer.

Set subReportOne = session("oRpt").OpenSubReport("Job Summary Report Target (B&P).rpt")

Set subReportOneTablesCollection = subReportOne.Database.Tables

'Provide the logon credentials for the subreport
For Each Table in subReportOneTablesCollection
Table.SetLogonInfo "Time-Deltek", "Deltek", CStr(Userid), CStr(Password)
Next
Set subReportTwo = session("oRpt").OpenSubReport("Direct Labor Report.rpt")

Set subReportTwoTablesCollection = subReportTwo.Database.Tables

'Provide the logon credentials for the subreport
For Each Table in subReportTwoTablesCollection
Table.SetLogonInfo "Time-Deltek", "Deltek", CStr(Userid), CStr(Password)
Next
%>

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top