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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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