Printing a Report via SOAP Web Service
Posted: Tue Sep 03, 2013 11:10 am
Hi
I am using Window Mobile 6.5 terminals to communicate to a SOAP Web Service.
There is a requirement to print a "report" from the Web Service which is activated from the terminal.
So I have a Web service method;
[SoapDocumentMethod(OneWay=true)]
[WebMethod]
public void _custPrint_Assay()
{
clsTest c = new clsTest();
c.WriteLOG("Recieved Call");
c.PrintRpt();
c.Dispose();
}
..And my Print Function is...
public void PrintRpt()
{
try
{
_res = WriteLOG("Starting Report");
// CREATE A NEW REPORT INSTANCE
StiReport rpt = new StiReport();
StiConfig.IsWeb = true;
// LOAD REPORT
rpt.Load("report.mrt");
rpt.Render(false);
// PRINT REPORT
Stimulsoft.Report.Print.StiPrinterSettings _settings = new Stimulsoft.Report.Print.StiPrinterSettings();
_settings.PrinterName = "Canon Generic PCL6 Driver";
_settings.Copies = 1;
_res = WriteLOG("Printing");
rpt.Print(false);
_res = WriteLOG("Finished");
}
catch (System.Threading.ThreadAbortException)
{
_res = WriteLOG("Thread Aborted");
}
catch (Exception ex)
{
_res = WriteLOG("PrintRpt() - " + ex.Message);
}
}
I get the Log down to "Printing", then I get a "Thread Aborted" exception when it tries to print??
I am using Version 2012.2 and the report is a very basic A4 page with just a logo in the Page header, haven't gone much farther!
Any help would be appreciated
Thanks
Andy
I am using Window Mobile 6.5 terminals to communicate to a SOAP Web Service.
There is a requirement to print a "report" from the Web Service which is activated from the terminal.
So I have a Web service method;
[SoapDocumentMethod(OneWay=true)]
[WebMethod]
public void _custPrint_Assay()
{
clsTest c = new clsTest();
c.WriteLOG("Recieved Call");
c.PrintRpt();
c.Dispose();
}
..And my Print Function is...
public void PrintRpt()
{
try
{
_res = WriteLOG("Starting Report");
// CREATE A NEW REPORT INSTANCE
StiReport rpt = new StiReport();
StiConfig.IsWeb = true;
// LOAD REPORT
rpt.Load("report.mrt");
rpt.Render(false);
// PRINT REPORT
Stimulsoft.Report.Print.StiPrinterSettings _settings = new Stimulsoft.Report.Print.StiPrinterSettings();
_settings.PrinterName = "Canon Generic PCL6 Driver";
_settings.Copies = 1;
_res = WriteLOG("Printing");
rpt.Print(false);
_res = WriteLOG("Finished");
}
catch (System.Threading.ThreadAbortException)
{
_res = WriteLOG("Thread Aborted");
}
catch (Exception ex)
{
_res = WriteLOG("PrintRpt() - " + ex.Message);
}
}
I get the Log down to "Printing", then I get a "Thread Aborted" exception when it tries to print??
I am using Version 2012.2 and the report is a very basic A4 page with just a logo in the Page header, haven't gone much farther!
Any help would be appreciated
Thanks
Andy