RTC Report, add Picture to Header

RomRom Member Posts: 64
edited 2011-08-26 in NAV Three Tier
Hi,

i have a problem with my report, which i create from the scratch.

I'd like to add the company picture. But i do not like to use the embedded version. I did it, like it is done in the Standard report 206.
In Classic Client I already see the company picture, so i guess the calcfields for the picture should work. The set and get method i copied from the report 206. The Datasetfieldname is also correct, because i'd used the Dataset Result to add it the value expression.

In list of the body I added on the top the textbox/table for the conversion of the field with this value
=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)
. On the top of the header I added the set method as a textbox with the following value
=Code.SetPicture(ReportItems!CompanyInfo_Picture.Value,1)
. The picturebox itself has this value
=Convert.FromBase64String(Code.GetPicture(1))

My problem now is, that "=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)" returns an error, but have no idea why? Normaly if i do not hide it, I could see the String in the preview!?!?

Does anybody have an idea, what I did wrong?

Thanks in advance!
Martin

PM: I added I screenshot from the VS.

Comments

  • BeliasBelias Member Posts: 2,998
    i didn't understand if the convert.tobase64string textbox is hidden or not.
    You must hide it, otherwise the report gets crazy! :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • RomRom Member Posts: 64
    Belias wrote:
    i didn't understand if the convert.tobase64string textbox is hidden or not.
    You must hide it, otherwise the report gets crazy! :mrgreen:

    I tried it hidden and not hidden.
  • BeliasBelias Member Posts: 2,998
    edited 2011-02-18
    and what's the error?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • RomRom Member Posts: 64
    if I do not hidden the convert - Textbox, it prints #error, other errormessage i did not get.
  • BeliasBelias Member Posts: 2,998
    i've just seen that the mime type is jpeg, it must be bmp!
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • RomRom Member Posts: 64
    already in the cc or only in the rtc
  • BeliasBelias Member Posts: 2,998
    take a look at the screenshot you've posted: there's property mimetype of the picture in the rdlc, change it to bmp
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • RomRom Member Posts: 64
    this one i change to bmp, it doesn't work!
  • BeliasBelias Member Posts: 2,998
    edited 2011-02-18
    Normaly if i do not hide it, I could see the String in the preview!?!?
    why did you wrote this?what does it happen if you don't hide the textbox?
    did you check the "about this report" in order to see if the picture field is evaluated when you're printing it?
    edit: Yes mohana, your suggestion is the bettter :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • RomRom Member Posts: 64
    i'd seen it in other report, i develop.
  • RomRom Member Posts: 64
    i tried to repuild the picture box again, with this http://blogs.msdn.com/b/nav/archive/200 ... eport.aspx documention. It doesn't work :cry:
  • BeliasBelias Member Posts: 2,998
    Rom wrote:
    i'd seen it in other report, i develop.
    but what about THIS report: what do you see in the textbox with convert.tobase64string if you DON'T hide it?Do you see a blank textbox?does the report errors out?did you check the "about this report"?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • dave_cdave_c Member Posts: 46
    I'm having the same problem with one of my reports at the moment. I've attached some screen shots. Screenshot1 shows my code, screenshot2 shows the error it produces. Very helpful as you can see.

    Screenshot3 shows the output of the same code on another report. I'm trying to show the company logo in both reports using the same code in the classic client and the image show fine in the classic client in both reports. Without a better error I'm not really sure how to continue.
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    dave c wrote:
    I'm having the same problem with one of my reports at the moment. I've attached some screen shots. Screenshot1 shows my code, screenshot2 shows the error it produces. Very helpful as you can see.

    Screenshot3 shows the output of the same code on another report. I'm trying to show the company logo in both reports using the same code in the classic client and the image show fine in the classic client in both reports. Without a better error I'm not really sure how to continue.

    What is the value of the Picture Field in the About This Report?
    the right value is '*'
    ~Rik~
    It works as expected... More or Less...
  • dave_cdave_c Member Posts: 46
    Yeah, I've got a "*" on all three rows.
Sign In or Register to comment.