Click here to Skip to main content
15,867,873 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hai all,

In my application, I need to export the crystal report in to pdf format after showing the report in Crystal report viewer...

I know that There is a button(Export Button) in Crystal report viewer.. Using this,User can export the report in to pdf(by changing the 'save as type'...).

But when the user clicks the export button in crystal report viewer
a save file dialog is opening with default 'save as type' as .rpt(Crystal Reports) format...

I need to change this default format from .rpt to .pdf(Adobe Acrobat)... Is this possible...?

If possible,then How...?

please help...?

Thanks in advance...
Posted
Updated 14-Jun-11 23:27pm
v3

try this links
http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/2e6ba358-d88c-4e4f-8b93-f3ae92baeec1[^]
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-export-pdf.htm[^]

C#
private void btnExport_Click(object sender, EventArgs e)
        {

           SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.SpecialFolder.MyDocuments.ToString();
            saveFileDialog.Filter = "Document (*.pdf)|*.PDF";
            saveFileDialog.FilterIndex = 1;
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
               
                Report.ExportToDisk(ExportFormatType.PortableDocFormat, saveFileDialog.FileName);;
            }
}
 
Share this answer
 
v2
Comments
version_2.0 15-Jun-11 5:25am    
not that...

I need to change default format from .rpt to .pdf of 'Save file Dialog' which is opening when the user clicks the Export button in Crystal report viewer...
ambarishtv 15-Jun-11 5:35am    
update my answer.
version_2.0 15-Jun-11 5:36am    
My vote of 5... Thanks...
This will also help

Link[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900