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
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
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.
ReplyDeleteSELECT 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
Hi Sandip,
DeleteDidn't understand your query. Please send me details about what you need on postsaurav@gmail.com