How to Print Logo Dynamically in reports

chandrurecchandrurec Member Posts: 560
Hi all,

I want to print logo in sales Order report dynamically. The logo is available in a certain location. For doing this I am giving the coding as follows.


TempCompInfo.Picture.IMPORT('C:\'+"Sales Line"."No."+'.jpg');
TempCompInfo.CALCFIELDS(Picture);

then I am giving the source expression with TempCompInfo.Picture. When I Print the report, I am not getting a logo getting printed instead some symbol is getting printed.

If anyone knows how to rectify this problem, Kindly let me know.

Thanks in advance.

Regards,
chandru.

Comments

  • chandrurecchandrurec Member Posts: 560
    Hi Mohana,

    I tried it but it was not working.

    Regards,
    chandru.
  • SavatageSavatage Member Posts: 7,142
    your pic is a jpg correct?

    Nav only shows BMP's so you need to either convert on the fly as shown in the link or open pic in paint and save a bmp.
  • chandrurecchandrurec Member Posts: 560
    Hi Savatage,

    Yes My picture is JPG. But I am converting the JPG to BMP using the converter which I found in Mibuso and then Only importing into Navision but still I cannot able to import on the fly.

    Thanks & Regards,
    chandru.
  • chandrurecchandrurec Member Posts: 560
    Hi Savatage,

    I used the coding as shown below.


    IF EXISTS ('E:\jpg\'+"Sales Line"."No."+'.jpg')
    THEN BEGIN
    ConvertPic:= SHELL('E:\jpg2bmp.exe -outfile E:\temp.bmp -color 256 -bmp -scale 1/1 E:\'+
    "Sales Line"."No."+'.jpg');
    //Picture.IMPORT('c:\temp.bmp',FALSE);
    CompanyInfo.GET;
    CompanyInfo.Picture.IMPORT('c:\temp.bmp',FALSE);
    CompanyInfo.CALCFIELDS(Picture);
    END
    ELSE BEGIN
    //CLEAR(Picture);
    CLEAR(CompanyInfo.Picture);
    END;


    If you find ant mistake, kindly let me know.

    Thanks in advance.

    Regards,
    chandru.
  • davmac1davmac1 Member Posts: 1,283
    Another option you can use is to create the logos as pdf files and then use bullzip to superimpose the logos.
    Bullzip is a very NAV friendly pdf writer with several useful options and ara3n first introduced us to it a few years ago (how to print to pdf).
    When you create the pdf file using bullzip, you specify with one of the parameters which pdf file to superimpose.
    The downside is every one printing needs bullzip installed and there is a small amount of coding needed. On the plus side, you can automatically with a small amount of code, attach the document you printed to the associated record as a permanent record if you need it.
    Once you have it working it is extremely reliable.
  • SavatageSavatage Member Posts: 7,142
    in you code your output file is e:\temp.bmp but you are importing c:\temp.bmp
Sign In or Register to comment.