.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

To export from a report to pdf

Posted By: Chandranshu Awasthi     Posted Date: June 13, 2011    Points:5   Category :C#
hi

i have a window application which has some reports , now i have to export the data of report into pdf format can anyone please help me

thank you

Responses
Author: vinay             
Posted Date: June 13, 2011     Points: 20   

Hi Friend It is better to use crystal reports
to export data to pdf,xl,msword
thanQ

Author: Gowthammanju             
Posted Date: June 13, 2011     Points: 20   

Hey kindly look through the folloeing article

http://www.dotnetspark.com/kb/4175-pdf-converter-asp-net.aspx

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Gowthammanju             
Posted Date: June 13, 2011     Points: 20   

Hey use the following code for generating pdf through crystal reports!

using System;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
ReportDocument cryRpt;

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
cryRpt = new ReportDocument();
cryRpt.Load(PUT CRYSTAL REPORT PATH HERE\\CrystalReport1.rpt");
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
}

private void button2_Click(object sender, EventArgs e)
{
try
{
ExportOptions CrExportOptions ;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net-informations.pdf";
CrExportOptions = cryRpt.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
cryRpt.Export();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}


Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: shiv chandra             
Posted Date: June 18, 2011     Points: 20   

ReportViewer itself provide button for export report.

Regards
Shiva


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend