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.

How to print and export multiple sfchart?

Thread ID:

Created:

Updated:

Platform:

Replies:

121814 Jan 27,2016 05:10 PM Mar 23,2016 06:31 AM WPF 5
loading
Tags: SfChart
Tomas Raziel Garza Amaya
Asked On January 27, 2016 05:10 PM

Hi,

I want to print and export the graphics, but I can save or print one sfchart only. How to save or print multiple of them at same time in one sheet?

Sumathi Jayaraj [Syncfusion]
Replied On January 28, 2016 03:41 AM

Hi Tomas,

Thanks for contacting Syncfusion support.

We are able to achieve your requirements by using PrintDialog as shown in the below sample code. We have prepared a sample and it can be downloaded from the following location.


Code example[C#]:

public void Print(Panel visual)

{

    //To print the visual using chart print dialog box

    ChartPrintDialog printDialog = new ChartPrintDialog();

    PrintingEventArgs args = new PrintingEventArgs() { PrintDialog = printDialog, PrintVisual = printDialog.GetPrintVisual(visual) };


    if (args.ShowPrintDialog)

    {

        bool retValue = (bool)printDialog.ShowPrintDialog(visual, Rect.Empty, visual.ActualHeight, visual.ActualWidth);

        Keyboard.Focus(visual);

    }


    else if (!args.CancelPrinting)

    {

        PrintDialog pd = new PrintDialog();

        pd.PrintVisual(visual, "Chart is printing");

    }


}


Sample : ExportChart

Alternatively, we can use multiplepanes to integrate all the charts into single one and we can use chart Print() functionality to export.

Regards,
Sumathi J

Tomas Raziel Garza Amaya
Replied On January 28, 2016 11:15 AM

Thank you for answer, the code ran, but I want to do the same with the save, how is the code?

Thanks for help.

Sumathi Jayaraj [Syncfusion]
Replied On January 29, 2016 05:18 AM

Hi Tomas,

Thanks for the update.

We are able to achieve your requirements by using RenderTargetBitmap. We have prepared a sample and it can be downloaded from the following location.

Sample : SaveAndPrint

Regards,
Sumathi J

David Fernandez Lopez
Replied On March 22, 2016 06:40 PM

Hi,

The proposed solution for printing multiple charts is not working if one of the chart's is a Pie or a Doughnut.

Regards

Sumathi Jayaraj [Syncfusion]
Replied On March 23, 2016 06:31 AM

Hi David,

We are unable to reproduce the problem(exporting multiple charts with pie series) at our end. We have attached a sample and if the problem still persist, then please provide the sample to reproduce the issue.  

Sample: ExportChart

Regards,
Sumathi J

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.

;