Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO 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 September 15th, 2005, 05:15 AM
Registered User
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default calling crystal report from asp

I am calling a crystal report 8.0.0.317 report from my asp page. There is nop error generated but the internet explorer 6 shows only white screen.what should i do now? Im using the following code.

 <------test.asp-------->
<%
reportname="first.rpt"
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
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
%>


  <-------SmartViewerActiveX.asp-------->
<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
    CLASSID="CLSID={C4847596-972C-11D0-9567-00A0C9273C2A}"
    WIDTH="100%" HEIGHT="99%"
    CODEBASE="/Viewers/ActiveXViewer/activexviewer.cab#Version=8,0,0,371" VIEWASTEXT>
<PARAM NAME="DisplayBackgroundEdge" VALUE=0>
                    <PARAM NAME="DisplayBorder" VALUE=1>
                    <PARAM NAME="DisplayGroupTree" VALUE=1>
                    <PARAM NAME="DisplayTabs" VALUE=1>
                    <PARAM NAME="DisplayToolbar" VALUE=1>
                    <PARAM NAME="EnableAnimationControl" VALUE=1>
                    <PARAM NAME="EnableAnimationCtrl" VALUE=1>
                    <PARAM NAME="EnableCloseButton" VALUE=1>
                    <PARAM NAME="EnableDrillDown" VALUE=1>
                    <PARAM NAME="EnableGroupTree" VALUE=1>
                    <PARAM NAME="EnableNavigationControls" VALUE=1>
                    <PARAM NAME="EnablePrintButton" VALUE=1>
                    <PARAM NAME="EnableProgressControl" VALUE=1>
                    <PARAM NAME="EnableRefreshButton" VALUE=1>
                    <PARAM NAME="EnableSearchControl" VALUE=1>
                    <PARAM NAME="EnableStopButton" VALUE=1>
                    <PARAM NAME="EnableToolbar" VALUE=1>
                    <PARAM NAME="EnableZoomControl" VALUE=1>

</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload()
    On Error Resume Next
    Dim webBroker
    Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
    if err.number <> 0 then
        window.alert "The Crystal ActiveX Viewer is unable to create it's resource objects."
        CRViewer.ReportName = "http://localhost/crys/first.rpt"

    else
        Dim webSource0
        Set webSource0 = CreateObject("WebReportSource.WebReportSource")
        webSource0.ReportSource = webBroker
        webSource0.URL = "http://localhost/crys/first.rpt"
        webSource0.PromptOnRefresh = True
        CRViewer.ReportSource = webSource0
    end if
    CRViewer.ViewReport
End Sub
-->
</SCRIPT>

</BODY>
</HTML>


 
Old September 16th, 2005, 07:18 AM
Registered User
 
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ensure that you are having the Activexviewer.cab in the path where you are having the smartvieweractivex.asp(the content you gave here will be present in the asp file i mentioned.)
Search for the Activexviewer.cab in your m/c and copy it in asp file path.
also change the following line,
 WIDTH="100%" HEIGHT="99%"
    CODEBASE="/Viewers/ActiveXViewer/activexviewer.cab#Version=8,0,0,371" VIEWASTEXT>

to
 WIDTH="100%" HEIGHT="99%"
    CODEBASE="activexviewer.cab#Version=8,0,0,371" VIEWASTEXT>

Now you launch it wll work.






Similar Threads
Thread Thread Starter Forum Replies Last Post
calling crystal report from java radha Crystal Reports 1 May 24th, 2006 09:55 AM
Calling Crystal report from BO XI server using ASP raajnselliah Crystal Reports 0 February 6th, 2006 09:31 AM
calling Crystal report from java radha Crystal Reports 2 July 1st, 2005 07:21 AM
Calling Crystal report from Java code anubhav.kumar BOOK: Beginning Java 2, JDK 5 Edition 0 May 24th, 2005 08:46 AM
calling crystal report from asp.net ashish_26 Crystal Reports 1 August 27th, 2004 10:25 AM





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