Company logo not printing on report

sandman
Member Posts: 20
A picture is set in the company information form (which shows up on many reports already).
I declared a global variable called "CompanyInfo" pointing on the "Company Information" record.
Code in the "Report - OnPreReport" trigger:
CompanyInfo.GET;
CompanyInfo.CALCFIELDS(Picture);
I added a Picturebox to the 1st section of my report and it's source expression is set as CompanyInfo.Picture. If it matters, the AutoCalcField is set to "Yes".
Yet, the picture is not showing up on my report....
Am I missing anything?
I declared a global variable called "CompanyInfo" pointing on the "Company Information" record.
Code in the "Report - OnPreReport" trigger:
CompanyInfo.GET;
CompanyInfo.CALCFIELDS(Picture);
I added a Picturebox to the 1st section of my report and it's source expression is set as CompanyInfo.Picture. If it matters, the AutoCalcField is set to "Yes".
Yet, the picture is not showing up on my report....
Am I missing anything?
0
Answers
-
Are you sure the picbox is big enuf?0
-
Yes, I first copied it from another report but, when i saw it wasn't working, I created a new one with the same dimension.0
-
Is the rest of the section printing? It may be that there is some code on the OnPreSection of the section header that hides the whole thing?
Just a guess...Edward Bloomfield
Lead Consultant
Theta0 -
Is CompanyInfo record used anywhere else?
You could try adding the code under "OnPreSection" trigger rather than "OnPreReport".Tomas,
Dynamics NAV Enthusiast0 -
No, no and no, NEVER write any code like that in any section triggers.
Make sure that the control is a 'PictureBox', not an 'Image'. Seriously, doublecheck this, go into the property page and verify that it is a PictureBox. Also verify that the SourceExpr is correct. If your "Company Information" record variable is called 'CompanyInformation', then the SourceExpr should be 'CompanyInformation.Picture'. Make sure that the variable name is correct, and that the field reference is correct.
Then, verify that the AutoCalcField property says '<Yes>' and not 'Yes'. If it doesn't have the '<' and the '>', then delete the value, and it will revert to '<Yes>' automatically. Sometimes, NAV gets confused and thinks that the default '<Yes>' means something different than 'Yes'.CompanyInformation.GET; CompanyInformation.CALCFIELDS(Picture);
Put that in OnPreReport and it should display the picture.
If that still doesn't work, then there must be code in your report that clears the CompanyInformation variable. Export the object as text, and do a Find on the variable name.
One more thing.... make sure that your section actually prints. If you put it into the Body section of a dataitem that has no data, it won't print.0 -
Thanks everyone but THANK YOU Denster!
Everything was set properly but after exporting the report in a text file I found, on the first data item, another GET on the record variable which, i'm guessing, nullified the CALCFIELDS function on the report section.
Works now!
Thanks again0 -
Cool excellent, good work. You're right, when it refreshes the record, to make the picture appear you'd need to do another CALCFIELD. It can drive a person crazy when you know you've done the right thing and it still doesn't work0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions