Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Active Reports

Reply
Thread Tools

Active Reports

 
 
CsaaGuy
Guest
Posts: n/a
 
      08-17-2005
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.

 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      08-17-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.
>



 
Reply With Quote
 
 
 
 
CsaaGuy
Guest
Posts: n/a
 
      08-17-2005

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?

 
Reply With Quote
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      08-17-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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?
>



 
Reply With Quote
 
CsaaGuy
Guest
Posts: n/a
 
      08-18-2005
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) 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?
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems using ASP and Crystal Reports 8.5 to create dynamic PDF reports PughDR@gmail.com ASP General 0 10-23-2006 02:50 PM
Is it possible to get Crystal Reports to print multiple reports in ASP.NET? Rod ASP .Net 2 05-25-2006 02:12 PM
How to launch reports (done with Crystal Reports) from a Java application? minjie@excite.com Java 2 03-15-2006 08:40 PM
Calling Crystal Reports in ASP.NET using the rptserver.asp given by Crystal Reports Peri ASP .Net 1 07-21-2005 12:56 PM
Displaying Microsoft Access Reports (active reports) via ASP.NET Brian Barnes ASP .Net 1 02-18-2004 05:59 AM



Advertisments