Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 5th, 2006, 03:35 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Call crystal reports from an ASP Pages

Hello,

I have developed a few crystal reports now I have write an ASP Application which uses the activeXViewer for displaying the report to the client. I have seen some code samples on the web (From www.businessobjects.com) and tried using the following code but i just get the error message "The Crystal Report Viewer is unable to create its resource objects". Can anyone help me out with this, its very urgent.

i m using crystal report XI, my browser is IE.6 ... is there i've to set in my browser ??
Can anyone help me out with this its very urgent.

Thanks
Suniti Agrawal

The Code I am trying to use is

1. SimplePreviewReport.asp

<%@ LANGUAGE="VBSCRIPT" %>

<%
reportname = "SimplePreviewReport.rpt"
%>





2. AlwaysRequiredSteps.asp

<%
If Not IsObject (session("oApp")) Then
  Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11 ")
End If

Path = Request.ServerVariables("PATH_TRANSLATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend

If IsObject(session("oRpt")) then
    Set session("oRpt") = nothing
End if

On error resume next

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

If Err.Number <> 0 Then
  Response.Write "Error Occurred creating Report Object: " & Err.Description
  Set Session("oRpt") = nothing
  Set Session("oApp") = nothing
  Session.Abandon
  Response.End
End If

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
'session("oRpt").DiscardSavedData
%>

3. MoreRequiredSteps.asp

<%
session("oRpt").ReadRecords

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("oPageEngine")) Then
      set session("oPageEngine") = nothing
  End If
  set session("oPageEngine") = session("oRpt").PageEngine
End If
%>

4. SmartViewerActiveX.asp

<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
    CLASSID="CLSID:6F0892F7-0D44-41C3-BF07-7599873FAA04"
    WIDTH=50% HEIGHT=50%
    CODEBASE="../viewer/ActiveXViewer.cab#Version=11,5,0,261" VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
    On Error Resume Next
    Dim webBroker
    Set webBroker = CreateObject("CrystalReports115.WebReportBroker.1" )
    if ScriptEngineMajorVersion < 2 then
        window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
    else
        Dim webSource
        Set webSource = CreateObject("CrystalReports115.WebReportSource.1" )
        webSource.ReportSource = webBroker
        webSource.URL = "RDCrptserver115.asp"
        webSource.PromptOnRefresh = True
        CRViewer.ReportSource = webSource
    end if
    CRViewer.ViewReport
End Sub
-->
</SCRIPT>

<script language="javascript">
function CallDestroy()
{
    window.open("Cleanup.asp");
}
</script>

</BODY>
</HTML>
 
Old December 21st, 2006, 10:39 AM
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have the same problem. Could you advise me how did you resolve that?


ahhhhhhhhhhhhh!!!!

Quote:
quote:Originally posted by agrawal
 Hello,

I have developed a few crystal reports now I have write an ASP Application which uses the activeXViewer for displaying the report to the client. I have seen some code samples on the web (From www.businessobjects.com) and tried using the following code but i just get the error message "The Crystal Report Viewer is unable to create its resource objects". Can anyone help me out with this, its very urgent.

i m using crystal report XI, my browser is IE.6 ... is there i've to set in my browser ??
Can anyone help me out with this its very urgent.

Thanks
Suniti Agrawal

The Code I am trying to use is

1. SimplePreviewReport.asp

<%@ LANGUAGE="VBSCRIPT" %>

<%
reportname = "SimplePreviewReport.rpt"
%>

                    



2. AlwaysRequiredSteps.asp

<%
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11 ")
End If

Path = Request.ServerVariables("PATH_TRANSLATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
                                                                    
If IsObject(session("oRpt")) then
    Set session("oRpt") = nothing
End if

On error resume next

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
End If

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
'session("oRpt").DiscardSavedData
%>

3. MoreRequiredSteps.asp

<%
session("oRpt").ReadRecords

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("oPageEngine")) Then
     set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>

4. SmartViewerActiveX.asp

<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
    CLASSID="CLSID:6F0892F7-0D44-41C3-BF07-7599873FAA04"
    WIDTH=50% HEIGHT=50%
    CODEBASE="../viewer/ActiveXViewer.cab#Version=11,5,0,261" VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
    On Error Resume Next
    Dim webBroker
    Set webBroker = CreateObject("CrystalReports115.WebReportBroker.1" )
    if ScriptEngineMajorVersion < 2 then
        window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
    else
        Dim webSource
        Set webSource = CreateObject("CrystalReports115.WebReportSource.1" )
        webSource.ReportSource = webBroker
        webSource.URL = "RDCrptserver115.asp"
        webSource.PromptOnRefresh = True
        CRViewer.ReportSource = webSource
    end if
    CRViewer.ViewReport
End Sub
-->
</SCRIPT>

<script language="javascript">
function CallDestroy()
{
    window.open("Cleanup.asp");
}
</script>

</BODY>
</HTML>

 
Old January 23rd, 2007, 06:36 PM
Registered User
 
Join Date: Jan 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HAve you all found a resolution to this? Be interested in hearing how! Thanks!

 
Old September 6th, 2007, 01:46 AM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello all!

i'm having the same problem. have you guys solved it?






Similar Threads
Thread Thread Starter Forum Replies Last Post
call crystal reports s_sanks Classic ASP Components 0 March 3rd, 2008 07:09 AM
Call Crystal Reports XI error message jmss66 VB Components 1 May 23rd, 2007 01:46 PM
Call Crystal Report 10 in ASP koecrit Classic ASP Professional 1 January 24th, 2007 06:27 AM
call crystal 10 thru ASP santwan Pro VB 6 0 December 16th, 2005 03:18 AM
printing 2 similar pages in Crystal reports 8.5 pallavijyo Pro VB 6 0 November 23rd, 2004 12:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.