Hello eveyone, does any one have any idea on somehow preview a pdf report documnet in print preview dialog or somehow using the UltraPrintDocument so that you can view in the print preview dialog?? Any ideas, thanks in advance,
Jose
Jose,
Take a look at the Thumbnails sample for the Documents sample project that comes with NA. Basically, you could take the images that are generated for each page in the report and hook into a PrintDocument's PrintPage event, and within there draw into the graphics object provided by the event. You would also have to set e.HasMorePages accordingly.
-Matt
Thanks, this worked and using the MetaFile image type renders the pages smooth. However, there is either a bug or it's just a feature; if your UltraChart has the GradientEffect added then RenderPdfFriendlyGraphics will *not* render colors. The 3DEffect and ShadowEffect also do not render, but at least their presence still allows colors to be rendered. I'm using version 9.1 w/ hot fix. Bug or feature? Les
I would like to thank you two for these suggestions. This was exactly what I needed. So now I am using the Documents namespace in concert with a print preview control in my own dialog form. I started 1st with the thumbnails example concept of getting an Image form the Page without writing the page file. Then with the reference to using the Metafile, I switched to a function that returned a Metafile given the Page, with that functioned based on the sample that wrote out the metafile. This concept worked so well, that I don't know why Infragistics doesn't provide that as a sample.
One thing I need to work on is to come up with a way to preview a grid control similar to the using an UltraGridPrintDocument with an UltraPrintPreviewDialog.
I would suggest using a simpler gradient if any of those are acceptable for you. You can also export the chart as an image, though the quality would definitely suffer if you start zooming in. I'm attaching a sample report that i got when i exported a chart with a backwardsdiagonal gradient, a shadow effect and a 3d effect.
Yes, I was using the circular gradient effect with 9.1 2012 build. Everything renders with simple wireframe. No colors. I'm not seeing the 3D or Shadow effects rendering either, but at least they don't prevent the chart colors from rendering.
Are you using one of the more complex gradient effects in the chart (such as circular or rectangular)? Those are the gradients that won't render using the document engine. Other than that, simple gradient effects as well as shadow and 3d effect rendered fine when I tried them. I was using version 9.1 with build 2013. Would it be possible for you to attach a sample project with your chart?
I'm not familiar with the chart, but my guess is that these effects can't be rendered because the PDF format does not support per-pixel transparency. This means that multiple gradients can't be drawn on top of each other (which I'd imagine that the ShadowEffect would have), or other types of brushes with transparency won't be rendered correctly. Hopefully one of the people more familiar with the chart can chime in on this.