Printing a Report via SOAP Web Service

Stimulsoft Reports.WEB discussion
Post Reply
kelgray
Posts: 2
Joined: Wed Jan 30, 2013 11:26 am

Printing a Report via SOAP Web Service

Post by kelgray »

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
kelgray
Posts: 2
Joined: Wed Jan 30, 2013 11:26 am

Re: Printing a Report via SOAP Web Service

Post by kelgray »

Hi

My Bad, I didn't realise that writing a "Log" file to the bin folder of a Web service, causes the IIS application pool to stop!!! :oops:
(The wonders of google)

The report now works a treat

Apologies

Andy
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Printing a Report via SOAP Web Service

Post by Andrew »

Dear Andy,

I am happy you solved your issue yourself.

Have a nice day!
Thank you.
Post Reply