Set image (PNG) in .rpx at runtime

Posted by: developers on 23 August 2021, 11:27 am EST

    • Post Options:
    • Link

    Posted 23 August 2021, 11:27 am EST

    Hello,

    we have the Active Reports 14 and have a probelm when inserting an image at runtime into a .rpx, which is then exported as a PDF.

    We are using Visual Studio (C#) and have the .rpx as an embedded resource. First we load the resource as a byte array into a MemoryStream and then as XmlTextReader into the SectionReport.LoadLayout(…). After that we set the image as follows:

    ((Picture)this.Sections["QRDetail"].Controls["QRCODE"]).Image = QRCodeImage;
    

    Then we set the SectionReport.DataSource and start the report with SectionReport.Run().

    When the PDF is exported, the image is empty.

    We have also tried to save the .rpx to disk with SectionReport.SaveLayout(c:.…) after setting the image and load it again with LoadLayout(c:.…) and then export it as PDF. Again you get an empty image in the PDF. But what we noticed that the saved .rpx contains the image.

  • Posted 24 August 2021, 1:44 am EST

    Hello,

    I am not able to replicate the issue at my end. Could you please check with attached sample at your end.

    Thanks,

    Mohit

    AR_TEst.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels