Data Dynamics Reports Support

Started by Parthi at 03-07-2010 10:27 PM. Topic has 1 replies.

Print Search Rate
Sort Posts:    
   03-07-2010, 10:27 PM
Parthi is not online. Last active: 10/11/2011 4:43:03 PM Parthi

Top 500 Posts
Joined on 09-30-2009
Bangalore
Posts 33
Export to Excel in C#
Hi,

I am using Data Dynamics Reports Version : 1.6.1588.0.
I am able to export the Report to excel through DataDynamics.
But i am not able to export the Reports to Excel through C#.
Is there a way to achieve this?
Do sent me some sample Reports for the above requirements.

Thanks
parthi

   Report 
   03-08-2010, 6:29 AM
Amit Pal is not online. Last active: 2/7/2012 10:11:10 PM Amit Pal

Top 25 Posts
Joined on 12-11-2008
Posts 855

DDStaff
Re: Export to Excel in C#

Attachment: RenderToExcel.zip
Parthi,

You may use following code snippet to render the report to excel via code:

//Load the RDLX in the Report Definition
DataDynamics.Reports.ReportDefinition _reportDef = new DataDynamics.Reports.ReportDefinition(new System.IO.FileInfo(Application.StartupPath + @"..\..\..\Report1.rdlx"));
//Load the Report Definition in the Report Runtime
DataDynamics.Reports.ReportRuntime _reportRuntime = new DataDynamics.Reports.ReportRuntime(_reportDef);
string exportFile = System.IO.Path.GetTempFileName() + ".xls";
//Create a new FileInfo object
System.IO.FileInfo myFile = new System.IO.FileInfo(exportFile);
//Create an onject of ExcelTransformationDevice
DataDynamics.Reports.Rendering.Excel.ExcelTransformationDevice _renderingExtension = new DataDynamics.Reports.Rendering.Excel.ExcelTransformationDevice();
//Create an object of FileStreamProvider
DataDynamics.Reports.Rendering.IO.FileStreamProvider _provider=new DataDynamics.Reports.Rendering.IO.FileStreamProvider(myFile.Directory, System.IO.Path.GetFileNameWithoutExtension(myFile.Name));
//Render the report to the ExcelTransformationDevice Object
_reportRuntime.Render(_renderingExtension, _provider);
//Open the rendered report in Excel
System.Diagnostics.Process.Start(exportFile);

Also find attached a sample application in which I have implemented the desired functionality.
Amit Pal
GrapeCity- DataDynamics
   Report 
GrapeCity » Product Support » Data Dynamics R... » Export to Excel in C#

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.