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

How to print and export multiple sfchart?

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?

5 Replies

SJ Sumathi Jayaraj Syncfusion Team January 28, 2016 08:41 AM UTC

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


TR Tomas Raziel Garza Amaya January 28, 2016 04:15 PM UTC

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

Thanks for help.


SJ Sumathi Jayaraj Syncfusion Team January 29, 2016 10:18 AM UTC

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


DF David Fernandez Lopez March 22, 2016 10:40 PM UTC

Hi,

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

Regards


SJ Sumathi Jayaraj Syncfusion Team March 23, 2016 10:31 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon