Normal Topic Boolean Field in Simple report (Read 752 times)
JimboP
Member
*
Offline



Posts: 3
Location: Oakville ON
Joined: Jul 28th, 2007
Boolean Field in Simple report
Aug 25th, 2007 at 4:02pm
Print Post Print Post  
As a newcomer to Sesame I am having difficulty having the results of a checkbox element show in a simple columnar report.

I have tried showing the field as a Value element in the report,
and as an Unbound Value with the simple formula
If LE1(bound to checkbox)  >0 then LE2 = "YES"
Neither one shows up with anything on the report though there are checkboxes marked in the database.

What might I be doing wrong here?

Jim
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Boolean Field in Simple report
Reply #1 - Aug 25th, 2007 at 5:46pm
Print Post Print Post  
Hi Jim,

Welcome to Sesame, and to the forum.

Your code is correct, mostly. You should also have a conditional to account for what should be done if LE1 is NOT >0. Something like this:
If LE1 > 0
     LE2 = "Yes"
Else
     LE2 = "No"     // Or LE2 = "", if you prefer.


But, your real problem sounds like you have the code in the wrong event. It needs to be in either the LE1 or LE2 event. If it is in an event before LE1, it will always return "No" because the report engine has not seen LE1 yet, resulting in it being blank (or zero). And if the code is in an event that is after LE2, LE2 will always be blank because you are trying to assign a value to LE2 after it has already been processed.

FYI, when I refer to an event being before or after another, I am referring to the order that they appear in the "Element:" drop down box in the Program Editor.

Let me know if my assumption, that the code is in some other event, is correct.




  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Boolean Field in Simple report
Reply #2 - Aug 25th, 2007 at 9:01pm
Print Post Print Post  
Hi Jim, welcome to our family.

I understand that this is a report?

Version 2 Report Wizard uses Field Names, not element names.  (Many times they are the same, but not always, but you control that).  The Wizard makes the element names on the Report the same as the Field names, but they may be different from element names you have on your forms.

Carl's suggestion to use ELSE is good programming design in any case.  This will allow you to force a value into the element.

----------------------------------------------------------
But I suspect this is the answer you want:

If you just select the field for the checkbox, and insert it into a column, you should see it's value from the database.  Now select the element on the report.  Go to the Property Editor/Tab=Format.  Select Custom Format.  Select from "True/False", "T/F"; "Yes/No"; "Y/N"; "1/0"; "On/Off"

No programming required to display the checkbox value, just select the format you want.

----------------------
Edited on 8/27/07.  Content above re field/element names was corrected, as Ray pointed out in subsequent posting.  Thanks again Ray.
« Last Edit: Aug 28th, 2007 at 12:23am by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Boolean Field in Simple report
Reply #3 - Aug 25th, 2007 at 10:01pm
Print Post Print Post  
Bob_Hansen wrote on Aug 25th, 2007 at 9:01pm:
If you just select the field for the checkbox, and insert it into a column, you should see it's value from the database.  Now select the element on the report.  Go to the Property Editor/Tab=Format.  Select Custom Format.  Select from "True/False", "T/F"; "Yes/No"; "Y/N"; "1/0"; "On/Off"

No programming required to display the checkbox value, just select the format you want.

Bob's answer is better.

I got distracted trying to answer why you weren't seeing the results you expected. In any case, the combination of ideas here on the forum will help you to accomplish almost anything you want with Sesame.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Boolean Field in Simple report
Reply #4 - Aug 27th, 2007 at 1:29pm
Print Post Print Post  
Bob_Hansen wrote on Aug 25th, 2007 at 9:01pm:
Report programming uses Field Names, not element names. 


Hello Bob,

Report Programming uses Element Names same as Form Programming does. It just uses the name of the elements on the Report as opposed to the name of the elements on the Form.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Boolean Field in Simple report
Reply #5 - Aug 28th, 2007 at 12:17am
Print Post Print Post  
Oops ..... Report Wizard shows Field Names, vs. Element names. 
I was working with that recently, and was surprised because did not have wizard in 1x, and started thinking this was a change because I saw the field names, vs. the element names.  Had a Senior moment there for a moment.

Sorry about that, I have corrected earlier message.  Thanks.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
JimboP
Member
*
Offline



Posts: 3
Location: Oakville ON
Joined: Jul 28th, 2007
Re: Boolean Field in Simple report
Reply #6 - Aug 29th, 2007 at 2:23am
Print Post Print Post  
Thanks all for your prompt replies.

Bob's answer seemed to clear things up.
I will take note to use an Else to force a reply in future also.

I must admit to a further problem I dug up which was that the element was tied to a boolean field but the "bound to" type did not revert to boolean automatically and was still set to TEXT. When I set it to Boolean it started displaying.

Thanks again for your assistance.

Jim
  
Back to top
 
IP Logged