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!

URGENT HELP!! Error Occurred creating Report Object: Object required

Status
Not open for further replies.

jakiedude

Programmer
Jun 14, 2005
1
US
Hello All -

I am currently using Crystal Reports v10 and am calling a main report which has 5 sub-reports. At the design time, I am able to invoke the report with accurate results. At the run-time while I invoke this with an ASP page, I get the following error:

Error Occurred creating Report Object: Object required

I am using the sample code from BusinessObjects and am invoking the report. Please advice what might be wrong.

Here is the code:

<%@ LANGUAGE="VBSCRIPT" %>

<%
Dim strworkdate
Dim dtmworkdate
Dim strstatdate
Dim strstatdate2
Dim MerchID
%>

<%
reportname = "WeeklyStatement.rpt"
%>

<%
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->

<%

'The following section shows setting single valued parameters of various data types.
strworkdate = request("drpweekly")
dtmworkdate = datevalue(strworkdate)
strstatdate = ""
strstatdate = year(dtmworkdate)
if len(month(dtmworkdate)) = 1 then
strstatdate = strstatdate & "0" & month(dtmworkdate)
else
strstatdate = strstatdate & month(dtmworkdate)
end if
if len(day(dtmworkdate)) = 1 then
strstatdate = strstatdate & "0" & day(dtmworkdate)
else
strstatdate = strstatdate & day(dtmworkdate)
end if
strstatdate = strstatdate & "000000"

Session("oRpt").ParameterFields.GetItemByName("BeginDate").AddCurrentValue(CStr(strstatdate))

dtmworkdate = dateadd("d", 7, dtmworkdate)
strstatdate2 = ""
strstatdate2 = year(dtmworkdate)
if len(month(dtmworkdate)) = 1 then
strstatdate2 = strstatdate2 & "0" & month(dtmworkdate)
else
strstatdate2 = strstatdate2 & month(dtmworkdate)
end if
if len(day(dtmworkdate)) = 1 then
strstatdate2 = strstatdate2 & "0" & day(dtmworkdate)
else
strstatdate2 = strstatdate2 & day(dtmworkdate)
end if
strstatdate2 = strstatdate2 & "999999"

Session("oRpt").ParameterFields.GetItemByName("EndDate").AddCurrentValue(CStr(strstatdate2))

MerchID = Session("MerchId")
Session("oRpt").ParameterFields.GetItemByName("MerchantID").AddCurrentValue(CStr(MerchID))

strstatdate = strstatdate & " " & strstatdate2 & " " & MerchID

%>


<%
Set mainReportTableCollection = Session("oRpt").Database.Tables

For Each mnTable in mainReportTableCollection
With mnTable.ConnectionProperties
.Item("user ID") = "ccnew"
.Item("Password") = "ccnew123"
.Item("DSN") = "CollectWeb"
.Item("Database") = "CheckCollectWeb"
End With
Next

Set session("oSubRpt1") = session("oRpt").OpenSubreport("SummaryTwo")

Set subReportTableCollection = Session("oSubRpt1").Database.Tables

For Each subTable in subReportTableCollection
With subTable.ConnectionProperties
.Item("user ID") = "ccnew"
.Item("Password") = "ccnew123"
.Item("DSN") = "CollectWeb"
.Item("Database") = "CheckCollectWeb"
End With
Next

Set session("oSubRpt2") = session("oRpt").OpenSubreport("NewCheckSub")

Set subReportTableCollection = Session("oSubRpt2").Database.Tables

For Each subTable in subReportTableCollection
With subTable.ConnectionProperties
.Item("user ID") = "ccnew"
.Item("Password") = "ccnew123"
.Item("DSN") = "CollectWeb"
.Item("Database") = "CheckCollectWeb"
End With
Next

Set session("oSubRpt3") = session("oRpt").OpenSubreport("CollectedChecksSub")

Set subReportTableCollection = Session("oSubRpt3").Database.Tables

For Each subTable in subReportTableCollection
With subTable.ConnectionProperties
.Item("user ID") = "ccnew"
.Item("Password") = "ccnew123"
.Item("DSN") = "CollectWeb"
.Item("Database") = "CheckCollectWeb"
End With
Next

Set session("oSubRpt4") = session("oRpt").OpenSubreport("UncollectedChecks")

Set subReportTableCollection = Session("oSubRpt4").Database.Tables

For Each subTable in subReportTableCollection
With subTable.ConnectionProperties
.Item("user ID") = "ccnew"
.Item("Password") = "ccnew123"
.Item("DSN") = "CollectWeb"
.Item("Database") = "CheckCollectWeb"
End With
Next


'==================================================================
'==================================================================
%>

<%
%>
<!-- #include file="MoreRequiredSteps.asp" -->

<% %>
<!-- #include file="SmartViewerActiveX.asp" -->
 
I only have experience in version 8.5 but when I open subreports I have to use the report name and report file extension.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top