问题
Now I am working with asp.net and C#.
I use ActiveReports for reporting in my system.
I have tried to print my report with showing preview (I mean I don't use WebViewer to preview the report and I print the report directly).
MyAR1 rptMyreport = new MyAR1();
DataTable dtMydata = new DataTable();
//add some data in dtMydata
rptMyreport .DataSource = dtMydata;
if (rptMyreport .Document.Printer.PrinterSettings.IsValid)
{
try
{
rptMyreport .Run();
rptMyreport .Document.Print(false, false, false);
}
catch (Exception)
{
// do something
}
}
else
{
//show Error Message
}
My problem is ...
When I print this report , it works at server site printer and not work in client site printer. i.e ( I am working at 4th floor and server is at 10th floor . When I print the report . It is printed by the server site printer at 10th floor . ) What can I do to print the report at the printer which was the client PC connected.
With Regards,
回答1:
The C# code you are running above is actually running on the server so that is why the Server's printer is the one receiving the print job. However, you want the client machine -the one with the web browser- to receive the print job. To do that we provide several options, but the best one is described step-by-step in the documentation under the help topic Provide One-Touch Printing in the WebViewer (Pro Edition). This will cause the printing to happen from the machine that is using the Web Browser and not the server.
You can use other viewer types other than Flash but there are limitations imposed by the browser to force the print dialogs to appear (to prevent web pages from randomly printing without consent). More information about the available options and limitations is described in the help topic Web Viewer Print Options.
来源:https://stackoverflow.com/questions/11322192/printing-at-client-printer-by-using-activereport