srafi78
asked on
Crystal Reports and ASP "a Trappable Error occurred in external object Script cannot continue" Urgent Help Required
Hi, I was trying to develop an application using ASP for Crystal Reports 9, to view the reports already created in the Crystal Reports Designer. The Database I am using is Oracle 9i and I have the oracle client installed for this database on my Dev machine. I have written the following code from the code examples supplied by Business Objects. When I try to execute the following script I get the error as
Active Server Pages, ASP 0115 (0x80004005)
A trappable error (E06D7363) occurred in an external object. The script cannot continue running.
/Test123/TestReports.asp
When I try to debug the code I am stalled at the Line where I declare the database connection properties.
Is the code right? I have not developed this type of application before. I need urgent help as the Project is due to Go Live in the first week of New Year.
Thanks in Advance
SR
<%
'Create the Application object
If Not IsObject(session("oApp")) Then
Set session("oApp") =Server.CreateObject("Crys talRuntime .Applicati on.9")
End If
'Create Report Object
reportname = "C:\ReportDesignASP\Simple SetLogonIn fo\rptTest 1.rpt"
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End If
Set session("oRpt") = session("oApp").OpenReport (reportnam e,1)
'Disable error prompts on webserver
session("oRpt").EnablePara meterPromp ting = False
'Log On to report database connection
session("oRpt").Database.T ables(1).C onnectionP roperties( "Server") = "ORADB"
session("oRpt").Database.T ables(1).C onnectionP roperties( "User Id") = "xxxx"
session("oRpt").Database.T ables(1).C onnectionP roperties( "Password" ) = "xxxx"
session("oRpt").DiscardSav edDate
on Error Resume Next
session("oRpt").ReadRecord s
If Err.Number<>0 THEN
Response.Write ("A server error occured when trying to access the datasource")
End If
If IsObject(session("oPageEng ine")) Then
Set session("oPageEngine") = Nothing
End If
Set session("oPageEngine") = session("oRpt").PageEngine
%>
<!-- #include file="ActiveXPluginViewer. asp" -->
Active Server Pages, ASP 0115 (0x80004005)
A trappable error (E06D7363) occurred in an external object. The script cannot continue running.
/Test123/TestReports.asp
When I try to debug the code I am stalled at the Line where I declare the database connection properties.
Is the code right? I have not developed this type of application before. I need urgent help as the Project is due to Go Live in the first week of New Year.
Thanks in Advance
SR
<%
'Create the Application object
If Not IsObject(session("oApp")) Then
Set session("oApp") =Server.CreateObject("Crys
End If
'Create Report Object
reportname = "C:\ReportDesignASP\Simple
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End If
Set session("oRpt") = session("oApp").OpenReport
'Disable error prompts on webserver
session("oRpt").EnablePara
'Log On to report database connection
session("oRpt").Database.T
session("oRpt").Database.T
session("oRpt").Database.T
session("oRpt").DiscardSav
on Error Resume Next
session("oRpt").ReadRecord
If Err.Number<>0 THEN
Response.Write ("A server error occured when trying to access the datasource")
End If
If IsObject(session("oPageEng
Set session("oPageEngine") = Nothing
End If
Set session("oPageEngine") = session("oRpt").PageEngine
%>
<!-- #include file="ActiveXPluginViewer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if the samll mark is the Red x this means that the viewer has not been downloaded to the client machine.
There are many reason why this occurs you will need search the BO website and check the knowledge base for documents relating to yor specific setup.
Go to http://support.businessobjects.com/search/advsearch.asp?q= and enter Red x as the search criteria.
Here is the info for passing parameter values to the report
'The following section shows setting single valued parameters of various data types.
Session("oRpt").ParameterF ields.GetI temByName( "ExampleSt ringParame ter").AddC urrentValu e(CStr("I am a string"))
Session("oRpt").ParameterF ields.GetI temByName( "ExampleNu mberParame ter").AddC urrentValu e(CDbl("12 345"))
Session("oRpt").ParameterF ields.GetI temByName( "ExampleBo oleanParam eter").Add CurrentVal ue(CBool(" True"))
Session("oRpt").ParameterF ields.GetI temByName( "ExampleCu rrencyPara meter").Ad dCurrentVa lue(CDbl(" 10.3273"))
Session("oRpt").ParameterF ields.GetI temByName( "ExampleDa teParamete r").AddCur rentValue( CDate("200 1/Jan/02") )
Session("oRpt").ParameterF ields.GetI temByName( "ExampleTi meParamete r").AddCur rentValue( CDate("3:4 5:00 PM"))
Session("oRpt").ParameterF ields.GetI temByName( "ExampleDa teTimePara meter").Ad dCurrentVa lue(CDate( "2001/Jan/ 02 3:45:00 PM"))
'This section demonstrates the enabling of multiple values for a parameter and then setting
'a number of different values for that single parameter.
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Ena bleMultipl eValues = 1
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Add CurrentVal ue(CStr("A nne"))
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Add CurrentVal ue(CStr("N ancy"))
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Add CurrentVal ue(CStr("L aura"))
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Add CurrentVal ue(CStr("J ustin"))
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Add CurrentVal ue(CStr("M argaret"))
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Add CurrentVal ue(CStr("S teven"))
session("oRpt").ParameterF ields.GetI temByName( "ExampleMu ltiValuedS tringParam eter").Add CurrentVal ue(CStr("A lbert"))
'This section shows enabling a parameter to accept a ranged parameter.
'The first line sets the DiscreetOrRangeKind to 1. For Ranged parameters the constant is 1.
'The second line uses the AddCurrentRange method which takes three arguments.
' AddCurrentRange LowerBoundValue, UpperBoundValue, CRRangeInfoConstant
'The CRRangeInfoConstant of 3 indicates that the range should include values greater than or equal to
'the lower bound and less than or equal to the upper bound.
session("oRpt").ParameterF ields.GetI temByName( "ExampleRa ngedNumber Parameter" ).Discrete OrRangeKin d = 1
session("oRpt").ParameterF ields.GetI temByName( "ExampleRa ngedNumber Parameter" ).AddCurre ntRange CDbl("5"),CDbl("10"),CDbl( "3")
Here is code to utilise the report parameter collection
set session("ParamCollection") = Session("oRpt").Parameterf ields
set Param1 = session("ParamCollection") .Item(1)
Call Param1.SetCurrentValue (CDbl(ParamValue1))
set Param2 = session("ParamCollection") .Item(2)
Call Param2.SetCurrentValue (Cstr(LastName))
set Param3 = session("ParamCollection") .Item(3)
Call Param3.SetCurrentValue (Cstr(FirstName))
Gary
There are many reason why this occurs you will need search the BO website and check the knowledge base for documents relating to yor specific setup.
Go to http://support.businessobjects.com/search/advsearch.asp?q= and enter Red x as the search criteria.
Here is the info for passing parameter values to the report
'The following section shows setting single valued parameters of various data types.
Session("oRpt").ParameterF
Session("oRpt").ParameterF
Session("oRpt").ParameterF
Session("oRpt").ParameterF
Session("oRpt").ParameterF
Session("oRpt").ParameterF
Session("oRpt").ParameterF
'This section demonstrates the enabling of multiple values for a parameter and then setting
'a number of different values for that single parameter.
session("oRpt").ParameterF
session("oRpt").ParameterF
session("oRpt").ParameterF
session("oRpt").ParameterF
session("oRpt").ParameterF
session("oRpt").ParameterF
session("oRpt").ParameterF
session("oRpt").ParameterF
'This section shows enabling a parameter to accept a ranged parameter.
'The first line sets the DiscreetOrRangeKind to 1. For Ranged parameters the constant is 1.
'The second line uses the AddCurrentRange method which takes three arguments.
' AddCurrentRange LowerBoundValue, UpperBoundValue, CRRangeInfoConstant
'The CRRangeInfoConstant of 3 indicates that the range should include values greater than or equal to
'the lower bound and less than or equal to the upper bound.
session("oRpt").ParameterF
session("oRpt").ParameterF
Here is code to utilise the report parameter collection
set session("ParamCollection")
set Param1 = session("ParamCollection")
Call Param1.SetCurrentValue (CDbl(ParamValue1))
set Param2 = session("ParamCollection")
Call Param2.SetCurrentValue (Cstr(LastName))
set Param3 = session("ParamCollection")
Call Param3.SetCurrentValue (Cstr(FirstName))
Gary
ASKER
Thanks Gary, I really appreciate your help. You deserve the full score with an A!
SR
SR
SR
If you can get the big cheeses to stump up the meager fee, there is a 3rd party utily called Recrystallize which creates the ASP pages for you, including any database logons, paramaters , viewer buttons and resizing etc. I think it's well worth the money
You can find out more at http://www.recrystallize.com/
Gary
If you can get the big cheeses to stump up the meager fee, there is a 3rd party utily called Recrystallize which creates the ASP pages for you, including any database logons, paramaters , viewer buttons and resizing etc. I think it's well worth the money
You can find out more at http://www.recrystallize.com/
Gary
ASKER
Hi Gary,
I tried the code you supplied and was able to move forward but now I just get a grey screen with a small mark at the top left of the screen. The modified code is
<%
'Create the Application object
If Not IsObject(session("oApp")) Then
Set session("oApp") =Server.CreateObject("Crys
End If
'Create Report Object
reportname = "C:\ReportDesignASP\Simple
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End If
Set session("oRpt") = session("oApp").OpenReport
'Disable error prompts on webserver
session("oRpt").EnablePara
'Log On to report database connection
'Creat a tables collection
Set crTableCollection = Session("oRpt").Database.T
'Loop through the tables and assign log on info
For Each crTable in crTableCollection
crtable.ConnectionProperti
crtable.ConnectionProperti
crtable.ConnectionProperti
if not crtable.TestConnectivity then
response.write "Warning: Unable to connect to data source using the following information.<BR><BR>"
response.write "Server / ODBC data source: " & crtable.ConnectionProperti
response.write "Database / Table: " & crtable.ConnectionProperti
response.write "User Name: " & crtable.ConnectionProperti
response.write "Please verify the database user password in this ASP file.<BR><BR>"
end if
Next
session("oRpt").DiscardSav
On Error Resume Next
session("oRpt").ReadRecord
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEng
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
<!-- #include file="ActiveXPluginViewer.
How can I get my report to show up in the browser?
Also, can you brief me on how to pass parameters. I have set three parameters for searching through the records in the reports. The records can be searched by Customer ID or the lastname( last name can be accompanied by the first name(optional)?
Thank you in advance.
SR