I've a problem with exporting the UC to a PDF or XPS format.
Problem is that while the export goes well, the chart is not scaled, since only a percentage is displayed.
The chart is being cut on the right, again, there is no auto scaling.
Any ideas are welcomed and needed asap!
Here is my code :
Dim ReportName_PDF As String = App_Path + "\Reports\Graph_1.pdf"
Dim ReportName_XPS As String = App_Path + "\Reports\Graph_1.xps"
Me.UltraChart_Parameters.RenderPdfFriendlyGraphics(Report_Graphics)
Case "XPS"
Case "PDF"
System.Diagnostics.Process.Start((ReportName_PDF))
Am i doing wrong ?
Thanks a lot in advance for any hints!
when ultrachart save in pdf & image format its different,
in image format it works fine but when saved into pdf format its not working well
i sent u sanpshot
Hi,If the chart border property was raised and if we export the chart to PDF,then the chart background is filling with black color.this.ultraChart1.Border.Raised = true;
See the following figure
If we make this.ultraChart1.Border.Raised = false; and if we export the same to PDF,then everything is perfect.This is the code Im using fr exporting the chart to PDF format. Infragistics.Documents.Report.Report chartReport = new Infragistics.Documents.Report.Report(); Graphics chartGraphics = chartReport.AddSection().AddCanvas().CreateGraphics(); ultraChart1.RenderPdfFriendlyGraphics(chartGraphics); //Define a string that contains the path to SaveFileDialog saveFileDialogChart = new SaveFileDialog(); saveFileDialogChart.Filter = "PDF Files|*.PDF|All Files|*.*"; saveFileDialogChart.Title = "Export Chart Image To PDF"; saveFileDialogChart.FileName = "PDF Format"; chartReport.Publish(saveFileDialogChart.FileName, FileFormat.PDF);But,in the generated pdf, if user wants to see the border settings wat ever he assigned,is there is any way to do tht.
David, thanks a lot for your great help, very appreciated!
Gus
Report rep = new Report(); ISection mySection = rep.AddSection(); float sectionWidth = mySection.PageSize.Width; float sectionHeight = mySection.PageSize.Height; float chartWidth = this.ultraChart1.Width; float chartHeight = this.ultraChart1.Height; float targetWidth, targetHeight; if (chartWidth > chartHeight) { targetWidth = sectionWidth; targetHeight = chartHeight * (sectionWidth / chartWidth); } else { targetHeight = sectionHeight; targetWidth = chartWidth * (sectionHeight / chartHeight); } Graphics myGraphics = mySection.AddCanvas().CreateGraphics(); if (targetWidth > targetHeight) // optional: center image { myGraphics.TranslateTransform(0f, (sectionHeight - targetHeight) / 2f); } else { myGraphics.TranslateTransform((sectionWidth - targetWidth) / 2f, 0f); } this.ultraChart1.RenderPdfFriendlyGraphics(myGraphics, (int)Math.Floor(targetWidth), (int)Math.Floor(targetHeight)); rep.Publish(@"C:\chart.pdf", FileFormat.PDF);