Hello all,
I am new to the Infragistics Charts and Documents.I use folliowing libraries:- .Net 4.0- Infragistics NetAdvantage 2009.2
I created a DoughnutChart and can display it on my WinFormApp and I can export it to the PDF file.The Data comes from DB.
Sometimes i get only one Data-Item to display/render.Aslo DoughnutChart with only one row.By displaying it on my WinFormApp there is no problem,but if I render it to the PDF file the chart has wrong shape.Here is my exsample code:var chart = new UltraChart { ChartType = ChartType.DoughnutChart, Data = {DataSource = new [] {42}} };chart.Data.DataBind();var report = new Report();var section = report.AddSection();var band = section.AddBand();var canvas = band.AddCanvas();canvas.Width = new FixedWidth(200);canvas.Height = new FixedHeight(200);var graphics = canvas.CreateGraphics();chart.RenderPdfFriendlyGraphics(graphics, 200, 200);try{ report.Publish("out.pdf", FileFormat.PDF); new Process{StartInfo = {FileName = "out.pdf"}}.Start();}catch (Exception ex){ MessageBox.Show(ex.Message);}With this code I get following result:
I would like to have a round shape of my chart.Thanks.
Best regardsVaceslav
Hello Vaceslav,
Could you please try this approach below:
Report report = new Report(); ISection section = report.AddSection(); Infragistics.Documents.Reports.Graphics.Image image = new Infragistics.Documents.Reports.Graphics.Image(ultraChart1.Image); section.AddImage(image); report.Publish("..\\..\\Test.pdf", FileFormat.PDF); Process.Start("..\\..\\Test.pdf");
Report report = new Report();
ISection section = report.AddSection();
Infragistics.Documents.Reports.Graphics.Image image = new Infragistics.Documents.Reports.Graphics.Image(ultraChart1.Image);
section.AddImage(image);
report.Publish("..\\..\\Test.pdf", FileFormat.PDF);
Process.Start("..\\..\\Test.pdf");
and let me know if you have any questions.
Regards
Hello Georgi,Thanks for your advice.Your approach works, BUT the quality is not acceptable.
How can I adjust the Quality of Image?
I create a case for you with reference number CAS-91987-2HRFZ8. I`ll provide you additional information through this case. Let me know if you have any questions.
To the original poster of this issue -
I have been looking into similar issues in my own application. We have researchers using our application who have declared the image quality in our reports as being substandard, at least according to the standards of the journals that they publish their research in. So we have also been scrambling to figure out how to improve image quality without abandoning all our existing work and starting over with new chart and reporting controls.... (last thing we want to do right now)
What I have found in the Infragistics forums that at least helps image quality (though no word back from the researchers yet on what they think) is to add lines such as the following after getting an image of the chart but before adding that image to the report:
image.Preferences.Compressor = Infragistics.Documents.Graphics.ImageCompressors.Flate;
image.Preferences.Converter = Infragistics.Documents.Graphics.ImageConverters.RGB;
I have also been playing with the following settings in our print routines, also based on comments from the Infragistics forums, though I don't really know yet if these help - still playing with this to see what - if any - effect it has:
private void printDocumentReport_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
try
if (m_projectionPages != null && m_projectionPages.Count > 0 && m_currentPrintPageNumber < m_projectionPages.Count)
// See if we can bump up the image quality of the System Graphics before using it to create Infragistics Graphics
e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
// Create a new Document Graphics object based on the printer page graphics.
Infragistics.Documents.Graphics.Graphics reportGraphics = new Infragistics.Documents.Graphics.Graphics(e.Graphics);
...
Hi,
Just to inform you that this issue is fixed in version 12.1 and 12.2
If you have any questions, please feel free to write us