/// <summary> /// 显示pdf /// </summary> /// <param name="al"></param> private void ShowNewPdf(object o) { while (!this.IsHandleCreated) { ; } this.Invoke(new Action(() => { ArrayList al = o as ArrayList; pbLoad.Visible = true; pbLoad.Minimum = 0; pbLoad.Maximum = al.Count; pbLoad.Value = 0; XtraReport report = new VehicleInfoReportZNCH(al[0]); report.CreateDocument(); pbLoad.Value = 1; for (int i = 1; i < al.Count; i++) { XtraReport report2 = new VehicleInfoReportZNCH(al[i]); report2.Landscape = false; //纵向 report2.PrintingSystem.ContinuousPageNumbering = true; report2.CreateDocument(); report.Pages.AddRange(report2.Pages); pbLoad.Value = i + 1; } documentViewer1.DocumentSource = report;//指定文档源 xtraReport = report; pbLoad.Visible = false; } )); }
private void PrintOnePage(object o) { XtraReport report = new VehicleInfoReportZNCH(o); report.CreateDocument(); report.Print(); }