Microsoft Dynamics AX development

Archive for September, 2015

Align image logo to the right

1) In the DP class find the width of the image:

Image img = new Image();
CompanyInfo companyInfo = CompanyInfo::find();
CompnayImage companyImage = CompnayImage::findByRecord(comapnyInfo);


salesPackingSlipHeaderTmp.LogoWidth = img.Width();

2) Add the image to the report:


3) Set the parameters to take the image from the dataset:


4) In Visual Studio set the Size property (of the image) to “Original size” (Right click on the image > Properies > Size)

5) Add the following expression in the “padding left” expression:

=CSTR(211-First(Fields!LogoWidth.value, “DataSetName”)) + “pt”

Where 211 is the maximum size (in pixel) of the image.

6) Deploy the report


Tag Cloud