日期:2014-05-17 浏览次数:20525 次
ReportDocument rpt = new ReportDocument();
rpt.Load(reportpath);
rpt.SetDataSource(dt);
cryview.ReportSource = rpt;
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
rpt.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
string filepath = "";
rpt.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
filepath = HttpContext.Current.Server.MapPath("~/administrators/dataset/" + app + ".pdf");
diskOpts.DiskFileName = filepath;
rpt.ExportOptions.ExportDestinationOptions = diskOpts;
rpt.Export();