Pictures in report RTC

D4rkoD4rko Member Posts: 10
edited 2012-02-21 in NAV Three Tier
I use Visual Studio for my RTC reports.

I have two pictures in my body, I use a boolean to know which image is visible or not. Either one or the other. But both images owe beings situated in the same place and repeated on all the pages in the header of a board. But when I stack the images my boards also overlap... What is the problem and how to resolve it?

Thanks

Comments

  • BeliasBelias Member Posts: 2,998
    For these kind of problems, it's useful to have a printscreen of the layout.
    anyway, about your boolean variable: did you add a textbox in your classic report in the correct place, with sourceexpr = yourbooleanvariable?
    if so, did you bound this variable to the hidden property of the images? if so, be careful that if hidden property = true, it means that the field is not visible. This is tricky because in classic report, the logic of visibility is reversed...
    classic --> visible property
    rtc --> hidden property
    if all these does not solve your problem, please explain it more clearly, maybe with a screenshot :wink:
    good luck
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • deV.chdeV.ch Member Posts: 543
    if you stack these pictures you may need to set the height of the images to a small value but set the image mode to autosize (don't remember exatly how it's called).
    otherwise if the pictureboxes reserve the space for both of them, even if you don't display the box. (Or if you have these boxes in a table, just put both pictures on their own rows and mange the visibility of the whole row)

    but like belias said, a screenshot would be alot better to see where the problem is.
  • D4rkoD4rko Member Posts: 10
    edited 2010-10-27
    101027021512682510.jpg

    You can see on this picture:
    I have two différente images on my report
    - One with visibility expression: =IIf(Fields!PictureBool.Value=false,false,true)
    - An other with visibility expression: =IIf(Fields!PictureBool.Value=true,false,true)
    I have a variable PictureBool (TRUE or FALSE)
    I have two bords:
    - Table_lines with header line that I repeat on each page.
    - Table_TVA

    I need to show either one or the other images in the same place.
    The probleme is when I stack my images and use the property RepeatWith Table_Lines, the Table_TVA board board settles on the page and overlaps with Table_lines board.

    When I place my images as on the image at the top, it works but if I have several pages then on the second page the image changes place.
  • D4rkoD4rko Member Posts: 10
    deV.ch: I try the Autosize property but it doesn't work.

    Otherwise is there a solution to use just one field for my two picture and to choose wich picture is show in the standard?
  • BeliasBelias Member Posts: 2,998
    the image overlapping is something i couldn't be able to solve yet...did you already try to put the image in a list together with the table other tables, instead of using repeat with?
    somethig like
    __________
    |image1&2
    |table1
    |table2
    |
    |
    |
    __________

    Pipelines and underscores represents the list... :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • deV.chdeV.ch Member Posts: 543
    yeah you can use only one picturebox just use a iff statement as you have done with the visiblity, something like this:

    IIf(Fields!PictureBool.Value=true,Fields!<Picture1>.Value,Fields!<Picture2>.Value)

    i haven't tried this but it should work.
  • D4rkoD4rko Member Posts: 10
    Thank you Belias, you directed me to the good solution! I put an image in a table which I show or not according to the boolean and the other image I left it above with the property RepeatWith Table_Lines. And it works!
  • D4rkoD4rko Member Posts: 10
    deV.ch wrote:
    yeah you can use only one picturebox just use a iff statement as you have done with the visiblity, something like this:

    IIf(Fields!PictureBool.Value=true,Fields!<Picture1>.Value,Fields!<Picture2>.Value)

    i haven't tried this but it should work.

    I have ever try this but it doesn't work, don't know why... :-k
  • BeliasBelias Member Posts: 2,998
    deV.ch wrote:
    yeah you can use only one picturebox just use a iff statement as you have done with the visiblity, something like this:

    IIf(Fields!PictureBool.Value=true,Fields!<Picture1>.Value,Fields!<Picture2>.Value)

    i haven't tried this but it should work.
    :thumbsup: #-o
    We've spent so much time with classic report designer, that sometimes we're developing rdlc like we would have done with classic
    btw, this shouldn't solve the overlapping problem :-k
    edit1: oh, i've seen you've solved the problem, but be sure tu try devch solution, too...it is far better
    edit2: ok, you tried it...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • deV.chdeV.ch Member Posts: 543
    hmm too bad it doesn't work :-k , but what could be the trick is to use a textbox which has the IIF statement but with a base64 converstion and on the picturebox you get the value from that textbox and convert it back again from base64.

    (just a hint if someone runs in the same problem)

    ... anyway good you got it working :thumbsup:

    Edit: I gave it a try and it works fine with my initial solution. Here's my code:
    =IIF(Fields!Bool.Value=True,Fields!Item1_Picture.Value,Fields!Item2_Picture.Value)
    
  • D4rkoD4rko Member Posts: 10
    deV.ch wrote:
    hmm too bad it doesn't work :-k , but what could be the trick is to use a textbox which has the IIF statement but with a base64 converstion and on the picturebox you get the value from that textbox and convert it back again from base64.

    (just a hint if someone runs in the same problem)

    ... anyway good you got it working :thumbsup:

    Edit: I gave it a try and it works fine with my initial solution. Here's my code:
    =IIF(Fields!Bool.Value=True,Fields!Item1_Picture.Value,Fields!Item2_Picture.Value)
    

    OK I try again and it work now... It's a better solution. Thanks :thumbsup:
  • azerty74azerty74 Member Posts: 82
    Please be aware that although the RepeatWith property looks very interesting when previewing, it doesn't work in pint layout and it also doesn't work when exporting a report to pdf (or xls). :!:
    Debugging is twice as hard as writing code. Therefore if you write the code as cleverly as possible you are by definition not smart enough to debug it.
Sign In or Register to comment.