Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
ffttt
Home
>>
Forum
>>
C#
>>
Post New Question
Subscribe to Forum
how to export crystal report in pdf file by default using C#
Posted By:
Naim Khan
Posted Date:
May 20, 2010
Points:
2
Category :
C#
hi friends,
we are using the crystal reports that comes with Visual studio 2005 for developing a c# windows application. we need to make the pdf the default export format for report. can anyone tell me how this can be done.
Thanks
Naim Khan
Responses
Author:
Lalij Mer
Posted Date: May 20, 2010 Points: 5
you can try this code sample
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());
}
}
}
}
For Reference
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-export-pdf.htm
Please Check my answer if you help....
Thank You...
Lalit.
Author:
BangaruBabuPureti
Posted Date: May 22, 2010 Points: 5
Hi Khan ,There is no need to Write manual coding to export PDF Document if u Place Crystal Report Viewer
it will automatically Populate PDF WIth Left Side icons
BangaruBabu Pureti
http://bangarubabupureti.spaces.live.com/
Author:
arronlee
Posted Date: October 17, 2015 Points: 20
Hi Khan,
I wonder how can I deal with those codes? Do I need another pdf conversion sdk like this one?
http://www.pqscan.com/pdf-to-image/
Next Tomorrow is Another Day
.
Post Reply
You must
Sign In
To post reply
Related Questions Related Questions
how to export crystal report to pdf
Is it possible to generate word file in Crystal Report using Asp.net..?
How to insert picture in crystal report from image file
How to change CrstalReport Database in Crystal Report
Crystal Report Problem
How to export datagridview data to excel file
crystal report in windows application..
Crystal Report Display Problem
crystal report function
how to add Crystal report in c#.net 2008
Latest Forum Questions From The Same Category
To Achieve draw wave form from speaker outputs.
How to display the text in the second ck editor with strikes while extracting from database
Mail is working but I want send two excel file to each different person
how to display child nodes with headers and keeping the child nodes in a table
In DataGrid I have Two Dropdownlist, One in Header template and Item Template
Display data directly from database table to PDF using stored procedures in asp.net C#
How to install and use Dev Express ?
Dialogbox Custom Control
Custom Control in Winforms
I just started learning c#.net console application
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend