web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Image in data provider class AX 2012 R2

(0) ShareShare
ReportReport
Posted on by 435

Hi all,

I'm creating an SSRS report in AX 2012 R2. One of the requirement is to display an image in the report.

I'm trying to use Image class in the data provider class, so I wrote something like this:

Image    image;

image = new Image();

When I preview the report in visual studio, I always getting an error. But when I erase the image code, I can preview my report without getting any error.

My question is how to load an image in data provider class? Can't I use Image class in the data provider? and why am I always getting an error when using Image class in the data provider class?

 

Thank you in advance,

Esther

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Esther,

    If you have a look into the classes SalesInvoiceDP and SalesInvoiceDPBase you will find an example where the company logo is used.

    Then also have a look at the SalesIvoice report to see how it is implemented on the report itself.

  • Esther Mulijono Profile Picture
    435 on at

    Hi Andre,

    Thank you for the reply.

    I've looked into the SalesInvoiceDP and SalesInvoice report.

    The SalesInvoiceDP load the image from the database.  What I need to achieve is to load an image from filesystem. For that purpose, I need to construct an Image class in the data provider. But when I initialize the Image class the report always throwing an exception without any explanation of the exception.

    I try writing down this in a data provider class:

           Image image = new Image();

    But when I preview the report in visual studio, there goes the exception. Do you have any idea why I can't put an Image class in a data provider class?

    Regards,

    Esther

  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Esther,

    It was not clear you loaded an image from file. Do you get the error when you only use the line with:

         Image image = new Image();

    Or do you have already more statements written? Did you run the incremental CIL compile? Otherwise try to use the "BinData" class for loading the image.

  • Esther Mulijono Profile Picture
    435 on at

    Hi Andre,

    Yes, I got an error when only using the line:

           Image image = new Image();

    I've run the incremental CIL and try to debug the code, but that line of code always throwing exception without any explanation.

    As a workaround I finally use the BinData class as you suggested. But I still wondering why instantiating an Image class in data provider would cause an exception.

    Thank you,

    Esther Mulijono

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans