Community
Showing results for 
Search instead for 
Do you mean 
Reply

Using Checkmarks for Yes/No Fields in reports

Tuned Listener
Posts: 7
Country: United Kingdom

Using Checkmarks for Yes/No Fields in reports

Hi
 
Apologies, I have searched for the answer to no luck and hopefully someone can help me with this tedious problem.
 
I am new to scripting and cannot get the following to work within the reports section; 
 
If Wasexpectingourcall1 = -1 Then Custom1.Text=chr(254) 
Else 
Custom1.Text=chr(168) 
End If
 
What I get is the result of the Else command and nothing else i.e chr(168), irrespective of whats in the field.
 
The field names are correct as I have them copied from the properties box.
 
Any help would be greatly appreciated - I am using ACT 2009.
 
Mark 
Tuned Listener
Posts: 7
Country: United Kingdom

Re: Using Checkmarks for Yes/No Fields in reports

Is there anymore information that I can supply to help with this enquiry?

 

Thanks in advance. 

Tuned Listener
Posts: 7
Country: United Kingdom

Re: Using Checkmarks for Yes/No Fields in reports

Incidentally, the above script came from the Sage Quickstudy guide.
Platinum Elite Contributor
Posts: 6,652
Country: USA

Re: Using Checkmarks for Yes/No Fields in reports

The information is generally valid but incomplete and outdated. First, you did not indicate the font assigned to the custom field. The symbol portion of the character map varies with each font so it's important that you are using the font that relates to the symbols that you want to use. Second, the character notation that you used is the old Octal notation and Windows quit using Octal some time back and switched to Hexadecimal so you would need to go to the Windows character map for the font you want to use and find the correct hexadecimal number for the symbol you want to use. Another change, the test for the Yes/no field is now "Yes" or "No".

 

Rather than mess with trying to put a check symbol in the box, why not make the box border solid and then use X or space. The same script would work and it's a lot simpler.

Roy Laudenslager
ACT! Certified Consultant
ACT! Report Expert
Durkin Impact Report Designer
www.techbenders.com
royel@techbenders.com
541-343-8129
Platinum Elite Contributor
Posts: 6,652
Country: USA

Re: Using Checkmarks for Yes/No Fields in reports

And there is a KB with the same misinformation. I simply know the ACT! reports better than they do.
Roy Laudenslager
ACT! Certified Consultant
ACT! Report Expert
Durkin Impact Report Designer
www.techbenders.com
royel@techbenders.com
541-343-8129
Tuned Listener
Posts: 7
Country: United Kingdom

Re: Using Checkmarks for Yes/No Fields in reports

Thanks Roy,

 

Really appreciate your reply. I was using wingdings as a font.

 

I am a little frustrated that the information in the sage quick guide is so out of date considering the £50 I paid for it was very current!

 

like I mentioned, I am new to scripts and didn't fully understand your terminology. I would be very grateful if you could amend the script for me?  or do i understand that I simply need to change the -1 to a "yes" or "no"

 

Thanks again.

 

Mark 

Platinum Elite Contributor
Posts: 6,652
Country: USA

Re: Using Checkmarks for Yes/No Fields in reports

The script looked good but use the "Yes" or "No" in the test, the quotes indicate a literal. If you use the X in the box (my recommendation) be sure to use "X" or " " with the quotes to indicate a literal.

 

I do a lot of custom reports and some of them had check boxes and I heard about the reports suddenly failing as soon as that changed from -1 and 0 to Yes and No. 

Roy Laudenslager
ACT! Certified Consultant
ACT! Report Expert
Durkin Impact Report Designer
www.techbenders.com
royel@techbenders.com
541-343-8129
Tuned Listener
Posts: 7
Country: United Kingdom

Re: Using Checkmarks for Yes/No Fields in reports

Thanks again Roy,

 

Script now look like this

 

If Wasexpectingourcall1 = "Yes" Then Custom1.Text="X" 

Else 

Custom1.Text=" " 

End If

 

However, it produces no results;

 

Visible is set to true and the font is arial.

 

I am beginning to wonder if a simple Yes or No is really that bad! 

 

Any help greatly appreciated although you have already spent enough time on this request.

 

Mark 

Platinum Elite Contributor
Posts: 6,652
Country: USA

Re: Using Checkmarks for Yes/No Fields in reports

Without actually examining the the report template, I can't absolutely say that the script is correct. An observation, you have tended to run script elements together with out spaces in between. That is typically tolerated but personally I like to insert a space between each element. Troubleshooting scripts in ACT! reports is challenging because there isn't any debugger to help. Further, an error in one script typically makes every following script fail. If you modified a standard template, it likely has some other scripts in the template. In a case like your's, one of the first things I would try would be to comment out (the apostrophe causes everything following on that line to be ignored) your entire script. I would then place a single line Custom1.Tex t= "X" and see if that shows up.

 

VB script programming in the ACT! reports isn't hard but it does require a knowledge of how the report behaves and how the script integrates with the report template. One of my successful custom report templates incorporated over 700 lines of VB script programming.

Roy Laudenslager
ACT! Certified Consultant
ACT! Report Expert
Durkin Impact Report Designer
www.techbenders.com
royel@techbenders.com
541-343-8129