您好,FpSpread 5.0的老系统,调用SafePrint方法偶尔报错如下图。调用代码如下: WRetDBString oRet = new WRetDBString();
try
{
G_PrintInfo.Printer = cbPrinter.Text; //设置打印机
G_PrintInfo.Preview = false;
G_PrintInfo.JobName = sTitle; // "单据" + lBillId.ToString();
//开始正式打印
spdInfo.ActiveSheet.PrintInfo = G_PrintInfo;
spdInfo.Refresh();
var printcount = Convert.ToInt32(numPrintCount.Value);
if (SetPrintPost) printcount = 1;
for (int i = 0; i < printcount; i++)
{
//fpSpd.PrintSheet(0);
spdInfo.SafePrint(spdInfo, 0); //采用这样的打印方法,避免了外部循环调用显示打印预览的问题。
}
}
catch (Exception err)
{
oRet.ErrCode = "-1";
oRet.ZhErrMsg = err.ToString();//.Message;
}
return oRet;
|
|