Setting a Picture using ReportSection.Fields[].Value has no effect

Posted by: cristian.udrea on 5 December 2023, 10:14 pm EST

    • Post Options:
    • Link

    Posted 5 December 2023, 10:14 pm EST

    The following code used to work under ActiveReports 6, however under ActiveReports 17 the corresponding Picture control from the Report appears empty.

    Our application code overrides SectionReport.FetchData like this:

    report.FetchData += new FetchEventHandler(this.CutFlange_FetchData);

    Then, in the method CutFlange_FetchData, we try to set the picture like this:

    Bitmap flangeBitmap = BitmapsCache.getBitmap(flageCutName);
    Field cutFlangePic = report.Fields["CutFlangePicture"];
    cutFlangePic.Value = flangeBitmap;

    flangeBitmap is a valid bitmap and cutFlangePic also appears to be valid.

    Is this way of setting a picture still valid ?

    If not how should I proceed ?

  • Posted 6 December 2023, 12:03 pm EST

    Found the solution to my problem:

    A Field that is bound to a Picture control won’t take a System.Drawing.Bitmap as Value.

    However it will take a GrapeCity.ActiveReports.Document.Drawing.Image as Value and display it properly.

  • Posted 6 December 2023, 2:53 pm EST

    Hi Cristian,

    I am glad to know your issue is resolved!

Need extra support?

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

Learn More

Forum Channels