独立可执行文件是否可以生成报告并将其输出为PDF(或报告查看器中提供的其他导出选项之一)而不显示ReportViewer控件?
报告定义应嵌入可执行文件中,不应使用Reporting Services Web服务.
实际上你根本不需要ReportViewer,你可以直接实例化并使用LocalReport:
LocalReport report = new LocalReport(); report.ReportPath = "templatepath"; // or use file from resource with report.ReportEmbeddedResource // add parameters, datasource, etc. Warning[] warnings; string[] streamids; string mimeType; string encoding; string filenameExtension; byte[] bytes; bytes =report.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings); // save byte[] to file with FileStream or something else