winform 5.0 spread 打印时提示"未将对象引用设置到对象的实例",程序如下
PrintInfo pi = new PrintInfo();
pi.PrintType = PrintType.All;
pi.ShowColumnHeaders = false;
pi.ShowRowHeaders = false;
pi.ShowGrid = false;
pi.ShowBorder = false;
pi.ShowShadows = false;
pi.ShowColor = false;
pi.UseMax = true;
pi.BestFitCols = false;
pi.Preview = false;
for (int i = 0; i < 5; i++)
{
fpSpread1.Sheets[0].PrintInfo = pi;
fpSpread1.PrintSheet(0);
}
第一次可以打印,其它后面四次都提示“未将对象引用设置到对象的实例”,如何解决? |
|