473,472 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Active Reports

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("ConnectionStrin gTLW")
oReport.Run()
oReport.Document.Print(False, False)

I get this error:

An unhandled exception of type
'System.Runtime.Serialization.SerializationExcepti on' 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("ConnectionStrin gTLW")
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.

Nov 19 '05 #1
4 4924
By default ASP.NET runs under the ASPNET user account, which has limited
permissions. Specifically, this account does not have access to any
printers. All the errors you recieved are related to this fact. Therefore
you'll likely have better luck using impersonation to have ASP.NET run under
another account.

Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"CsaaGuy" <ro********@csaa.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
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("ConnectionStrin gTLW")
oReport.Run()
oReport.Document.Print(False, False)

I get this error:

An unhandled exception of type
'System.Runtime.Serialization.SerializationExcepti on' 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("ConnectionStrin gTLW")
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.

Nov 19 '05 #2

Steve C. Orr [MVP, MCSD] wrote:
By default ASP.NET runs under the ASPNET user account, which has limited
permissions. Specifically, this account does not have access to any
printers. All the errors you recieved are related to this fact. Therefore
you'll likely have better luck using impersonation to have ASP.NET run under
another account.

Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

It does some and thanks. I curious, why does it run from the web viewer?

Nov 19 '05 #3
The web viewer sounds like a client side component, and the client does have
access to the printer.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"CsaaGuy" <ro********@csaa.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...

Steve C. Orr [MVP, MCSD] wrote:
By default ASP.NET runs under the ASPNET user account, which has limited
permissions. Specifically, this account does not have access to any
printers. All the errors you recieved are related to this fact.
Therefore
you'll likely have better luck using impersonation to have ASP.NET run
under
another account.

Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

It does some and thanks. I curious, why does it run from the web viewer?

Nov 19 '05 #4
Ah, thats it. Its an Activex Report Viewer. Thank you again.
Steve C. Orr [MVP, MCSD] wrote:
The web viewer sounds like a client side component, and the client does have
access to the printer.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"CsaaGuy" <ro********@csaa.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...

Steve C. Orr [MVP, MCSD] wrote:
By default ASP.NET runs under the ASPNET user account, which has limited
permissions. Specifically, this account does not have access to any
printers. All the errors you recieved are related to this fact.
Therefore
you'll likely have better luck using impersonation to have ASP.NET run
under
another account.

Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

It does some and thanks. I curious, why does it run from the web viewer?


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: laj | last post by:
HI, Excuse this new question, I am trying to impress my wife by putting a db together for her dance studio. I put a table with all students new and old with fields including name and address and...
0
by: Stephen Cairns | last post by:
I am using Active Reports for .Net to produce reports which are displayed in aspx pages in the browser window. I have a problem though displaying parts of my reports in the browser windows. Does...
1
by: Brian Barnes | last post by:
I've been searching using google trying to find a way to display Access Reports via ASP.NET and only finding commericial products which appear to require that the report needs to be converted every...
3
by: mehul | last post by:
Hi, I am trying to use Active Reports v1.1 (Build 1.1.0.84) in a ASP.NET application. Is it possible to use it through the COM interlop as Crystal Reports for .NET which comes built in with...
0
by: CsaaGuy | last post by:
Hi, I am using Active Reports and when a report is run, i need to point the report to a specific printer and tray. I tried this by setting the selected report properties however it didn't do...
0
by: Enver A | last post by:
Hi There, I am having difficulties on using Active Reports on vb.net . I have succesfully tried and executed designing and printing a report but what i am trying to do is to design an End-User...
1
by: ATroy | last post by:
Hello! So far, I can't find any information on making a connection to active directory for reports in visual studio .net 2003. From the list of Available Data Sources I select "OLE DB (ADO)"...
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
4
by: lawazia | last post by:
I am doing a project in which I have to create INVOICE reports I am using VB6 and Active reports. I am facing problem while creating a multipage invoice report. If the invoice report generated...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.