Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simplified way to call crystal report from ASP

Status
Not open for further replies.

smasaitis

Programmer
Jul 31, 2000
15
0
0
US
OK, here is the deal:
I want to call a crystal report (version 8.5) from an ASP page. Sounds simple? No, it's not.

I have searched Crystal's web site ( They do not make it clear.

I have searched all of the Tek-Tips forums/FAQs regarding Crystal and the web. I see a lot of questions out there about asking how to call Crystal Reports from the web, but most of them do not have a response (I am hoping someone will respond to my post). The ones that do have a response suggest downloading the samples from Cyrstal's web site (aspxmps85.exe).

I tried their examples, but I know there has to be a way to call a Crystal Report without having to incorporate 10 pages of ASP.

Here is the code I am trying to use (I took this code right from the FAQ "How to open crystal reports from ASP"):

<html>
<head>
<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Sub Window_Onload
Dim webBroker
Set webBroker = CreateObject&quot;WebReportBroker.WebReportBroker&quot;)
if err.number <> 0 then
window.alert &quot;The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site.&quot;
CRViewer.ReportName = &quot; else
Dim webSource0
Set webSource0 = CreateObject(&quot;WebReportSource.WebReportSource&quot;)
webSource0.ReportSource = webBroker
webSource0.URL = &quot; webSource0.PromptOnRefresh = True
CRViewer.ReportSource = webSource0
end if
CRViewer.ViewReport

End Sub
</SCRIPT>
<title>Test</title>
</head>
<body bgcolor=&quot;C6C6C6&quot; topmargin=&quot;0&quot; leftmargin=&quot;0&quot;>

<OBJECT ID=&quot;CRViewer&quot;
CLASSID=&quot;CLSID:C4847596-972C-11D0-9567-00A0C9273C2A&quot;
WIDTH=100% HEIGHT=99%
CODEBASE=&quot;/viewer/activeXViewer/activexviewer.cab#Version=8,5,0,217&quot;>
<PARAM NAME=&quot;EnableRefreshButton&quot; VALUE=1>
<PARAM NAME=&quot;EnableGroupTree&quot; VALUE=0>
<PARAM NAME=&quot;DisplayGroupTree&quot; VALUE=0>
<PARAM NAME=&quot;EnablePrintButton&quot; VALUE=1>
<PARAM NAME=&quot;EnableExportButton&quot; VALUE=0>
<PARAM NAME=&quot;EnableDrillDown&quot; VALUE=1>
<PARAM NAME=&quot;EnableSearchControl&quot; VALUE=1>
<PARAM NAME=&quot;EnableAnimationControl&quot; VALUE=1>
<PARAM NAME=&quot;EnableZoomControl&quot; VALUE=1>
</OBJECT>
</body>
</html>


The Crystal Viewer displays, but a message box says, &quot;Connection to Report Server Failed.&quot;

I have tried appending a username and password to the URL, but that does not work either.

What does the &quot;WebReportBroker&quot; mean?
Why can't I call the report like I call the report in VB?

I have tried using this code too:
Dim crxApplication
Dim crxReport

Set crxApplication = Server.CreateObject(&quot;CrystalRuntime.Application&quot;)
Set crxReport = crxApplication.OpenReport(&quot;C:\Inetpub\crxReport.Database.Tables(1).SetLogOnInfo &quot;dsn_provider&quot;

Again, this code does not work for me.

If anyone has a very simple way to call a Crystal Report in ASP, please respond with code examples.

Please do not respond with &quot;Check out the samples from Cyrstal's web site (aspxmps85.exe).&quot;

I want simplified code without having to call multiple ASP pages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top