我有一个奇怪的问题。我的打印文档出现在printprieviewdialoge中,但在点击打印图标后,我得到了打印机的空白纸张。 PrintPriviewDialoge有问题吗? 如果我在进入showdialog之前将文件发送到打印机,它可以工作,但是在showdialog不打印之后。
for (int i = 0; i < caixasFiscais.Count; i++)
{
CaixaECF caixa = new CaixaECF(loja, caixasFiscais[i], data1, data2);
posicaoDaLinha = margemSup + (linhaAtual * Convert.ToInt32(fonteNormal.GetHeight(e.Graphics)));
e.Graphics.DrawLine(new Pen(Brushes.LightSteelBlue, 30), margemEsq, posicaoDaLinha, margemDir, posicaoDaLinha);
e.Graphics.DrawString("CAIXA FISCAL " + caixa.numero, fonteNegrito, Brushes.Black, margemEsq, (posicaoDaLinha - 5.5f), new StringFormat());
e.Graphics.DrawString("CREDITOS", fonteNegrito, Brushes.Black, margemEsq + 150, (posicaoDaLinha - 5.5f), new StringFormat());
e.Graphics.DrawString("DEBITOS", fonteNegrito, Brushes.Black, margemEsq + 350, (posicaoDaLinha - 5.5f), new StringFormat());
e.Graphics.DrawString("GAVETA", fonteNegrito, Brushes.Black, margemEsq + 550, (posicaoDaLinha - 5.5f), new StringFormat());
linhaAtual++;}
我也尝试保存为pdf文件,但同样没有保存数据。但printpreviewdialog显示绝对好的报告。