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
100
UltraGauge Export to PDF
posted

Hi,

I get an instance of the UltraGauge created to a class library. I would like to display the image generated by this UltraGauge. Please let me know if there is a way to export the Gauge which is created dynamically onto a PDF document.

I find that the ImageUrl which is being used is a private member. In UltraChart it was exposed a public property.

Also can i know why the property is exposed in UltraChart and not UltraGauge.

Thanks,

Divya

 

  • 28496
    Suggested Answer
    Offline posted

    here's some code you can use to export to pdf using the Infragistics.Documents library:

            UltraGauge theGauge = new UltraGauge();
            RadialGauge rad = new RadialGauge();
            theGauge.Gauges.Add(rad);
            rad.Dial.BrushElement = new SolidFillBrushElement(System.Drawing.Color.Red);

            Report rpt = new Report();
            System.Drawing.Graphics g = rpt.AddSection().AddCanvas().CreateGraphics();

            theGauge.Render(g, new System.Drawing.Size(250, 250));

            rpt.Publish(@"C:\report.pdf", FileFormat.PDF);

    you can also use the gauge's SaveTo Method to save to an image in-memory or on disk.

    the resolved ImageUrl isn't public because we don't have a case where it would be useful; tasks such as the one you are describing are done using the above methods.