Search This Blog

Thursday 4 September 2014

How to display Employee Image in Ax 2009 Report

Hi ,

Today i would like to share you how to display employee image in Ax 2009 report.

Step 1:

Attach Image to each Employee Record , using Document Handling Attachement

Go to Human Resource->Common Forms-> Employee Details

Step 2:

AOT->Reports->New Report

for an example , My Report name is EmployeeDetailsReport

Step 3:

Add EmplTable as Datasource to display Employee Details

Step 4 :

Write a display method with return type Bitmap to get the employee Image


 To Retrieve Employee Image from Document Handling

display Bitmap emplImage()
{
    Bitmap bitmap;
    Bindata binData = new BinData();
    Docuref docuref;
    Image image;
    ;
    select firstonly docuRef order by docuRef.modifiedDateTime desc where
        docuRef.RefCompanyId == curext() &&
        docuRef.RefRecId == EmplTable.RecId &&
        docuRef.RefTableId == EmplTable.TableId &&
        docuRef.TypeId == "Image";

    if (binData.loadFile(docuRef.completeFilename()))
    {
        bitmap = binData.getData();
    }

    return bitmap;
}

To retrieve Employee Name 

display Name EmplName()
{
;
return DirpartyTable::find(EmplTable.PartyId).Name;
}
Step 5:

Drag and Drop the emplname() and emplImage() method to design



Output:



No comments:

Post a Comment