Please could you consider adding support for maintaing vector wmf / emf files when exporting report to a PDF.
Export to PDF - Support exporting of vector EMF and WMF images in native PDF commands
Answers approved by DevExpress Support
In the 14.1 version, we supported exporting of EMF+ images to implement the following suggestion: Export to PDF - Add an option to export all texts to PDF as native PDF text elements .
To learn about use cases that have not been covered by the implemented functionality, we decided to close this suggestion as well.
If you are still in need for support of WMF and EMF with no regard to the export of charts, please track the new suggestion at: Export to PDF - Support exporting of vector EMF and WMF images in native PDF commands .
How do I turn on this enhanced pdf export of a chart in a XtraReport? It does not seem to work out of the box.
Hello Håkon,
I've created a separate ticket on your behalf (How to export a chart as a Metafile into the PDF file). It has been placed in our processing queue and will be answered shortly.
Thanks,
Dmitry
Hi everyone,
Thank you for all your feedback. We appreciate your opinion. We have already discussed this feature and, according to our rough estimate, a complex solution is necessary. This feature is not in our To-Do list for upcoming releases, but this may change depending on the amount of available R&D team resources.
Updated by Ingvar (DevExpress Support):
Meanwhile, you can use a workaround kindly provided by Peter Thorpe. In the attachment, you will find a sample project that uses this idea and demonstrates how to increase the image quality only on export to PDF. In other words, Charts are not replaced with XRPictureBoxes, but produce "big" images on PDF export.
In this sample project, you can find a custom XRChart descendant that produces a custom Brick type with a custom Exporter. If the PDF export is selected, the Exporter creates a bigger image of the current chart and draws it.
To control the quality of the exported Chart image, I have added the PDFExportOptions property set to the MyXRChart class. This property set has two options:
- UseAdvancedApproach - a boolean property that defines whether or not MyXRChart should use the standard PDF export mechanism or a custom one;
- Scale - the multiplier for the Chart image size. This property is in effect only when the UseAdvancedApproach property is enabled.
I hope you will find this approach useful.
Recently I had a customer complaint about the bad graphic quality of the charts in PDF reports. Small data portions were simply swallowed up by their neighboring color. Of course they could not be made visible again by zooming into the PDF document. Then I have implemented your workaround suggestion to embed bigger pictures. Then the charts looked better but the file size of the PDF document was 8 times larger ( 1MB instead of 125 KB) at a chart scale of 5. A chart scale factor of 10 produced a generic error in the GDI+ library. Maybe the resulting image resolution was too big. But even with very big bitmap resolutions the loss of data remains possible.
Although you have provided a workaround solution please keep up (or start?) to work on a vector based solution. Because only this can provide the quality the customer expects. And if he then overlooks some small data portions it's his fault and not mine anymore.
Other Answers
Google search "active reports" for a solution to this issue. It's a very simple solution that will resolve this problem and allows graphs and images to be exported to PDF in full vector based formats.
Not only does this reduce the file size, it allows the charts to appear sharp and clear.
sorry, only now stumbled on this thread again. you can have the report show in the preview window and from there print to adobe distiller instead of using the devexpress inbuilt pdf engine.
Hello Richard,
Thank you for your suggestion! We'll consider implementing it in the future.
Best regards, Alan.
R&D, .NET Team.
Any update on this being implemented?
Many thanks
Hello Richard,
Unfortunately, this feature isn't yet implemented, and for now I can't give you any estimate on when it will be ready. Once we decide to do something in this regard, we'll change the status of the current suggestion to Planned. Please bear with us.
Best regards, Alan.
R&D, .NET Team.
Hi DevExpress Team,
any update on this feature? I am really looking for a solution on how to make PDF exported files look better. Even the solution of exporting the images as raster ones, but in a better DPI, would temporarily solve the problem. To be honest, I can't get why you use screen DPI for images in PDF exports anyway, PDFs are much more print-related in my point of view.
Any answer would be really appreciated, as I have to advise our users to use a PDF printer over the built-in export, which I really don't like.
Best regards, Jan Ambroz
Currently, we have no plans to implement this feature in the XtraPrinting Library version v2012 vol2.
Is DevExpress planning on doing anything at all with this product?
I feel the need to comment as well, as I have been waiting for a solution to this and similar problems (http://www.devexpress.com/Support/Center/Question/Details/S31631), all related to the quality of exporting graphics/charts and associated text such as labels, for many years. The current implementation is especially problematic with label text with small fonts, that become completely unreadable in the PDF.
I fully agree: I've posted this 4 years ago already and nothing happens. That's really a bad policy. :-(
I fully agree
I have been asking for this functionality for years. I find it very frustrating that DevExpress can be so uninterested in making a change that would make their product look a lot better! We have had to start phasing out the use of DevExpress charts in our reports because they look so poor in PDF
This is the excat reason why we are in the process of phasing out DevExpress Reports and replacing them with the reporting engine from www.cete.com a.k.a. Dynamic PDF. They exports charts as vector graphics. Not only does this make the PDF files smallers, they look great compared to the junk we were getting from DevExpress. It's sad they no one seems to care about producing a quality report.
I agree completely. Without the ability of making at least better DPI images, it is unusable for printing purposes. And on-screen reading is really not always a purpose of a PDF document.
Same to me. This one is important to our business and I understood reporting as one of the key benefits of DX. Outlandish that this is so out of focus and obiously discontinued in developement.
It is clear to me already that DevExpress has other opinions than their customers for many things. This particular one doesn't have enough 'followers', so it hasn't been marked as important enough for DX. Get more people to follow this thread and it get's a higher priority for DX to implement.
I have asked this feature for years as well , and I have to use PDF 995 to print the report to PDF file and cached for my clients. that is really bad , and I am start thinking to change to another report tools as well.
Is this related? (http://www.devexpress.com/Support/Center/Question/Details/Q109564).
All my images are in EMF and when I export them, they all look bad.
DevExpress Support reply:
"Unfortunately, this issue is related to the standard resources serialization mechanism: a vector picture in EMF format gets automatically converted to bitmap (PNG) when saving it to resources."
This is not really related, as it can be solved as stated in the Q109564. It is just a serialization issue. But, try to export this report (I mean a report containing an EMF image, which shows nice on-screen and prints nice) to PDF, you will end up with a really bad and unusable image. This is at least related to version 11.1 which we still use (sad).
As I couldn't solve the problem with EMF images, I exported to a temporary file (normally office file) and them replaced the bad PNG images with my EMF images. My clients don't use PDF much, but I thing I have to do the same.
Dear all,
Maybe I can summarize and emphasize again why this is a MUST HAVE for DevExpress.
- You have an excellent, incredibly powerful reporting tool (XtraReports)
- You have an excellent, incredibly powerful charting tool (XtraCharts)
- You have an inbuilt PDF writer which allows us all to refrain from using additional third party software such as ADOBE PDF, which is especially problematic when deploying software built on your products.
- However, the quality of Charts (including label text!) and Images exported to PDF is abysmal. What looks to be a wonderful report (PDF) makes you throw up when you see the first chart. And makes you go mad when you can't even read the labels/legends in the charts.
So… You went 95 % of the way… It would be advisable to go the rest as well.
Thanks guys, and let me reiterate that your components rock (mostly :)).
Best,
Marc
Marc,
Thanks a lot for your compliments about our product. We greatly appreciate this. Unfortunately, we cannot give any promises right now because this feature isn't currently in the production state.
Just joining the crowd here - this feature would be very, VERY welcomed.
I find that my biggest complaint on PDF quality is related specifically to charting. I understand that a full perfect solution can be problematic here and may require significant internal design changes. However I do believe that at least two simpler steps are appropriate here:
- Let us export labels as actual text on top of the chart image.
- Let us set a higher 'export' DPI on a chart component (this makes the PDF larger of course but at least we can choose if it is appropriate)
I agree completely with Marc and also with Anton. The second solution Anton stated seems much easier to 'implement' for me and it would solve problems with vector image sources as well, not only charts. To be honest, I don't get why it is not already implemented somehow, as you can select the DPI when exporting the report as image, so why to use strictly screen DPI for PDF images and not allow us to select it as well? Again, if there is ANY possibility to do something about this, go for it, please.
Jan, Anton,
Thank you for the update. You will be automatically notified of any updates to this ticket.
Completely agree with earlier comments. I've been waiting for a solution to this for two years now. I can understand if devexpress decides not to fix issues that have workarounds… but this one I don't understand. Your product is excellent in many ways, but it creates ugly PDFs. Seems like that would be worth fixing – even if it is a band-aid fix like an adjustbale DPI for images.
We almost trashed Dev Express because of this issue with reports containing charts. The only workaround I was able to come up with was to put pictureboxes in my reports, instead of the charts. I then create my charts programatically, i.e., not using the chart wizard, with twice the size of the picturebox in the report. Then convert the charts into images and bind them to the pictureboxes. The printed charts will look good!
For use the same. Reports with charts are very important and are used by the people who make decisions. It the quality stays poor, we might have to consider another reporting tool.
Just adding to the long list of people that have been waiting for this for years. I wanted to start using XtraReports but upon trying it (and liking the majority of it) I find I can't use it for a lot of reports as the chart dpi is so poor.
I can understand not exporting the charts as vectors to PDF but creating the bitmaps at a higher DPI is surely an easier fix, it's possible when you export to an image in xtracharts to set the dpi so why not through Xtrareports and PDF exporting.
Hi Peter,
Would you please clarify whether or not you are referring to the ChartControl.ExportToImage method?
+1 from me
After a lot of looking around I have come up with a way to improve the chart images DPI (still not a vector but may help people) in XtraReports for web printing and PDF export. It could be modified for use in other XtraCharts Scenarios. This only works for 2D charts it won't have any affect on 3D chars other than increasing file size so the method is skipped.
Basically in the before print event I loop all charts in a report
Cast the XrChart to IChartContainer allowing me to use the ExportToImage method in XtraCharts
Export to an EMF file (WMF also works) as it is a vector format quality is retained
Draw the EMF to a larger bitmap e.g. 4x the size XtraCharts draws it to (scale parameter)
Replace the XrChart with an XRPictureBox with the larger bitmap as its source setting it to zoom the image
The code I am using is here: http://pastebin.com/VHBCvGEZ it probably needs some error handling and tidying
The image and text clarity should be significantly better as you increase the scale parameter. This works better than the work arounds involving physically changing the chart size as the resulting images fonts, lines, grid spacing… are the same as the original chart not reduced.
Thanks for sharing your solution with us, Peter!
Hello Peter
Thanks a lot for your solution. It is not perfect, since it increases filesize, but at least the charts are not so ugly.
Not-so-much thanks to Devexpress for not working on that problem for years.
Hi Peter Thorpe
Thanks for sharing your solution! It works as described for the XtraReports, but I am having difficulties when trying to apply the solution to XRSubreport's. Do you (or any others) have a solution that works for all layers?
Hi Lars,
I adjusted the code to work with subreports too: I took Peter's code and made the method static, taking the report as an argument. Then, in each subreports' BeforePrint event, call FixChartOutput(this.ReportSource, scale)
Thanks Daniel, it worked!
So will this be implemented at all ?
@Daniel looks good what I actually do in my case is inherit all my Reports from a base class e.g. XtraReportsExtended : XtraReports and call the method in there. Then all the functionality is built into each report automatically. Just an implementation choice I guess but it means I don't have to remember to call a method in each report. Not tested it in sub reports to be honest though.
p.s. The code isn't fool proof. Until now I have only had charts in the report header or footer. I tried putting one in the group header of a report with filtering set appropriate for the grouping. This just caused a repeated draw of the same first chart through the report. I guess having this adjustment in the beforeprint method of the report means all group charts are overwritten with the same XrPictureBox, the method isn't called on an individual chart basis for each grouping. Not sure if there is a better event we could call this in to avoid that issue, anyone with any ideas?