I perform printing on a spread using the following:
PrintInfo printset = new PrintInfo();
printset.PrintToPdf = true;
printset.PdfFileName = pdfFileName;
foreach (SheetView sheet in mySpread.Sheets)
{
sheet.PrintInfo = printset;
mySpread.PrintSheet(sheet);
}
If I have a network printer attached that for some reason I can't access (server down, wrong username/pw, etc) then it appears a background thread is throwing a Win32Exception with the message "The RPC server is unavailable". I don't believe this to be an issue with Spreads persay, but the only solution I've found is by creating a class that inherits from PrintDocument and overloading some functions.
Here is the stack trace of the exception:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at FarPoint.Win.Spread.FpSpread.q()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
And here is a thread with how to handle this Exception by overloading methods:
http://www.dotnetmonster.com/Uwe/Forum.aspx/winform/16852/PrintPreviewDialog-and-Win32Exception-The-RPC-server-is-unavailab
Is this a problem already potentially handled in Spreads, and if not is there a way I can reach to that low level of printing?