We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Creating a report with multiple graphs

Thread ID:

Created:

Updated:

Platform:

Replies:

97895 Jan 18,2011 11:54 AM Jan 26,2011 12:50 AM Windows Forms 4
loading
Tags: Chart
Leïla Benakezouh
Asked On January 18, 2011 11:54 AM

My application displays multiple Tab Controls on each tab page can contain many graphs.

I need to provide the end-user the capability to generate reports (MS Word, Power Point,excel). My graphs are added to the appropriate report type among other data (spreadsheets, text, etc.).
The previous version of the application was drawing the graphs on a picture box. It was easy to get the image from the picture Box and to add it the the report. Now that I use the Syncfusion graphs instead, the only way I see is to export the graph as an image and then, to add it to the report.

This solution is far from being satisfactory.On some computers, we may don't have the right to save and in all the cases, it is "dirty" to save multiple pictures and then, to delete them.

I have almost the same problem when I print/print preview a graph into a document that encapsulates other data (header, explanation about the graph, footer. In a previous post, you told that it was not possible to do it in another way but at least, when I print, I do it for one graph at the same time. For the report, I need to export many graphs and I don't like this solution.

Is there another way to add the graphics to a report or a print document?

Thank you in advance.





Leïla Benakezouh
Replied On January 21, 2011 07:56 AM

Hi?

Do you have any advice for me concerning my problem ? any solution ?

Because I first add the graphics to the clipboard and then, I paste them on the appropriate report (PPT, Word, etc.), I thought that I could use the same code used by the graphics Toolbar item that allow the users to copy the chart to the clipboard (without any export/save).

Can you explain to me the code behind the Toolbar Item "Copy"?

Thank you.


Vijayabharathi K [Syncfusion]
Replied On January 21, 2011 08:44 AM

Hi Leila,

We are extremely sorry for the inconvenience caused

For this issue, we are unable to copy the chart image to clipboard because the “SaveImage” property of chart control only has String parameter. If we copy the chart by stream object, we can resolve your issue. But currently, we do not provide support to save & copy the chart image in stream obj. Already we have logged this feature in Feature Request

We will implement this feature in our forthcoming new version releases or service pack releases. The feature implementation
would also greatly depend on the factors such as product design, code compatibility and complexity. We will get back to you once the feature is implemented.

Could you please open the new incident in Direct-Trac for better follow-up this feature?

Thanks for using Syncfusion products.

Regards,
Vijayabharathi K



Leïla Benakezouh
Replied On January 24, 2011 05:48 AM

Thank you for your answer.

Does this mean that even the Copy/Print/preview features available from the graphics toolbar export physically the graphic on the disk before it is pasted/printed or previewed ?

I f yes the, I will keep saving the graphic waiting for this feature to be improved by you.

Best regards


Vijayabharathi K [Syncfusion]
Replied On January 26, 2011 12:50 AM

Hi Leila,

Thanks for the update and sorry for the delay to update the solution.

We can able to copy the chart control image to clipboard and then assigning the clipboard chart image to picture box. Kindly find the code snippet below to achieve this,

[C#]

private void Form1_Load(object sender, EventArgs e)
{
Image img = new Bitmap(this.chartControl1.Width, this.chartControl1.Height);
this.chartControl1.Draw(img);
Clipboard.SetDataObject(img); // Copy the chart image to Clipboard
}
private void Copy_FromClipboard_Click(object sender, EventArgs e)
{
this.pictureBox1.Image = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap); // Paste the chart image to picture box
}

Please refer the attached sample for this solution

Regards,
Vijayabharathi K





SampleClipboardChart_3e01e61f.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;