Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
export to pdf file
posted

Hi;

 I am writing the following code to export my chart to a pdf file, the problem is once it executes to the line:

               this.ultraChart1.RenderPdfFriendlyGraphics(g);

 It stucks, and can not continue, can u help me figure out which part is wrong?

thanks ...

 

The codes are the following, ultrabutton1 is for pdf file export:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Infragistics.Documents.Report;

 

private void ultraButton1_Click(object sender, EventArgs e)

{


//Create a new report
Infragistics.Documents.Report.Report r =
  new Infragistics.Documents.Report.Report();

Graphics g = r.AddSection().AddCanvas().CreateGraphics();
ultraChart1.RenderPdfFriendlyGraphics(g);

//Define a string that contains the path to
// the current user's My Documents folder.


string myDocuments =
  System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);

// Publish the report to the current user's
// My Documents folder with the name of Report.pdf.


r.Publish(myDocuments + "\\Report.pdf", FileFormat.PDF);

}

Parents
No Data
Reply
  • 195
    posted

    Hi,

    Later yesterday I found it's caused by too much points on my scatter chart. My chart has 15000 points need to be draw. The problem is even I reduce it to 150 points, it still takes almost an minute to get the pdf file.

    Is there any solution that can speed up the pdf generation, I mean any code settings that can speed it up?

    thanks ...

Children