license_shangha
请参考附件中示例,主要代码有:
- private void excelToolStripMenuItem_Click(object sender, EventArgs e)
- {
- DataDynamics.Reports.ReportDefinition _reportDef = new DataDynamics.Reports.ReportDefinition(new System.IO.FileInfo("Report1.rdlx"));
- DataDynamics.Reports.ReportRuntime _reportRuntime = new DataDynamics.Reports.ReportRuntime(_reportDef);
- string exportFile = System.IO.Path.GetTempFileName() + ".xls";
- System.IO.FileInfo myFile = new System.IO.FileInfo(exportFile);
- DataDynamics.Reports.Rendering.Excel.ExcelTransformationDevice _renderingExtension = new DataDynamics.Reports.Rendering.Excel.ExcelTransformationDevice();
- DataDynamics.Reports.Rendering.IO.FileStreamProvider _provider = new DataDynamics.Reports.Rendering.IO.FileStreamProvider(myFile.Directory, System.IO.Path.GetFileNameWithoutExtension(myFile.Name));
- _reportRuntime.Render(_renderingExtension, _provider);
- System.Diagnostics.Process.Start(exportFile);
- }
复制代码 |