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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Show bitmap into a report

(0) ShareShare
ReportReport
Posted on by 80

Hi all,

I've insert an image for a record as an external notes (using docuRef,  where docuType = File).

Now, I've to display the image (saved as .bmp) into a report.

Into the report I've added a display method (that returns Bitmap) like:

-------------------------------------------------
    DocuRef                 docuRef;
    FileName                fileName;
    Image                   image;
    container               imageCont;
    Bitmap                  ret;
    ;
   
        select docuRef where
            docuRef.RefTableId == tableId &&
            docuRef.RefRecId == recId &&
            docuRef.TypeId == 'FILE';
        fileName = docuRef.completeFilename();
        if (Image::canLoad(fileName))
        {
            image = new Image();
            image.loadFile(fileName);
            imageCont = conIns(imageCont, 1, image.getData());
            ret = conpeek(imageCont, 1);
            return ret;
        } //---- end-if image

---------------------------------------------------

The select statement find out the filePath, the image load the fileName, the container returns a value into ret.... but nothing is displayed in my report!!!

Can someone help me to understand why? Have someone any suggestion?

Thanks to all

Emanuela

 

*This post is locked for comments

I have the same question (0)
  • Mohamed Amine HAMDAOUI Profile Picture
    540 on at
    Re: Show bitmap into a report

    Hello,

    Are you running your report manualy or in batch? Image processing is disabled my Microsoft in batch mode for security. Images can only be printed if reports are printed manualy.

    Use this code :
    display server public DocuValueFile your_method_name() {
    DocuRef docuref;
    DocuValue docuValue;
    ;
    select firstonly tableid from docuRef
    where docuRef.RefCompanyId == dataAreaId &&
    docuRef.RefTableId == tableId &&
    docuRef.RefRecId == recId &&
    docuRef.TypeId == 'FILE'
    join file from docuValue
    where docuValue.RecId == docuRef.ValueRecId;
    return docuValue.File;
    }

    and drag it to the design, it works.

    Best regards,

    Mohamed Amine

  • Emanuela Govoni Profile Picture
    80 on at
    Re: Show bitmap into a report

    Hi Mohamed

    thank you very much for your answer.

    I solved my problem using image as a table field, instead that as a note. But next time I'll try your suggestion.

    Best regards,

    Emanuela Govoni

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Willem van Duren Profile Picture

Willem van Duren 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans