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.

About print

Thread ID:

Created:

Updated:

Platform:

Replies:

70433 Dec 11,2007 08:28 AM Dec 16,2007 11:23 PM ASP.NET Web Forms (Classic) 5
loading
Tags: Chart
Jack
Asked On December 11, 2007 08:28 AM

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!


Jack
Replied On December 11, 2007 08:46 AM

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


Rajarajeswari S [Syncfusion]
Replied On December 14, 2007 02:52 AM


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.Nagarajan [Syncfusion]
Replied On December 14, 2007 05:42 PM

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


Rajarajeswari S [Syncfusion]
Replied On December 15, 2007 04:59 AM


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



Jack
Replied On December 16, 2007 11:23 PM

Thanks!


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.

;