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
283
Export WebGauge to PDF?
posted

Is it possible to export a WebGauge to PDF like you can with WebCharts?

Thanks,
Rudy
Parents
No Data
Reply
  • 10880
    posted

    I believe that the WebGauge does not have the equivalent to the UltraChart's RenderPdfFriendlyGraphics method but you can use the Render method in the same manner with some limiited abilities.

    WebGauge's Render method:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.WebUI.UltraWebGauge.v8.2~Infragistics.WebUI.UltraWebGauge.UltraGauge~Render(Graphics,Size).html

    You can also go the round about way of saving an image to a stream and then adding an image to your Pdf document.

    MemoryStream ms=new MemoryStream();

    Report r = new Report();

    Method 1:

    this.UltraGauge1.Render(r.AddSection().AddCanvas().CreateGraphics(),new System.Drawing.Size(400,400));

    Method 2:

    this.UltraGauge1.SaveTo(ms, Infragistics.UltraGauge.Resources.GaugeImageType.Bmp, new System.Drawing.Size(400, 400));

    r.AddSection().AddImage(new Infragistics.Documents.Graphics.Image(ms));

    The first method seems to render the text better while the second method seems to keep some of the styling more intact.  Also, you may want to set the backcolor of the gauge to White or somethign along those lines before calling the SaveTo method.

Children
No Data