BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kansas
Calcite | Level 5

Hi.

I want to know whether there is a method to remove the top left box created in a proc tabulate step in ODS PDF.

I did some searching on that topic and found that by customizing the borderwidth and label of the box, you can make the box invisible. It works perfect in the "result output" of the SAS enterprise guide( i assume that to be HTML)

My problem is it has no effect when im using it with ods pdf.

However i also noticed that the changes i do to the style (using the proc template) is reflected in the ods pdf.

ods pdf file='sample.pdf' style=<stylename>


Is there a method to hide the box using a style(proc template)?

i found the following code in a white paper mentioning how to change the table properties , but couldnt find anything on "box" . Any guidance would be greatly appreciated.

replace Table from Output /

frame = box /* outside borders: void, box, above/below, vsides/hsides, lhs/rhs */

rules = all /* internal borders: none, all, cols, rows, groups */

cellpadding = 4pt /* the space between table cell contents and the cell border */

cellspacing = 0.25pt /* the space between table cells, allows background to show */

borderwidth = 0.75pt /* the width of the borders and rules */

background = color_list('bgT') /* table background color */;

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Well, I managed to do this without using ANNOTATE. Using ANNOTATE and GSLIDE for TABULATE output to PDF seems like a LOT of work for something that you can get VERY VERY close to with STYLE= overrides. A slightly different approach to Andre's idea is shown in the attached screenshot and output. I made the column headers yellow and the box area pink, so you could see where the box area started/ended and the column headers began.

cynthia


rules_cols_no_annotate.jpg

View solution in original post

9 REPLIES 9
Andre
Obsidian | Level 7

See this beginning of answer

ods pdf file="d:\temp\emptybox.pdf";

proc tabulate data=sashelp.class;

class sex;var height;

table sex all, height *mean/style=[frame=void borderwidth=0mm] box={style=[background=white  ]}  ;

run;

ods pdf close;

Of course there are other variations

but the box is part of the general   frame and rules and is not a special case

As it is my first reply on the new forum

i hope the code is correctly passed

Andre

kansas
Calcite | Level 5

thanks for the quick reply. I ll try and let you know.

Just a quick question. does "borderwidth=0mm" disables all the borders in the table. Because i only want to remove the box.

Cynthia_sas
SAS Super FREQ

Hi:

Look at the attached screenshot and program.  The top output in "show_box_area.jpg"  is from PROC TABULATE. You can put text into the BOX area, as I show in the top table, but you cannot really get rid of the BOX area with TABULATE. Changing the style template won't make the space reserved for the BOX area disappear, it will only, possibly, get rid of the borderlines around the box area. The BOX area is an integral part of a TABULATE table -- It shows where the intersection of the ROW variables and the COL variables happen. PROC REPORT, on the other hand (shown underneath the TABULATE table) shows that REPORT makes "flattened" headers, without a BOX. That's because REPORT does not have the same concept of ROW HEADER area as TABULATE does.

If you have only 1 variable in the ROW dimension, then you could put the name of the single item in the BOX area within TABULATE syntax, then blank out the regular header and "flatten" the table (as shown in the second screen shot and program, entitled "_2_flatten_box.jpg").

This is an interesting blog post about TABULATE vs REPORT and the BOX area:

http://blogs.sas.com/sasdummy/index.php?/archives/212-PROC-REPORT-versus-TABULATE-two-SAS-heavyweigh...

cynthia


_2_flatten_box.jpgshow_box_area.jpg
kansas
Calcite | Level 5

Thanks cynthia. I prefer proc tabulate over proc report.

removing the borders would solve my problem.

Is there a method to hide the border around the box using a style ?

Cynthia_sas
SAS Super FREQ

Hi:

  You could try ODS PDF with STYLE=JOURNAL and see if you really like just removing the borders or whether you want to totally get rid of the big BOX area.

  The issue is that within a single style template, the BOX area is not really differentiated from the other cells in the tabular report -- so not really in a style. You might be able to alter the borders of the box with STYLE= overrides in the TABULATE syntax itself, but even if you were successful in removing the borders around the box, it would look sort of odd without the corner filled in. What did you think of the screenshot _2_flatten_box.jpg that was attached to my last post? That was accomplished with TABULATE and essentially disappeared the BOX by moving a ROW header into it.

cynthia

kansas
Calcite | Level 5

Hi Cynthia,

My aim was to hide the box. Yeah some may consider that to be odd.  I was able get an output like the following after hiding the box using gslide and creating a line using ANNONATE facility. I know the method is crappier. But serves the purpose for now,. Was wandering whether there is a cleaner method ?

thanks.

Andre
Obsidian | Level 7

Kansas

as you insist even if Cynthia describes already the logic

as frame is part of the table structure and the box is one partial header of the table 

the closest solution is to leave the frame void

and note that sas refuses some trick like  frame=box for the general style  and a kind of imaginary frame=void for box

Andre

ods pdf file="d:\temp\emptybox.pdf";* style=journal;

proc tabulate data=sashelp.class;

class sex;

var height  weight;

table sex all, (height weight)*mean /style=[frame=void borderwidth=0.1mm cellspacing=0.1mm]box={style=[background=white bordercolor=white]}  ;

run;

ods pdf close;

Cynthia_sas
SAS Super FREQ

Hi:

  Well, I managed to do this without using ANNOTATE. Using ANNOTATE and GSLIDE for TABULATE output to PDF seems like a LOT of work for something that you can get VERY VERY close to with STYLE= overrides. A slightly different approach to Andre's idea is shown in the attached screenshot and output. I made the column headers yellow and the box area pink, so you could see where the box area started/ended and the column headers began.

cynthia


rules_cols_no_annotate.jpg
kansas
Calcite | Level 5

Thanks alot cynthia. That solved my problem. !!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 9 replies
  • 4649 views
  • 3 likes
  • 3 in conversation