on 04-11-2012 11:52 PM
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>
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;
If you let me know your preference, I can supply you with more follow-up info.
- Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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:
- Ludek
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.