NAV 2013: Insert Company Logo into Report
Codingo
Member Posts: 8
NAV 2013 (Update Roleup 4)
Hello Community
I have a problem with a custom report. I copied the ID 405 "Order" (Purchase) to the 50.000 area. The report need the company logo inside.
This is what I have done already:
1. OnInitReport modified:
CompanyInfo.CALCFIELDS(Picture);
2. Add column to Report Dataset Designer
Under the DataItem Integer (PageLoop), I added the column:
......Data Source=CompanyInfo.Picture
......Name=CompanyInfo_Picture
3. (in VS) Added a new Matrix with a single Text Box under
<Report> <Body> <list1> <list1_Contents>
......Matrix Name: CompanyPicture
4. Changed Text Box Properties
- General:
......Name to "CompanyInfo_Picture"
......Value: "=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)"
- Visibility:
...... When the report is initially run: Hide
5. Added a new Text Box under
<Report> <Page Header>
6. Changed Text Box Properties
- General:
......Name to "DataPicture"
- Visibility:
......When the report is initially run: "Show or hide based on an expression"
.........Expression: "=Code.SetPicture(ReportItems!CompanyInfo_Picture.Value)"
7. Added Code to the Report Properties
Shared PictureData as Object
Public Function GetPicture() as Object
Return PictureData
End Function
Public Function SetPicture(NewData as Object)
If NewData > "" Then
PictureData = NewData
End If
End Function
8. Added a Image Item and modified the properties
- General
......Name: CompanyInfo_Picture1
......Select the image source: Database
......Use this field: <<Expr>>
.........Expression: "=Convert.FromBase64String(Code.GetPicture)"
......Use this MIME tpye: image/bmp
Of course the company info has an existing logo. I just get a red cross instead the company logo.
I also read the post Company Picture to RDLC report Header (NAV 2009 R2). But it don't really helped me.
Have you any ideas what I can do?
Best regards
Hello Community
I have a problem with a custom report. I copied the ID 405 "Order" (Purchase) to the 50.000 area. The report need the company logo inside.
This is what I have done already:
1. OnInitReport modified:
CompanyInfo.CALCFIELDS(Picture);
2. Add column to Report Dataset Designer
Under the DataItem Integer (PageLoop), I added the column:
......Data Source=CompanyInfo.Picture
......Name=CompanyInfo_Picture
3. (in VS) Added a new Matrix with a single Text Box under
<Report> <Body> <list1> <list1_Contents>
......Matrix Name: CompanyPicture
4. Changed Text Box Properties
- General:
......Name to "CompanyInfo_Picture"
......Value: "=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)"
- Visibility:
...... When the report is initially run: Hide
5. Added a new Text Box under
<Report> <Page Header>
6. Changed Text Box Properties
- General:
......Name to "DataPicture"
- Visibility:
......When the report is initially run: "Show or hide based on an expression"
.........Expression: "=Code.SetPicture(ReportItems!CompanyInfo_Picture.Value)"
7. Added Code to the Report Properties
Shared PictureData as Object
Public Function GetPicture() as Object
Return PictureData
End Function
Public Function SetPicture(NewData as Object)
If NewData > "" Then
PictureData = NewData
End If
End Function
8. Added a Image Item and modified the properties
- General
......Name: CompanyInfo_Picture1
......Select the image source: Database
......Use this field: <<Expr>>
.........Expression: "=Convert.FromBase64String(Code.GetPicture)"
......Use this MIME tpye: image/bmp
Of course the company info has an existing logo. I just get a red cross instead the company logo.
I also read the post Company Picture to RDLC report Header (NAV 2009 R2). But it don't really helped me.
Have you any ideas what I can do?
Best regards
0
Answers
-
What format is the company logo?
BMP still works best, GIF, JPG etc can be problematic on reports.0 -
The logo is BMP.0
-
Hi Codingo,
Try this:
1. Add CompanyInfo.CALCFIELDS(Picture) to CopyLoop - OnAfterGetRecord
2. Add Column CompanyInfo.Picture to Report Dataset Designer
3. Add Image Item and modify the properties
- General
Name: CompanyLogo
......Select the image source: Database
......Use this field: [CompanyInfo_Picture]
.........Expression: "=Fields!CompanyInfo_Picture.Value"
......Use this MIME type: image/bmp
4. Save & Run
:thumbsup:0 -
Hi amazan,
thank you for your post.
I added the CALCFIELDS under the "CopyLoop - OnAfterGetRecord" Trigger. Now it works!
Thanks alot \:D/0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
