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?
0
Answers
http://www.BiloBeauty.com
http://www.autismspeaks.org
Just a guess...
Lead Consultant
Theta
You could try adding the code under "OnPreSection" trigger rather than "OnPreReport".
Dynamics NAV Enthusiast
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'.
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.
RIS Plus, LLC
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 again
RIS Plus, LLC