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

Invalid Subreport name

Status
Not open for further replies.
Oct 11, 2006
300
US
Hi,

I am trying to open a report with multiple number of sub-reports from ASP. When I look into the report from the designer, I can see that quota.rpt is a sub-report within CommissionStatement2006.rpt

However in the directory where CommissionStatement2006.rpt is saved, quota.rpt does not exist.

I use this log on info for my sub-report.

'------Quota.rpt------------------------
'set subReport1 = session("oRpt").OpenSubReport("Quota.rpt")
'subReport1.ConnectionInfo = strConnect
'subReport1.SetLogonInfo "DSNName", "DBName", cstr(userid), cstr(password)

When I run this, I get the error message:

Error Type:
Crystal Reports ActiveX Designer (0x80047900)
Invalid subreport name.
/scripts/ViewReports.asp, line 103

Where Line 103 refers to :

set subReport1 = session("oRpt").OpenSubReport("Quota.rpt")

I even tried "Quota", but that also does not work. So what can I do about this?

Thanks.
 
Hi,
A SubReport is 'part of' the main report and should not need to be called directly..What problem were you having that caused the need to open it as a separate object?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I never opened the subreport seperately. This main report is linked to all of its sub-reports.

Now the report is not showing any data (parameters not being displayed in the report, though I know parameters are being passed), subreports not being seen and I get the error:

Invalid report name when I set the logoninfo for the subreport as well.

Thanks.
 
Hi,
Doesn't this line:

set subReport1 = session("oRpt").OpenSubReport("Quota.rpt")

attempt to open the sub?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Yes, I am trying to open the sub.

I thought that maybe if I pass the logon info to the sub as well (which also pulls data from the same database as the main report), I should be able to do this. But I get an error of Invalid report name.

Any ideas about this.

Thanks.
 
Hi,
I'm confused ( not all that rare) , you say in one place:
I never opened the subreport seperately
but now say you are trying to open a sub directly..

The Sub has its logon info assigned by using the Main Report's Object and iterating through its subs..
I do not have by COM docs at hand but there are methods that that object can use for this..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Ok Let me explain.

I have a report with 12 sub-reports. All the sub reports are linked to the main report.

On the main report there are 2 parameters - ?EmpId and ?Post Date

I pass two form variables from the ASP page to the CR 8.5

These crystal parameters are supposed to grab it. It grabbed it and showed the 1st employee. Now when I changed selection of employee in the ASP page, it does not show the change in selection (this is a different issue)

When I pass the parameters, I get an error message "Could not connect to the data source". So I thought maybe I have to add logon information to the sub-reports as well. When I do that, I get Invalid report error.

Something like this:

Setting the connection to the report.

' Set the location
set crtable = session("oRpt").Database.Tables.Item(1)
crtable.SetLogonInfo "DSNName", "DBName", cstr(userid), cstr(password)

Then I do this:

'------Quota.rpt------------------------
set subReport1 = session("oRpt").OpenSubReport("Quota.rpt")
subReport1.ConnectionInfo = strConnect
subReport1.SetLogonInfo "DSNName", "DBName", cstr(userid), cstr(password)

Then I want to pass parameters.

But invalid reportname error comes up.

I hope I xplained my scenario.

Thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top