Skip to main content

NAV 2013 and NAV 2013 R2 - Add Image in Report.

Hi all,

Let's see a simple thing today i.e How to add images in Reports in NAV 2013 and Later.

* Below screen shot are from NAV 2013 R2, the steps remain same for NAV 2013 too.

So let's do it in a standard Report, say Report 405 which doesn't contain Company Logo. We will add the Company Image from Company Information Card / Table.



Steps -

1. Keep a Safe copy of Standard Report.

2. Design the Report in Developer Environment of the Report, and do below steps -

a. add a global Variable say CompanyInfo.
b. Write Code to Get The Picture Parameter from Company information.

In this Report Step 1 is already Executed so we can skip adding the variable. Let's add code.

You need to add below Code, On Trigger - Purchase Header - OnAfterGetRecord()  -

CompanyInfo.CalcFields("Picture");



Now lets add the Company Picture in DataSet as shown below.



3. Save the Report.

4. Open the layout of the Report.

5. Let's make some adjustment in Header part so that we have some space to add a image. Once done double click the Image from Toolbox.



6. Here we need to provide some information of the image, below are the values -

GENERAL -
a. Name - CompanyPicture
 * Name Can be based on your requirment.

b. Select the Image Source - Database.
 * We are using the image froma database fields.

c. Use this field - =Convert.ToBase64String(Fields!Company_Picture.Value)
 * Company_Picture is the Name that i have given in above stage which adding in dataset.

d. Use this MIME Type - image/jpeg

SIZE - Fit to Size.



Place the image in the location where you want to place it, as shown below.



Save the Report and try to Run the Report.



I guess we have achieved what we have planned for. I hope you will find the post useful and will share the same with other.

The standard report with image is available in my sky drive, if you want download it from Skydrive Folder.

File Name - Add_Image_Report_V2013R2_Report_405.rar

Regards,
Saurav Dhyani
saurav-nav.blogspot.com

Comments

  1. Hello Saurav, Can you please help me the Image URL from database? I have following sql and want the Image URL field from [Record Link] table.
    SELECT dbo.[CRONUS Canada, Inc_$Purchase Header].[Pay-to Vendor No_], dbo.[CRONUS Canada, Inc_$Purchase Header].[Order Date],
    dbo.[CRONUS Canada, Inc_$Purchase Header].[Posting Date], dbo.[CRONUS Canada, Inc_$Purchase Header].[Location Code], dbo.[CRONUS Canada, Inc_$Purchase Header].[Currency Code],
    dbo.[CRONUS Canada, Inc_$Purchase Header].[Vendor Invoice No_],
    dbo.[CRONUS Canada, Inc_$Purchase Header].[Buy-from Vendor Name], dbo.[CRONUS Canada, Inc_$Purchase Line].No_,
    dbo.[CRONUS Canada, Inc_$Purchase Line].Description, dbo.[CRONUS Canada, Inc_$Purchase Line].Quantity, dbo.[CRONUS Canada, Inc_$Purchase Line].[Unit of Measure], dbo.[CRONUS Canada, Inc_$Purchase Line].[Unit Cost (LCY)], dbo.[CRONUS Canada, Inc_$Purchase Line].Amount,
    dbo.[CRONUS Canada, Inc_$Purchase Line].[Line Discount Amount], dbo.[CRONUS Canada, Inc_$Purchase Line].[Quantity Invoiced],
    dbo.[CRONUS Canada, Inc_$Purchase Line].[Receipt No_]
    FROM dbo.[CRONUS Canada, Inc_$Purchase Header] LEFT OUTER JOIN
    dbo.[CRONUS Canada, Inc_$Purchase Line] ON dbo.[CRONUS Canada, Inc_$Purchase Header].No_ = dbo.[CRONUS Canada, Inc_$Purchase Line].[Document No_] AND
    dbo.[CRONUS Canada, Inc_$Purchase Header].[Document Type] = dbo.[CRONUS Canada, Inc_$Purchase Line].[Document Type]

    Thanks much
    Sandip

    ReplyDelete
    Replies
    1. Hi Sandip,
      Didn't understand your query. Please send me details about what you need on postsaurav@gmail.com

      Delete

Post a Comment

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.