Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1330
Export multiple charts on the same page of PDF file
posted
We are using UltraWinChart control and looking for export to PDF functionalty. We want to export multiple charts on the same page of PDF file. Currently we are using following code lines to generate PDF file. This code shows charts on separate pages of PDF file. Please suggest us way to add other charts(or following UltraWinChart2) on the same page of PDF file.          Dim r As New Infragistics.Documents.Report.Report()         Dim g As Graphics = r.AddSection().AddCanvas().CreateGraphics()        UltraWinChart1.RenderPdfFriendlyGraphics(g)         g = r.AddSection().AddCanvas().CreateGraphics()        UltraWinChart2.RenderPdfFriendlyGraphics(g)         ' define a string that contains the path to        ' the current user's My Documents folder.        Dim myDocuments As String = _             System.Environment.GetFolderPath( _               System.Environment.SpecialFolder.MyDocuments)         ' Publish the report to the current user's         ' My Documents folder with the name of Report.pdf.        r.Publish(myDocuments + "\Report.pdf",                    Infragistics.Documents.Report.FileFormat.PDF)        System.Diagnostics.Process.Start((myDocuments + "\Report.pdf")) 
Parents
No Data
Reply
  • 26458
    Offline posted

    By adding multiple sections to the report, you're creating multiple pages. Use this logic instead:

    Dim r as new Report()
    Dim page as ISectionPage = r.AddSection().AddPage()
    Dim canvas1 as ICanvas = page.AddCanvas(0,0)
    Dim canvas2 as ICanvas = page.AddCanvas(0,200)

    Dim g as Graphics = canvas1.CreateGrahpics()
    chart1.RenderPdfFriendlyGraphics(g)
    g = canvas2.CreateGrahpics()
    chart2.RenderPdfFriendlyGraphics(g)

Children
No Data