-
Hi.
I need to do some report generation from ASP, but to do so, must first set up a .dll to manage things.
Here is the VB code of the ReportServer class of my Reporting dll:
(btw: I am using ActiveReports)
Code:
Function RunReport(rs As Recordset) As Integer
On Error Resume Next
Dim ar As ActiveReport1
Set ar = New ActiveReport1
ar.DataControl1.Recordset = rs
ar.DataControl1.Refresh
ar.Run
RunReport = Err.Number
End Function
Then I call this in ASP:
Code:
<%
set oRS = Server.CreateObject("ADODB.recordset")
stmSQL = "SELECT * FROM table1"
oRS.open stmSQL,"DSN=data1"
Set rptSrv = CreateObject("Reporting.ReportServer")
Response.Write "Error Code: "&rptSrv.RunReport(oRS)
%>
Produces the following error:
--
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'rptSrv.RunReport'
--
What am I missing?
tx
/~dvst8/
-
Since, in ASP all variables are Variants, change your DLL's RunReport function to have rs as variant. This should fix it.