p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: opening crystal report from ASP page


Message #1 by "RajSundar" <rajgaya@a...> on Tue, 23 Apr 2002 22:58:29
Hello,
 When I try opening crystal report from asp page using crxviewer activex 
control version 8.0 I see a blank crxviewer in the browser. At first I 
thought the url property of Websource is incorrect and I hard coded the 
url. But I'm still getting a blank crxviewer. However when I change the 
cab version to match crystal report 7.0 I can view the report. Is there 
any property I need to set differently for 8.0 version.

 Here is the code I'm using 

<HTML>
<HEAD>
<TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">

<OBJECT ID="CRViewer"
	CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
	WIDTH=100% HEIGHT=95%
	codebase="activexviewer.cab#Version=8,0,0,371">
	<PARAM NAME="EnableRefreshButton" VALUE=0>
    <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 Page_Initialize
	On Error Resume Next
	Dim webBroker
	Dim webSource
	Dim iCount
	Dim sMsg
		
        sMsg = location.href
        iCount = 1
        
        while right(sMsg,iCount) <> "/"
            sMsg = left(sMsg,len(sMsg)-iCount)
        wend
		
	sMsg = sMsg & "CustomerNotificationSP.rpt"
	Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
	Set webSource = CreateObject("WebReportSource.WebReportSource")
	webSource.ReportSource = webBroker
	webSource.URL = sMsg			
	CRViewer.ReportSource = webSource
	CRViewer.ViewReport
	set webBroker = nothing

End Sub
-->
</SCRIPT>

</BODY>
</HTMl>

 Can you also tell me if there is a way I can pass parms to crystal report 
from an ASP page.

 Thanks, Raj.
Message #2 by "Jim Doiron" <jd@i...> on Wed, 24 Apr 2002 08:23:49 -0500
Try using either CR8.5's active X viewer or CR7.0's active X viewer
(npviewer.exe). Install this on both your IIS server and workstation and you
should see the reports fine.

Yes, you can pass parameters into a CR report. I'm actually using a product
called "Re-Crystallize" and then modifying the asp if needed. I found this
to be a great product. It basically goes through your CR report and creates
an ASP front end within minutes.

If your interested the url is www.recrystallize.com.


Good luck,

Jim

----- Original Message -----
From: "RajSundar" <rajgaya@a...>
To: "crystal_reports" <crystal_reports@p...>
Sent: Tuesday, April 23, 2002 10:58 PM
Subject: [crystal_reports] opening crystal report from ASP page


> Hello,
>  When I try opening crystal report from asp page using crxviewer activex
> control version 8.0 I see a blank crxviewer in the browser. At first I
> thought the url property of Websource is incorrect and I hard coded the
> url. But I'm still getting a blank crxviewer. However when I change the
> cab version to match crystal report 7.0 I can view the report. Is there
> any property I need to set differently for 8.0 version.
>
>  Here is the code I'm using
>
> <HTML>
> <HEAD>
> <TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
> </HEAD>
> <BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">
>
> <OBJECT ID="CRViewer"
> CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
> WIDTH=100% HEIGHT=95%
> codebase="activexviewer.cab#Version=8,0,0,371">
> <PARAM NAME="EnableRefreshButton" VALUE=0>
>     <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 Page_Initialize
> On Error Resume Next
> Dim webBroker
> Dim webSource
> Dim iCount
> Dim sMsg
>
>         sMsg = location.href
>         iCount = 1
>
>         while right(sMsg,iCount) <> "/"
>             sMsg = left(sMsg,len(sMsg)-iCount)
>         wend
>
> sMsg = sMsg & "CustomerNotificationSP.rpt"
> Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
> Set webSource = CreateObject("WebReportSource.WebReportSource")
> webSource.ReportSource = webBroker
> webSource.URL = sMsg
> CRViewer.ReportSource = webSource
> CRViewer.ViewReport
> set webBroker = nothing
>
> End Sub
> -->
> </SCRIPT>
>
> </BODY>
> </HTMl>
>
>  Can you also tell me if there is a way I can pass parms to crystal report
> from an ASP page.
>
>  Thanks, Raj.
>
>


  Return to Index