how to set an image per itemid on a report

kallietkalliet Member Posts: 10
edited 2008-04-22 in Dynamics AX
Hello,

I want to create an Axapta 3.0 report with an itemid and a corresponding image.

All my images are stored on an external disk (S:\...)

How can I put an image in the column next to the itemid (and do nothing if the image is not existing) ? The code after // doesn't exist, i am looking for a way to achieve this.

f.i.
display bitmap ItemImage
{
image myImage;
bitmap myBitmap;
;
myImage = new Image();
// if S:\image1.bmp exists
// {
// myImage.loadFile("\S:image1.bmp);
// myBitmap = myImage.converttoBitmap();
// }
// else myBitmap = null;
return myBitmap;
}

any suggestions?
thx;

Comments

  • ManishAxManishAx Member Posts: 3
    Hi there,
    U can do that by creating a field in Item master, where u can store image of each item. Use that image to show on any report u want to. For that, create a new field of container type, extended by BitMap.
    For reference , HR>Periodic>Administration>Applicants. On that form , we can put picture of each applicant(Button Resume > Picture).
    Like this, u can put image of each item on Item master in a newly created field. Use that field to show picture on any report.
    I hope, it will help you out...
    Bye. 8)
    In search of real life...
  • kallietkalliet Member Posts: 10
    hello,

    I got the image on the report by putting an empty image per line (empty.bmp) and then replacing it (if an itemimage exists) by the image located on a server. Like this :
        str imageEmptyFile=imageLocation + "empty.bmp";
        str imageFile = imageLocation +smmQuotationLine.ItemId+".bmp";
        if (winapi::fileExists(imageFile))
        {
            ItemRef.imageName(imageFile);
            ItemRef.bottomMargin(5,Units::mm);
        }
        else
        {
            ItemRef.imageName(imageEmptyFile);
            ItemRef.bottomMargin(0,Units::mm);
        }
    
    where ItemRef is a bitmap on a report with width 25 mm and alignment set to left.

    I looks fine on screen, BUT when I print it to a printer or pdf writer, the bottom of each image is not on the paper. Why? And how can I fix that?

    thx in advance for any replies
Sign In or Register to comment.