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. Image for the cookie policy date
close icon

About print

The Chart control provides built-in support context menu which allows the user to print and save the chart.
[C#]
this.ChartWebControl1.ShowContextMenu = true;
this.ChartWebControl1.ShowToolBar = true;

I have a question that if we can call the api function from the print function on the toolbar to print the chart?

Thanks!


5 Replies

JA Jack December 11, 2007 01:46 PM UTC

I don't want the toolbar displayed and I only want to print the chart.



RS Rajarajeswari S Syncfusion Team December 14, 2007 07:52 AM UTC


Hi Lio,

Sorry, you can print the chart only through the print option available on the Toolbar. It is not possible to print he chart without having the Toolbar.

Please let me know if you have any other concerns.

Regards,
Raji




J. J.Nagarajan Syncfusion Team December 14, 2007 10:42 PM UTC

Hi Lio ,

You can print the document without showing the Chart toolbar. You can use the PrintDialog and assign the ChartPrintDocument to it. Please refer to the following code snippet.

[C#]

private System.Windows.Forms.PrintDialog printDialog1;
printDialog1.Document = this.chartControl1.PrintDocument;
if (printDialog1.ShowDialog() == DialogResult.OK)
{
this.chartControl1.PrintColorMode = ChartPrintColorMode.Color;
this.chartControl1.PrintDocument.Print();
}


Please refer to the attached sample that demonstrates this completely.

http://websamples.syncfusion.com/samples/Chart.Windows/F70433/main.htm

I hope this will meet your requirement. Please feel free to contact us if you have any other concerns. We will be glad to assist you.

Thanks,
Nagaraj



RS Rajarajeswari S Syncfusion Team December 15, 2007 09:59 AM UTC


Hi Lio,

In Chare web you can print the chart without using the Tool bar by using the below code snippet:

Size chartSize = new Size((int)Math.Ceiling(this.ChartWebControl1.Width.Value),
(int)Math.Ceiling(this.ChartWebControl1.Height.Value));
Bitmap bmp = new Bitmap(chartSize.Width, chartSize.Height);
ResourceHolder printHohlder = new ResourceHolder(this.Page);
ImageResourceInfo iri = new ImageResourceInfo(bmp, ImageFormat.Png, this.ChartWebControl1.Parent.ID);

this.ChartWebControl1.Draw(bmp);
printHohlder.AddResource(iri);

ChartUtils.PrintImageOnClient(this.Page, printHohlder.GetResourceUrl(iri));


Please have a look at the sample from the below link which illustrates the above:

http://websamples.syncfusion.com/samples/Chart.Web/5.2.0.25/F70433/main.htm


Please let me know if this helps you out.

Regards,
Raji




JA Jack December 17, 2007 04:23 AM UTC

Thanks!


Loader.
Live Chat Icon For mobile
Up arrow icon