Report - Item Picture

rico1931
Member Posts: 295
Hi Folks,
New guy here and trying to get my Nav set up for my company.
I currently have a report that works exactly the way I want in classic. Now its time to make it work in the RTC... I read a lot of people saying don't do the "layout suggest" <--since it's a complicated invoice report .. and did it from scratch..
The problem in RTC is that my Item image is no displaying. I set the visibility (in classic as "Yes" and RTC Hidden as False).
The variables are all there and working in classic but for some reason when I insert the picture variable into the RTC it shows up with a red "X" (attached image) .
Would any one have any clue what I am doing wrong?
New guy here and trying to get my Nav set up for my company.
I currently have a report that works exactly the way I want in classic. Now its time to make it work in the RTC... I read a lot of people saying don't do the "layout suggest" <--since it's a complicated invoice report .. and did it from scratch..
The problem in RTC is that my Item image is no displaying. I set the visibility (in classic as "Yes" and RTC Hidden as False).
The variables are all there and working in classic but for some reason when I insert the picture variable into the RTC it shows up with a red "X" (attached image) .
Would any one have any clue what I am doing wrong?
-rico1931
0
Answers
-
you need to encode the value equal ==Convert.FromBase64String(Code.GetPicture(1))
and in body section you need to put the hidden text box
=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)
Take a look at std NAV report for examples.0 -
Thanks ara2n ... quick question
in ==Convert.FromBase64String(Code.GetPicture(1))
do u only need (1) "="
Also where you state "Code.GetPicture" would Code be something like "Fields!Item_Picture.Value"
name of the variable is "Item_Picture" for me...or do you really mean "Code.GetPicture"?
I have been following this blog step by step and it worked find for my company logo but its not working for my Item images in my body.. I have attached a screen shot of the code in the body if someone can take a look and tell me where im going wrong. This is driving me INSANE!
Thanks again.-rico19310 -
Belias wrote:don't call me sir, please...i'm still 23
anyway, try to move the textbox with setpicture in the rdlc designer in the cell above the one with converttobase64
just tried it and nothing.. its weird.. i'm starting to think its my code in classic client but the report looks exactly the way i want it to look in classic..
I feel also like i'm missing one simple step and i'm just not seeing it.. 3 days at looking at this is really starting to take its toll ](*,)-rico19310 -
Belias wrote:what about the code of setpicture and getpicture functions?
Got it directly from the Blog that I used to set my company logoShared 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
-rico19310 -
-rico19310
-
you've made it wrong: the setpicture mustn't be done on the item_picture, but on the Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)
basically, you're going to have
=setpicture(convert.tobase64(item_picture)) //i abbreviated the formula, but i think you understood what i mean
and put it in the cell above the picture
the picture instead is OK0 -
Belias wrote:you've made it wrong: the setpicture mustn't be done on the item_picture, but on the Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)
basically, you're going to have
=setpicture(convert.tobase64(item_picture)) //i abbreviated the formula, but i think you understood what i mean
and put it in the cell above the picture
the picture instead is OK
oh geeze.. I think I know what you mean but I tried changing it and still came up empty handed.. I just want to thank you again Belias for helping me out on this. i know we are close! i'm just so new to this and still reading the books on nav that its getting frustrating.
Attached I put in a screen shot of what I think you meant in the abbreviated formula.-rico19310 -
ok now I get what you mean!!! in the attached screen shot and it works!!!!!!!!!!!!!!!!!! THANK YOU!!
I OWE YOU BIG TIME!-rico19310 -
[-X
i meant
=code.setpicture(Convert.tobase64string(fields!item_picture.Value)) //adjust the upper/lowercase
just in one textbox!
because before you wer doing this:
1. setpicture on item_picture (this saves the value of the item_picture field)
2. convert the value to base64 (but this gets lost because you don't have saved it)
3. show the picture through decodifying the UNCODIFIED value you saved with setpicture! <-- big X instead of the pic
with my formula, you're instead doing
1. setpicture on the converted value of the item_picture (thus you save the converted value of the picture field)
2. show the picture through thecodifying the CODIFIED value you saved with setpicture!
EDIT: ok, you got it :thumbsup: but delete the first cell, it's useless...just maintain the concatenated formula
you're welcome!0 -
you only need setcode and getcode if you are printing in Header section.
In body section. converting it from string should be sufficient.0 -
ara3n wrote:you only need setcode and getcode if you are printing in Header section.
In body section. converting it from string should be sufficient.
"=Fields!Company_Information_Picture.Value" is enough...no conversion at all is needed.
i guess that the confersion from string is only needed if you have a textbox in classic layout that refers to the picture field, instead of having a picturebox that refers to the field.
The conversion process and (as ara3n said) the set/getpicture is only needed when you print the image in header/footer.0 -
Very Usefull!
Thanks!
:P~Rik~
It works as expected... More or Less...0
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