
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