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);

img.setData(companyImage.Image);

salesPackingSlipHeaderTmp.LogoWidth = img.Width();

2) Add the image to the report:

2

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

3

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.

5
6) Deploy the report

Tag Cloud