none
Displaying boolean values as checkbox image. RRS feed

  • Question

  • Hi all,

    I want to display a boolean value on my report as checked or uncheked  checkbox. Checkbox images are embeded. Couldn't manage the pick up correct image and displaed on the reportview. Any help appreciated.

     

    Flatwhite

    Monday, July 23, 2007 1:09 PM

Answers

  •  

    Hi,

     

    I do not know whether you have solved the issue or not.

     

    But here is the way how accomplished the same.

     

    I have to display a tick mark if the boolean flag is true.

     

    So in the table added a image(which is already embedded in the report), and then set the visiblity property to the following expression

    Code Snippet

    "=iif(Fields!Available_Flag.Value,false,true)"

     

     

    So if the tick mark will appear in the report if the Structure_Requires_Serving_Office_Flag.Value comes out as true and blank if the value is false.

     

    If you have solved the problem in a different manner, can you share the same so that others can gain some input.........

     

    But even nyashaC's Solution is working fine, just that you can keep the fields size to 15pt so that the image is looking fine....................

    Wednesday, August 8, 2007 12:34 PM

All replies



  • I have a class list report which has to display a absent field as a checkbox.
    All you really have to do is use an expression as follows

    = iif( Fields!absent.Value , Chr(254), Chr(168))

    AND THEN  change the font  to wingdings for that particular display field (NOT FOR THE WHOLE REPORT!!!)

    I have forgotten the site where i got the solution but they obviously deserve attribution.
    Wednesday, August 1, 2007 7:37 AM
  •  

    Hi,

     

    I do not know whether you have solved the issue or not.

     

    But here is the way how accomplished the same.

     

    I have to display a tick mark if the boolean flag is true.

     

    So in the table added a image(which is already embedded in the report), and then set the visiblity property to the following expression

    Code Snippet

    "=iif(Fields!Available_Flag.Value,false,true)"

     

     

    So if the tick mark will appear in the report if the Structure_Requires_Serving_Office_Flag.Value comes out as true and blank if the value is false.

     

    If you have solved the problem in a different manner, can you share the same so that others can gain some input.........

     

    But even nyashaC's Solution is working fine, just that you can keep the fields size to 15pt so that the image is looking fine....................

    Wednesday, August 8, 2007 12:34 PM
  • Crystal report does not have any check box  control.

     

    What i use to do for this kind of scenario is add two images (i.e Checked and UnChecked state of checkbox)

     

    first on the properties of Checked image there is a button like "x-2" infront of Supress option. Click on that button and write the following code

     

    IF {Field1234}=0 then

    false

    else

    true

     

    do the same with unchecked image

     

    IF {Field1234}=0 then

    trie

    else

    false

    Thursday, August 9, 2007 10:00 AM
  • Thanks for replies. I couldn't come up with a solution anything better than yours. In my case checkbox wasn't a necessity so I used coloured textual representation. I couldn't find a way to mark one of your suggestions as an answer. Sorry.

    Monday, August 13, 2007 7:24 PM
  •  

    Its nice that your problem has been resolved, i think to mark my question as answer you have to login and then you can see a answer button on my reply or you can click on Was this post helpful ?   Yes button. It is better to mark correct answers so that other can also see them to resolve their issues.
    Wednesday, August 15, 2007 4:35 AM
  • hi;

    how to change boolean values true to 1 and false to 0, for pass the value 1 to my sql db.

    Friday, August 17, 2007 1:42 AM
  • I am not sure what you are trying to do you can do this by creating a formula as mentioned in my earlier post. Plz write complete scenario so i can  give you a better sugession.

    Friday, August 17, 2007 4:39 AM
  • Hello nyashaC

     

    The solution you offered back on August 1st on MSDN solves most of my problems as well except for one,

    I can create the report just fine and this solution is perfect, but then I must export the report via PDF.  One fo the reason I wish to use this tool is the ability to export to PDF.  It seems as though this font "wingdings" is not supported in the Adobe PDF platform   I read a couple of posts below yours and don't really understand how to link to or imbed to an image...

    - any ideas to an alternative - or a solution?

     

    Almost there!

     

    Thanks ahead,

     

    Dan Acton

    Thursday, September 6, 2007 7:46 AM
  • Ok, I solved my own problem, but for anyone who needs to export their report to Adobe Acrobat (PDF) - you will want to use the following ASCII characters if you wish to create the report in PDF

     

    Problem: Adobe would not recognize the symbols (Chr(254), Chr(168) in order to assign the Wingdings checkbox font images.

     

    Solution: Use the following ASCII characters in place of:  (Chr(82), Chr(84) which translate to the simple "R" and "T" respectively.  Then instead of formatting the table cell font to "Wingdings" - use "Wingdings 2" instead.

     

    Now the report will publish in PDF, since all it needs to recognize is the common "R" and "T" values.

     

    So the wonderful solution posted by nyashaC would be as follows:

     

    = iif( Fields!absent.Value , Chr(82), Chr(84))  --- with a wingdings 2 font

    Thursday, September 6, 2007 8:24 AM
  • hi,all
      i faced the same problem and i searched alot,but i didn't find any solution
     till i find the solution here,thanks alot
      but i have another problem when i export the report via PDF ,i have a record like 22,33,0 when it's exported it come 0,33,22. i don't know why.  i need anyone help me please as it is urgent to me to solve it as soon as passsible
    and i want to know if there is an expression like
    (= iif( Fields!absent.Value , Chr(82), Chr(84))  --- with a wingdings 2 ) to display a radiobutton in a report
    Tuesday, August 18, 2009 7:59 AM