Crystal and permissions

G

Guest

In mine webapp I'm using the following code to generate a PDF and show it in
the browser:
private Reports.repZipRequest crReportDocument;
crReportDocument = new Reports.repZipRequest();
System.IO.MemoryStream ReportStream =
(System.IO.MemoryStream)crReportDocument.ExportToStream(
ExportFormatType.PortableDocFormat);
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.BinaryWrite(ReportStream.ToArray());
Response.End();

and I use the following code to print a report directly to a network printer:
private Reports.repZipRequest crReportDocument;
crReportDocument = new Reports.repZipRequest();
crReportDocument.PrintOptions.PrinterName = @"\\SERVER\PRINTERNAME";
crReportDocument.PrintToPrinter(1, true, 0, 0);

The first code works well but the second gives an error (Error in file
c:\.....: request cancelled by user.".

I've read that I have to edit the machine.config and change
username="machine" into username="SYSTEM" (<ProcessModel> tag). When I do
that, code 2 works and the report is printed, but code1 doesn't work anymore.

Please help. Anyone any idea?

Edward
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top