Translation of True/False

Posted by: jatrules07 on 3 August 2017, 3:21 pm EST

  • Posted 3 August 2017, 3:21 pm EST

    Hello <br>I have  input values from my XMLprovider as<br>field1 is true<br>on report it shows as;<br>  Header                           field1<br> My name is changed  :   True<br>  New name : ABCD<br>  Reason to change: Reasonabcd<br><br>I want to show Yes or No on the output rather than True or False.<br>Also want to hide<br>NewName and Reason if field1 value = false and display NO<br><br>Please advice.<br>Jess<br>
  • Replied 3 August 2017, 3:21 pm EST

    Sorry I just figured out again that by setting the value of  field in a cell of table or text box like the following<br><br>=iif(Field1.Value = True,"Yes", "No") , always returns, "No", even if I select Yes or No during the runtime.<br><br>I always see "No " as output result, regardless the input that has been provided.<br><br>Please advice.<br>Jess<br>
  • Replied 3 August 2017, 3:21 pm EST

    Hello,<br><br>You need not use a hidden column in your table, there is another approach to accomplish the same i.e using the field value as you did above. All you need to do is remove the quotes from True in the if expression, as the XML provider is implicitly converting the True or False to boolean values and you would get the correct results. Please refer to the modified report that depicts the same.<br><br>Hope it will help you. Please let me know if you have any queries further.<br><br>Thanks,<br>Manpreet Kaur<br>
    2012/10/YesNoReport1.rdlx
  • Replied 3 August 2017, 3:21 pm EST

    Sorry  I am not able to replicate the same.<br>I am not able to have the hidden column added. Can you please provide some way to do that<br>Also when I am  passing like =iif(Field9.Value = "True","Yes", "No").<br>It is always returning "No" always even if  Field9 = true.<br><br>Please advice.<br>Jess<br>
  • Replied 3 August 2017, 3:21 pm EST

    Hello,<br><br>You would need to create an extra hidden column in the table whose field is set to field1 having values True or false and using the same you can alter the text in the column i.e actually displaying the field1.<br><br>And you can change the visibility of the remaining two fields by setting an expression in the visibility property of the textboxes displaying these fields.<br><br>Please have a look at the attached sample report that depicts the same. Hope it will help you. Please let me know if you have any queries further.<br><br>Thanks,<br>Manpreet Kaur<br>
    2012/09/YesNoReport.rdlx
  • Replied 3 August 2017, 3:21 pm EST

    Assuming that the data you are retrieving is being pulled up correctly, I have prepared a small and simple test report. That actually takes the True / False value from the parameter. I would like to check if the data you're getting is not in string format, otherwise it may behave the way yours does.<br><br>I hope this helps you<br><br>Thanks,<br>-ATalati<br>
    2012/10/Report1.rdlx
  • Replied 3 August 2017, 3:21 pm EST

    Your attached report is working fine.<br>But the similiar way does not allows for convertion to the desired input XML value for my report.<br>here is similar sample<br>as follows:<br><br>Query: //Root/subroot<br><br><u><b>Column1</b></u>     <u><b>Column2</b></u><br>Header1        Feild1 <br>Header2        Feild2<br>Header3        Feild3<br>Header4        Feild4<br><br>The XML contains<br>    <Root><br>        <subroot><br>               <Feild1>True</Feild1><br>               <Feild2>True</Feild2><br>               <Feild3>False</Feild3><br>         </subroot><br>    </Root><br>   <br><br>But the Output is :<br><u><b>Column1</b></u>     <u><b>Column2</b></u><br>Header1        Yes<br>Header2        Yes<br>Header3        Yes<br>Header4        Yes<br><br>Desired Output should be<br><br><u><b>Column1</b></u>     <u><b>Column2</b></u><br>Header1        Yes<br>Header2        Yes<br>Header3        No<br><br>The problem is even I provide the values in the properties for the Field(1-4) '  <b>=IIF( ToBoolean(0)=True, "Yes", "No"</b>)   '<br><br>The output is always Yes.<br>Also It is not filtering the Header4 as the XML does not contain the Header4 , it is not provided at all, but still it shows up with True Value only, i.e; "Yes".<br><br>Do you have some way to handle this situation as my XML can grow or shrink based on the input selection at the runtime, because to handle this I have to write a big chunk of code.<br><br>Thanks<br>Jess<br>
  • Replied 3 August 2017, 3:21 pm EST

    Thanks for the response Atalati,<br><br>Well the input I am getting from XML provider is String data.<br>So I'm using as:<br> number(Field1) <br>in the query page of the dataset, still the above value is not returning the correct value as per the input.<br>the output comes as <br>if i put the expressin as :  =iif(Field1.Value = True,"Yes", "No")<br>                                           the output is always :  " Yes"<br><br>if i put the expression as :  =iif(Field1.Value = True,"No", "Yes")<br>                                           the output is always :  " No"<br><br>Also would like to ask as I have a 3 sets of table with 6-7 fields each returning true or false provided by the XML provider.<br>How can I handle these?<br><br><br>Please explain.<br><br>Thanks,<br>Jess<br><br><br>
  • Replied 3 August 2017, 3:21 pm EST

    I simply copied and pasted the expression that you just gave but mine does say "No"
    <br />
    <br />Attached is the conerned report.
    <br />
    <br />HTH
    2012/10/Report1-3.rdlx
  • Replied 3 August 2017, 3:21 pm EST

    It did not worked, any how I modified my code to have it fixed for DBNull values or field that have no information in the  input XML.<br><br>Thanks<br>Jess<br>
  • Replied 3 August 2017, 3:21 pm EST

    You meant to say the attached report is not working ?
  • Replied 3 August 2017, 3:21 pm EST

    <BLOCKQUOTE><table width="85%"><tr><td class="txt4"><img src="/wp-content/uploads/CS_images/icon-quote.gif"> jatrules07 wrote:</td></tr><tr><td class="quoteTable"><table width="100%"><tr><td width="100%" valign="top" class="txt4">Thanks for the response Atalati,<br><br>Well the input I am getting from XML provider is String data.<br>So I'm using as:<br> number(Field1) <br>in the query page of the dataset, still the above value is not returning the correct value as per the input.<br>the output comes as <br>if i put the expressin as :  =iif(Field1.Value = True,"Yes", "No")<br>                                           the output is always :  " Yes"<br><br>if i put the expression as :  =iif(Field1.Value = True,"No", "Yes")<br>                                           the output is always :  " No"<br><br>Also would like to ask as I have a 3 sets of table with 6-7 fields each returning true or false provided by the XML provider.<br>How can I handle these?<br><br></td></tr></table></td></tr></table></BLOCKQUOTE><br><br>I think the way you're trying to handle it, might not be correct. I would like you to use the inbuilt capability for String to Boolean conversion. Attached is the modified report...<br><br><BLOCKQUOTE><table width="85%"><tr><td class="txt4"><img src="/wp-content/uploads/CS_images/icon-quote.gif"> jatrules07 wrote:</td></tr><tr><td class="quoteTable"><table width="100%"><tr><td width="100%" valign="top" class="txt4"><br>Also would like to ask as I have a 3 sets of table with 6-7 fields each returning true or false provided by the XML provider.<br>How can I handle these?<br></td></tr></table></td></tr></table></BLOCKQUOTE><br><br>I think you have to do the same for all 6-7. if they would be >10, it would be worth for you to spend some time creating function, but to speed up, I'd suggest you to go to the simple way<br>
    2012/10/TrueFalse.rdlx
  • Replied 3 August 2017, 3:21 pm EST

    yes you can use nested if just like you do, in other environments.
    <br />
    <br />=iif(Condition1, iif(Condition2,"C1AndC2","C1butC2"),"Neither")
  • Replied 3 August 2017, 3:21 pm EST

    Thanks for this quick response.<br>It is working as per the input value, it might be failing for other reason. Because I was trying something similiar to this.<br>Or it might be failing because it might be DBNull,<br>I want to include(append) the second expression for this for handling DBNull, or null, not null as I stated in other post for  "Handling DBNull".<br><br>Can you please suggest that can I merge both the expressions for Yes/No and the Dbnull for the same field together.<br><br><br>Thanks<br>Jess<br>
  • Replied 3 August 2017, 3:21 pm EST

    .
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels