web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

MS NAV 2009 - Add picture to classic report

(0) ShareShare
ReportReport
Posted on by 428

Hi, Is there any way to add picture to classic report??.

Right now I have my company logo set in the "Company information.Picture".

I want another picture in one report. Is this possible without customizing the tables?

,Abdul.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Miguel Llorca Gómez Profile Picture
    7,019 User Group Leader on at

    Hi Abdul,

    Of course you can. The first thing is define de "C/AL globals" variable: you can add for example:

    - Name: image

    - Datatype: Record

    - Subtype: Company Information

    Then you should insert the picture on the report, through "sections", and define in the properties the "SourceExpr" like "image.Picture".

    After that, you need to include the code in the "OnInitReport()". Something like this:

    image.Picture.IMPORT('\\PATH\folder\PICTURE.bmp',FALSE);

    And thats all!!!

    Good luck!!

  • AbduTeeyech Profile Picture
    428 on at

    Thanks Miguel, I have added a 'Command Button in the report request window >> 'Option' tab.

    So as the user can manually import the picture by choosing it, just like in the company information form.

    I put the commands inside 'OnPush' of that 'Command Button'. Now it opens up the "import bitamp" dialog to chose the file. I chosen the file clicked on 'Open', it gets closed too, but, my new selected 'bmp' file is not imported to the company information table.

    Still researching.

  • AbduTeeyech Profile Picture
    428 on at

    Hi, it's imported now... Here, I may have to use the table to store the image.

    Is there any way that, I can directly assign the picture in the report layout? without referring to any table?.

    ,Abdul

  • Suggested answer
    Miguel Llorca Gómez Profile Picture
    7,019 User Group Leader on at

    With the method I mencioned you can do that... but the image is fixed and static for that report. The user cannot select it.

  • Yukon Profile Picture
    714 on at

    Hi,

         Allow me to reply this.

    You cann't skip using the table. But you no need save picture into your table.

    Here is sample for you.

    OBJECT Report 50000 50000

    {

     OBJECT-PROPERTIES

     {

       Date=13/08/15;

       Time=[ 1:19:09 PM];

       Modified=Yes;

       Version List=;

     }

     PROPERTIES

     {

     }

     DATAITEMS

     {

       { PROPERTIES

         {

           DataItemTable=Table2000000026;

           DataItemTableView=SORTING(Number)

                             WHERE(Number=CONST(1));

           OnPreDataItem=BEGIN

                           Company.GET;

                           Company.CALCFIELDS(Picture);

                           TempBlob.CALCFIELDS(TempBlob.Blob);

                         END;

         }

         SECTIONS

         {

           { PROPERTIES

             {

               SectionType=Body;

               SectionWidth=10800;

               SectionHeight=2115;

             }

             CONTROLS

             {

               { 1000000000;PictureBox;0 ;0    ;3600 ;2115 ;SourceExpr=TempBlob.Blob }

               { 1000000001;PictureBox;4950;0  ;3750 ;2115 ;SourceExpr=Company.Picture }

             }

              }

         }

          }

     }

     REQUESTFORM

     {

       PROPERTIES

       {

         Width=9240;

         Height=990;

       }

       CONTROLS

       {

         { 1000000000;TextBox;3960 ;330  ;3630 ;440  ;InPage=-1;

                                                      CaptionML=ENU=Picture;

                                                      SourceExpr=TxtFile }

         { 1000000001;Label  ;0    ;330  ;3850 ;440  ;ParentControl=1000000000 }

         { 1000000002;CommandButton;7700;330;660;440 ;InPage=-1;

                                                      CaptionML=ENU=...;

                                                      OnPush=VAR

                                                               cu@1000000000 : Codeunit 419;

                                                             BEGIN

                                                               TxtFile := cu.BLOBImport(TempBlob,'',TRUE);

                                                             END;

                                                              }

       }

     }

     REQUESTPAGE

     {

       PROPERTIES

       {

       }

       CONTROLS

       {

       }

     }

     CODE

     {

       VAR

         Company@1000000000 : Record 79;

         TempBlob@1000000001 : TEMPORARY Record 99008535;

         TxtFile@1000000002 : Text[250];

       BEGIN

       END.

     }

     RDLDATA

     {

     }

    }

    Regards,

    Yukon

  • AbduTeeyech Profile Picture
    428 on at

    Thank you Miguel and Yukon,

    Miguel, your solution works.

    And, since we need it to use two logos/pictures in simultaneously,  I found another solution for this.

    I imported one picture for one Item in the item card. And, print this in the report.

    Hope it will not affect any thing related to Item in the NAV ??.

    ,Abdul

  • Suggested answer
    Miguel Llorca Gómez Profile Picture
    7,019 User Group Leader on at

    It will not affect for sure!

    Thanks!!

  • Community Member Profile Picture
    on at

    yes it will not affect ,thanks bro!!!!

  • Community Member Profile Picture
    on at

    wooow perfect *******

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans