Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
| Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 3rd, 2005, 11:49 PM
Registered User
 
Join Date: Oct 2005
Location: Delhi, Delhi, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem in Exporting Crystal report to PDF

Hi Everyone!

I m really stuck with Crystal reports for VS.NET 2003:(:(. I have created a report using DataSet and now trying to export report to PDF.It exports report to PDF but with Blank fields.However there is data in the report.I have tried each and every thing.Its completion of reporting module and i have to give it functionality to Export to desired format.

Heres my code for exporting report
Code:
private void Button3_Click(object sender, System.EventArgs e)  // this is the code for exporting REport to desired format
        {


        this.fileName = Server.MapPath("/NewQCDS/Project/ReportsFile/test.pdf");   // this is destination file
        string strrptfile=Server.MapPath("/NewQCDS/Reports/rptAllocatedEmployee.rpt").ToString();   // rpt file       

        this.crDiskFileDestinationOptions = new DiskFileDestinationOptions();
        this.crDiskFileDestinationOptions.DiskFileName = this.fileName;


                            rpt.SetDataSource(objReportForm.fnGetRptAllocatedEmployee(int.Parse(Request.QueryString["ProjectID"].ToString()),int.Parse(Request.QueryString["Cmonth"].ToString()),int.Parse(Request.QueryString["ProjectID"].ToString())));

                            this.crExportOptions = this.rpt.ExportOptions;                 

                            this.crExportOptions.DestinationOptions = this.crDiskFileDestinationOptions;

                            this.crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;

                            this.crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;




            if(rpt.IsLoaded==true)
            {

                this.rpt.Export();
            }                 



                            Response.ClearContent();
                            Response.ClearHeaders();
                            Response.ContentType = "application/pdf";

                            Response.WriteFile(this.fileName);

                            Response.Flush();

                            Response.Close();


        }
    }
}


Please some one help me on this.

Thanks in advance,

Regards

cat_net




Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in exporting crystal report to excel. yasinirshad .NET Framework 1.x 0 June 11th, 2008 02:20 AM
Code for Exporting Crystal Report to Excel or PDF shakti_2505270 ASP.NET 2.0 Professional 1 October 4th, 2007 01:00 AM
Exporting Crystal Report to PDF vishal.jayaswal .NET Web Services 0 December 30th, 2004 03:31 AM
Exporting Crystal Report 6 RPT file into PDF forma ravs1304 Crystal Reports 2 December 29th, 2004 12:48 PM
Crystal Report 8.5 Export to PDF problem DragonSon Crystal Reports 0 August 17th, 2004 10:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.