BookmarkSubscribeRSS Feed
HowToSAS
Calcite | Level 5

Hi All,

I am trying to create a report (rtf) which includes a checkbox. The user checks (tick) this box or leaves it blank.

Is there an option/way in SAS to create this checkbox ?

Thank you

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:

  Have you checked the RTF specification? I am not sure that the RTF spec includes any support for a checkbox like an HTML form. When ODS RTF creates a file, it creates RTF (Rich Text Formatting) control codes around the SAS report output. So, would you have a checkbox on each row of an output report? What would happen when the user checks the box? SAS can't read the RTF file back into a dataset? So it's not clear what you want to create Report document or some kind of form or even if RTF can do a check box. This would be a question for Tech Support.

cynthia

HowToSAS
Calcite | Level 5

Hi Cynthia,

  Thanks for your response. I am creating a validation report.

  I am reading an excel (which contains TL titles) and then create report in rtf format displaying all these records in details. this part is fairly simple

 

What I want to be able to do is add a last page to this report containing a little summary like

All SDTM datasets validated                          (a checkbox here) Yes                 (a checkbox here) NA

All ADaM datasets validated                         (a checkbox here) Yes                 (a checkbox here) NA

so whoever signs off on the final report clicks the appropriate checkbox.

Hope I was clearly able to explain what I'm trying to do.

Thanks.

Cynthia_sas
SAS Super FREQ

Hi:

  If this is just a manual checkbox -- not an online form, then one approach is to use a 3 or 4 character variable with a fixed value for the checkbox: |_| or |__| (pipe-underscore-pipe or pipe-underscore-underscore-pipe) and then you can just write it out as you would any other variable value. Or as an alternative, if you can find a Wingding symbol or some other symbol in a font that you have, then you can just use that symbol in place of the checkbox.

Cynthia


data signhere(keep=linenum line ckbox3 yes ckbox4 na);
length line $50 ckbox3 $3 ckbox4 $4;
  linenum = 1;
  Line ="All SDTM datasets validated";
  ckbox3 = "|_|";
  yes='Yes';
  ckbox4 = "|__|";
  na = 'NA';               
  output;
  linenum = 2;
  line = "All ADaM datasets validated";
  output;
run;
 
ods rtf file="c:\temp\ckbox.rtf";
 
proc report data=signhere nowd noheader
   style(report)={width=100% rules=none frame=void cellspacing=0};
  title 'Make Fake Checkboxes';
  title2;
  title3;
  footnote 'Sign Here';
  column linenum line ckbox3 yes ckbox4 na;
  define linenum / order noprint;
  define line / style(column)={fontweight=bold font_size=14pt};
  define ckbox3 / style(column)={fontweight=bold font_size=14pt font_face='Courier New'};
  define yes / style(column)={fontweight=bold font_size=14pt};
  define ckbox4 / style(column)={fontweight=bold font_size=14pt font_face='Courier New'};
  define na / style(column)={fontweight=bold font_size=14pt};
run;

ods rtf close;
title;
footnote;


make_fake_checkbox.png
HowToSAS
Calcite | Level 5

Thank you Cynthia!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 4748 views
  • 3 likes
  • 2 in conversation