Click here to Skip to main content
15,667,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
private void frmRptInvoice_Load(object sender, EventArgs e)

            ReportDocument cryRpt = new ReportDocument();
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables CrTables;
            crConnectionInfo.ServerName = "GILBERT-PC";
            crConnectionInfo.DatabaseName = "dbAutorec";
            crConnectionInfo.UserID = "sa";
            crConnectionInfo.Password = "newgt";

            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;

            crystalReportViewer1.ReportSource = cryRpt;

            cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, "catalogueReport.pdf");
            //Preview the generated PDF
            System.Diagnostics.Process.Start(Application.StartupPath + "\\catalogueReport.pdf");
ZurdoDev 6-Oct-14 10:41am    
What exactly is your question?
Gilbertinino 6-Oct-14 10:45am    
I need to export my report to Notepad, I mean exporting a crystal report to Notepad instead of PDF.

1 solution

Just use intellisense and see what other options are available on ExportFormatType.

See[^] for various options.
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