C
CsaaGuy
I get OS errors when I run active reports from code.
The first error is with this code (beware of the commented out code)
Dim oPrinter As New System.Drawing.Printing.PrintDocument
oPrinter.PrinterSettings.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
Dim oReport As New Report01
'oReport.Document.Printer.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
oReport.ds.SQL = "Select * from tblAssignments, tblUsers where
ClaimNumber = '08-M63254-4' and tblUsers.UserID =
tblAssignments.AdjusterId"
oReport.ds.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStringTLW")
oReport.Run()
oReport.Document.Print(False, False)
I get this error:
An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
Unknown Module.
Additional information: The type
System.Drawing.Printing.InvalidPrinterException in Assembly
System.Drawing, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable.
If i run it with this code (beware of the commented out code)
'Dim oPrinter As New System.Drawing.Printing.PrintDocument
'oPrinter.PrinterSettings.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
Dim oReport As New Report01
oReport.Document.Printer.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
oReport.ds.SQL = "Select * from tblAssignments, tblUsers where
ClaimNumber = '08-M63254-4' and tblUsers.UserID =
tblAssignments.AdjusterId"
oReport.ds.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStringTLW")
oReport.Run()
oReport.Document.Print(False, False)
I get this error:
An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in Unknown Module.
Additional information: The RPC server is unavailable
As a Note, the report works in the webviewer.
Thanks.
The first error is with this code (beware of the commented out code)
Dim oPrinter As New System.Drawing.Printing.PrintDocument
oPrinter.PrinterSettings.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
Dim oReport As New Report01
'oReport.Document.Printer.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
oReport.ds.SQL = "Select * from tblAssignments, tblUsers where
ClaimNumber = '08-M63254-4' and tblUsers.UserID =
tblAssignments.AdjusterId"
oReport.ds.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStringTLW")
oReport.Run()
oReport.Document.Print(False, False)
I get this error:
An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
Unknown Module.
Additional information: The type
System.Drawing.Printing.InvalidPrinterException in Assembly
System.Drawing, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable.
If i run it with this code (beware of the commented out code)
'Dim oPrinter As New System.Drawing.Printing.PrintDocument
'oPrinter.PrinterSettings.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
Dim oReport As New Report01
oReport.Document.Printer.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01"
oReport.ds.SQL = "Select * from tblAssignments, tblUsers where
ClaimNumber = '08-M63254-4' and tblUsers.UserID =
tblAssignments.AdjusterId"
oReport.ds.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStringTLW")
oReport.Run()
oReport.Document.Print(False, False)
I get this error:
An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in Unknown Module.
Additional information: The RPC server is unavailable
As a Note, the report works in the webviewer.
Thanks.