开发者

AX 2009 Check (Cheque) Logo Not Printing Correctly

We've got a .gif image with a transparent background set as the logo in AX 2009. When we print checks some of our user's get checks with the transparent background portion of the logo printed black. The same is true of the check signature.

If I print the GIF directly to the same printer, it开发者_JS百科 prints fine (no black in the transparent portion of the image)

This leads me to believe it is a user setting in AX, considering it only occurs for some of our users and that the raw gif prints just fine.

I see the logo gets stored in the BANKCHEQUELAYOUT table in a data type image field. It looks like that is an AX-wide record (not per user) so I don't think the issue is with that value.

Has anyone experienced this issue? Are there user-level print settings I should look at?


First, check that the BackStyle property of the the bitmap control is set to Transparent. This is a mandatory step to enable transparency of any report or form image control.

I have not tried transparency with GIF image files. However GIF was not a supported image file in previous versions of AX, maybe there is an error with transparency.

My first suggestion is to convert the GIF to PNG, update the image in the check layout and try again.

My second option would be to remove transparency and replace with the background color (white?).

Update: AX stores images in the CompanyImage table. The size of the images can be calculated by implementing this method:

display ImageSize imageSize()
{
    ImageSize size;
    BinData b;
    if (this.Image)
    {
        b = new BinData();
        b.setData(this.Image);
        size = b.size();
    }
    return size;
}

Unfortunately new Image(this.Image).size() does not work. Drag the method to the AutoReport field group, then open the table in the table browser.

In my example the PNG file had the size 1476 bytes and the BMP file 42062 bytes.


Finally got this nailed down, Thanks to Jan's comment. Here are the steps I took:

  1. Create a .gif image with a white background.
  2. Change the BackStyle property of the image in the check report to Opaque.
  3. In the showLogo method of the CompanyImage form, add this line of code:

logoImage.transparent(true,255,255,255);

so the complete showLogo method looks like:

void  showLogo()

{

Image   logoImage;
;
try
{
    element.lock();
    if (imageContainer)
    {
        logoImage = new Image();
        logoImage.setData(imageContainer);
        logoImage.transparent(true,255,255,255);
        image.image(logoImage);
        image.widthValue(logoImage.width());
        image.heightValue(logoImage.height());
    }
    else
    {
        image.imageResource(0);
        image.widthValue(32);
        image.heightValue(32);
    }

    element.resetSize();
    element.unLock();
}
catch (Exception::Warning)
{
    throw error(strfmt("@SYS19312", imageFilePathName));
}

}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜