PDA

Click to See Complete Forum and Search --> : ActiveReports control


Vit
Aug 9th, 2000, 05:11 AM
Hi everybody!
I try to generate a dynamic report on IIS using Datadynamics ActiveReport control. The DLL is registered on server mashine and should create a report, store it in a file and return link to it in ASP. But ActiveReport.Run statement causes 'error ASP 0115 - unexpected error'.
All procedures have proper error handling and report has the sub preventing error from being displayed.
Here's the code of DLL function that runs the report:

Public Function RunReport() As Boolean
'**************************************************
' This function creates report according to parameters set,
' saves it to file with unique generated name and sets
' FileName property to reflect the name of report for reference
'**************************************************

Dim rpt As Object
Dim pdf As Object

Dim rs As ADODB.Recordset

On Error GoTo err_hndl
'Get the recordset object from another function
set rs=GetRecordset(oAddendums)

Set rpt = New rptAddendums
Set rpt.DataControl1.Recordset = rs

rpt.Run False

FTempName = String(255, Chr$(0))
' GetTempFileName is a Win32 API function, you need
' to add the declaration in one of your modules

If Not GetTempFileName(FReportsPath, "AR", -1, FTempName) Then
RunReport = False
Exit Function
End If

FTempName = Left$(FTempName, InStr(FTempName, Chr$(0)) - 1)

If FFormat = eRDF Then
rpt.Pages.Save FTempName
ElseIf FFormat = ePDF Then
Set pdf = New ActiveReportsPDFExport.ARExportPDF
pdf.FileName = FTempName
pdf.Export rpt.Pages
End If

Unload rpt
Set rpt = Nothing
Set pdf = Nothing
RunReport = True

Exit Function

err_hndl:
FInfo = Err.Number & " - " & Err.Description
Set rpt = Nothing
Set pdf = Nothing
RunReport = False
End Function

When I run this code from VB-environment everything works fine.
Any ideas?