How to call a Crystal Report from VBScript 
Author Message
 How to call a Crystal Report from VBScript

Hi All

How can I call a Crystal Report from an VBScript ? Please help me in this
issue.

I used the following code but I am getting SQL server Error :

set x=Server.CreateObject("Crystal.CrystalReport")

set adoconn= Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject ("ADODB.Recordset")
adoconn.Provider="MSDAORA.1"
adoconn.ConnectionString = "Data source=XXXXXX;User ID=XXXX;password=XXXXX;"
adoconn.open
x.Connect=adoconn.ConnectionString
x.ReportFileName="D:\Program Files\Seagate Software\Crystal
Reports\sample\ASPSamples\myreport.rpt"
x.WindowState=crptMaximized    '  0 noraml;          1 minimized ;      2
maximized
x.Action = 1    '  (CrystalReport1.Action = 1) to print the report in
response to a user event.  ' Line No: 33 <-------------
x.PageZoom(100)
x.Destination =crptToWindow
x.Reset     'Returns all properties (except DataSource) for CrystalReport1
to their default values.

'+++++++++++++++++++++++++
I am getting the following Error:

CrystalReport error '800a5077'

Cannot open SQL server.

/scrsamples/ASPSamples/myrep.asp, line 33
' ++++++++++++++++++++++++++++++

Thanks
Murali



Fri, 19 Dec 2003 17:45:27 GMT  
 How to call a Crystal Report from VBScript


Quote:
> Hi All

> How can I call a Crystal Report from an VBScript ? Please help me in this
> issue.

> I used the following code but I am getting SQL server Error :

> set x=Server.CreateObject("Crystal.CrystalReport")

> set adoconn= Server.CreateObject("ADODB.Connection")
> set rs=Server.CreateObject ("ADODB.Recordset")
> adoconn.Provider="MSDAORA.1"
> adoconn.ConnectionString = "Data source=XXXXXX;User

ID=XXXX;password=XXXXX;"
Quote:
> adoconn.open
> x.Connect=adoconn.ConnectionString
> x.ReportFileName="D:\Program Files\Seagate Software\Crystal
> Reports\sample\ASPSamples\myreport.rpt"
> x.WindowState=crptMaximized    '  0 noraml;          1 minimized ;      2
> maximized
> x.Action = 1    '  (CrystalReport1.Action = 1) to print the report in
> response to a user event.  ' Line No: 33 <-------------
> x.PageZoom(100)
> x.Destination =crptToWindow
> x.Reset     'Returns all properties (except DataSource) for CrystalReport1
> to their default values.

> '+++++++++++++++++++++++++
> I am getting the following Error:

> CrystalReport error '800a5077'

> Cannot open SQL server.

> /scrsamples/ASPSamples/myrep.asp, line 33
> ' ++++++++++++++++++++++++++++++

> Thanks
> Murali



Sun, 21 Dec 2003 13:01:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Printing Crystal Reports without Crystal Control ActiveX or Crystal Reports API call

2. Calling all Crystal Reports Developers...

3. VBScript and Crystal Reports

4. ASP - VBscript - Crystal Report

5. Using Crystal Reports with VBScript

6. Crystal Report (RDC) + ASP(vbScript) = ????

7. VBscript and Crystal Reports

8. Crystal Report, Outlook & VBScript

9. Creating RCAPI calls from Crystal Reports and viewing the report using a web application in .net

10. Call SQL stored procedure in VB5.0 and print report to Crystal report

11. vb5 Crystal Reports 6 and Subreports Can we conditionally call subreports from primary reports

12. Open Crystal Reports

 

 
Powered by phpBB® Forum Software