Hi everybody, I'm new in this forum. Really I'm new also in NAV...
Recently I tried to modify the report 206, for adding a company image but I can't understand why it doesn't work.
Really I saw that in report 206 depending on setting Sales setup the company logo should be visible at left, right or center, but unfortunately in my case wasn't visible.
By the way I cancelled the 3 picture box in the sections view and I have added a new picture box with source expression set to: MyCompInfo.Picture. In Globals I added a Variable called MyCompInfo based on record "Company Information".
On prereport I added "MyCompInfo.CALCFIELDS(Picture);"
Running report in classic version it's correct!
During design in VS2008 I added a textbox, in the body section, with value set to: "=System.Convert.ToBase64String(Fields!MyCompInfo_Picture.Value)"
Save
compile
and run... but instead of viewing report with a text box populated by the 64Basestring I saw a simple "#Error" ???
I hope any one can help me to understand why my Picture seems to be NULL...
Thanks in advance and sorry form my English!
Cecco
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MyCompInfo.Get;
MyCompInfo.CALCFIELDS(Picture);
On both "OnPreReport" and "OnInitReport", but only in the Classic it works fine
2. Select “View / Layout”
3. Add textbox with following values in Body:
Value: “=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)”
Name: “CompanyPicture”
Visibility Hidden: “True”
Color: “Red”
4. Add the following 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>""
PictureData = NewData
end if
End Function
5. Add textbox to Page Header. Note! This textbox has to be placed above the Picture control added in next step.
Value: “=Code.SetPicture(ReportItems!CompanyPicture.Value)”
Visibility Hidden: “True”
Color: “Red”
6. Add picture control to Page Header with these Values
Value: “=Convert.FromBase64String(Code.GetPicture())”
Source: “Database”
MIMEType: “image/bmp”
7. Save and Compile
8. Run report
Regards,
Claus
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
I don't know what is the problem, but I think it's appens before processing the report.
If I leave Visibility.Hidden = false on TextBox "CompanyPicture" during the preview (instead of viewing the 64baseString with incomprensible ascii chars sequence) in the place where I puted the textBox appears an "#Error" string.
If you want I can send you my report "206.fob"
Best Regards
Cecco
Regards,
Claus
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
Please find the updated blog here: http://blogs.msdn.com/nav-reporting/archive/2009/02/05/how-to-add-a-company-picture-to-a-report.aspx
Regards,
Claus
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
RIS Plus, LLC
I think What DenSter says it's very interesting...
Regards
Cecco
I second this! =D>
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
The new report design tool in VS is driving up the wall, and I can't find good documentation on it, anywhere. There are a few tutorials which are helpful, however nothing that covers enough basics in my opinion.
So far its been trial and error.
t
When the course is ready I will update this thread.
Regards,
Claus
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
t
Cecco
Regards,
Claus
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
http://blogs.msdn.com/b/nav/archive/200 ... eport.aspx
on the step 8
8. Now lets add this to the report. We need to add the Company Picture first as a TextBox to the body of the report. This will enable us to use it in the Page Header. We add this Textbox in top of the Body.
you will put not on the body simply you must create new raw above the existing row on the body and put that in the row. believe me it will work.
you know the logic is correct that you add the code on the property window like "set" and "get" function. but why you see the X image inisted of the logo. that is you must put the text box inside the new row. ok =D>
Michael B.
In the directions I followed (http://blogs.msdn.com/b/nav/archive/200 ... eport.aspx) it says:
5. Now we should add a Picture Box on the Sections with SourceExpr: CompanyInfo.Picture.
Since it didn't specify where to drop it in sections, I just dumped it in there randomly. Turns out that was my problem. Instead, we moved the picture box to the top of sections (if you look closely at the example, he puts it in the header). Problem solved!!