cancel
Showing results for 
Search instead for 
Did you mean: 

CR Viewer issue in CR 2008.

Former Member
0 Kudos

For over 13 years ( using Crystal 6 through 11.5)we have called the viewer through an ActiveX call using this code and now it is something no longer available to CR2008 > . We still create the report fine but can no longer call the browser to open the rpt with the active x. Anyone no what we need to do to get this working. I am having a difficult time figuring it out since this is most likely a call to a web folder.

<%@ Language=VBScript CodePage=65001 %>

<%

session("rname")=trim(request("rname"))

reportName = "../xreports/" & trim(request("rname"))

Set objFactory = CreateObject("CrystalReports.ObjectFactory")

   

Dim path, iLen

path = Request.ServerVariables("PATH_TRANSLATED")                    

While (Right(path, 1) <> "\" And Len(path) <> 0)                     

iLen = Len(path) - 1                                                 

path = Left(path, iLen)                                              

Wend      

                                                                                                                                                                                  

' Create a new ReportClientDocument object

Set Session("oClientDoc") = objFactory.CreateObject("CrystalClientDoc.ReportClientDocument")

' Specify the RAS Server (computer name or IP address) to use (If SDK and RAS Service are running on seperate machines)

Session("oClientDoc").ReportAppServer = "localhost"

' Open the report object to initialize the ReportClientDocument

Session("oClientDoc").Open path & reportName

Response.Redirect "activexv.asp"

%>

this is my activexv.asp code

%

' Copyright © 2004 Eatec Corporation

'

%>

<HTML>

<HEAD>

<TITLE>Crystal Reports ActiveX Viewer</TITLE>

</HEAD>

<BODY BGCOLOR=C6C6C6 topmargin=0 leftmargin=0>

<OBJECT ID="CRViewer"

    CLASSID="CLSID:6F0892F7-0D44-41C3-BF07-7599873FAA04"

    WIDTH=100% HEIGHT=100%

    CODEBASE="/crystalreportviewers115/activeXcontrols/activexviewer.cab#Version=11,5,3,438" VIEWASTEXT>

<PARAM NAME="EnableRefreshButton" VALUE=0>

<PARAM NAME="EnableGroupTree" VALUE=0>

<PARAM NAME="DisplayGroupTree" VALUE=0>

<PARAM NAME="EnablePrintButton" VALUE=1>

<PARAM NAME="EnableExportButton" VALUE=0>

<PARAM NAME="EnableDrillDown" VALUE=0>

<PARAM NAME="EnableSearchControl" VALUE=0>

<PARAM NAME="EnableAnimationControl" VALUE=0>

<PARAM NAME="EnableZoomControl" VALUE=0>

<PARAM NAME="EnableSelectExpertButton" VALUE=0>

</OBJECT>

<SCRIPT LANGUAGE="VBScript">

<!--

dim timer

dim printerTimer

dim pageOne

PageOne = True

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 need to get the latest version of VBScript or install IE 4.01 SP1 or newer. Users of Windows 95 additionally need DCOM95.  These files are available at Microsoft's web site."

    else

        Dim webSource

        Set webSource = CreateObject("CrystalReports115.WebReportSource.1")

        webSource.ReportSource = webBroker

        webSource.URL = "rptserver.asp"

        webSource.PromptOnRefresh = True

        CRViewer.ReportSource = webSource

    End If

    CRViewer.ViewReport

End Sub

Sub CRViewer_DownloadFinished(byval downloadType)

if downloadType = 1 and PageOne then

PageOne = False

<!-- timer = window.settimeout("OnMyTimeOut",1000) -->

'window.alert "DownloadFinished"

window.status = "downloadfinished"

end if

end sub

Sub OnMyTimeOut()

if not CRViewer.IsBusy then

window.ClearTimeout(timer)

'window.alert "My timeout"

CRViewer.PrintReport

printerTimer = window.SetTimeOut("OnPrinterTimeOut", 10000)

end if

end sub

Sub OnPrinterTimeOut()

'window.alert "OnPrinterTimeout"

if not CRViewer.IsBusy then

window.ClearTimeOut(printerTimer)

'window.History.Back

window.status = "done"

end if

end sub

-->

</SCRIPT>

<script language="javascript">

function CallDestroy()

{

    window.open("Cleanup.asp");

}

</script>

<div>

<!-- This empty div prevents IE from showing a bunch of empty space for the controls above. -->

</div>

<!-- <% = "<p align=""center""><br><br><br><img src="""" alt=""eerc"" WIDTH=""246"" HEIGHT=""112""><p align=""center""><b>Report " & trim(request("rname")) & " printing</b>" %> -->

</BODY>

</HTML>

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Unfortunately, there is nothing you can do to get this working. The COM SDK was retired in version 11.5 of Crystal Reports. And while the crviewer.dll and craxDDrt.dll are included with CR 2008, they are there only for internal purposes and there is no developer license extended to you. E.g.; you can not use these in any app. Additionally, even if you would use these, there is no way to distribute the runtime for craxDDrt and crviewer (RDC).

Your options;

  1. Obtain CR XI R2 (11.5) and step down from CR 2008. Note that CR XI R2 is no longer supported. meaning no fixes or phone support.
  2. Port your application to use either the CR SDK for .NET or Java

If you let me know your preference, I can supply you with more follow-up info.

- Ludek

Former Member
0 Kudos

Thanks for the response back . I would like to see how we can use the CR SDK for .Net. If you could supply some more followup it would be great.

Thanks

Jim

former_member183750
Active Contributor
0 Kudos

The place to start will with Service Packs. Make sure you are on SP 4 or SP 5 for CR 2008. See:

http://scn.sap.com/docs/DOC-25513

Next some resources.

Sample apps CR SDK

Sample apps InProc RAS SDK

Crystal Reports for Visual Studio 2005 Walkthroughs

(will apply to what ever version of CR and .NEt you are using, for the most part)

How to Use The RAS SDK .NET With In-Process RAS Server

And finally Developer Help Files:

CR 2008 developer library

CR 2008 API Reference

- Ludek

Answers (0)