我已将以下代码用于打印按钮:
Data.str = null;
//Data.str = textBox24.Text.ToString();
string s = "select * from temp_bond";
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\Real.mdb";
cn.Open();
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(s, cn);
ds.Clear();
da.Fill(ds);
Bond rpt = new Bond();
rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "BOND_" + Data.str + ".pdf");
System.Diagnostics.Process.Start("BOND_" + Data.str + ".pdf");
//r.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "E:\\rep.pdf");
//crystalReportViewer1.ReportSource = r;
OleDbCommand cm1 = new OleDbCommand("delete * from temp_bond", cn);
cm1.ExecuteNonQuery();
cn.Close();
我在这段代码中遇到错误:
rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "BOND_" + Data.str + ".pdf");
错误是:
页眉和页脚对于页面来说太大了。文件 C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\temp_3f674868-8e5d-46ce-80eb-dce78bb2ba89 {17674136-B71E-4C6F-9E36-1CEB514B13BF}.rpt 中的错误:页眉或页脚长于页。
什么可能导致这种情况,我该如何解决?