ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
LB
Quartz | Level 8 LB
Quartz | Level 8

Hello all-

How do I go about creating a small gap between certain columns,

So that for example when I have a columns

('Process A' a1 a2 a3) ('Process B" B1 B2 B3) I can insert a small white gap in between?

I saw an exampe by Art Carpenter online but have not been able to find it again.

Thanks.

Lawrence


5 REPLIES 5
Cynthia_sas
SAS Super FREQ

Hi:

Here's the thing...it depends on the destination. If you were using the LISTING destination, then the SPACING= option on the DEFINE statement in PROC REPORT would give more spacing between columns. In other destinations, you have to do other methods. Most notable would be CELLWIDTH= or WIDTH= to make a column wider, in destinations that support style overrides. What is your destination of interest?

cynthia

LB
Quartz | Level 8 LB
Quartz | Level 8

Cynthia-

It's going to a PDF. I'll try it in the DEFINE statement in the interim.

Lawrence

LB
Quartz | Level 8 LB
Quartz | Level 8

Cynthia;

Spacing does not seem to work.

Also be aware that this is building on a prior thread with the fake spanners that you helped with with before.

So playing with it, I created another fake column-with blank values called emp in the dataset-And then in the PROC REPORT:

columns statement include:

emp,_emp

where in the DEFINE statement-

DEFINE EMP/ ACROSS ' ' width=7 style(header)={background=white};

DEFINE _EMP/ ' ' width=7 style(header)={background=white} style(column)={background=white color=white};

It mostly works except that the header color won't render correctly for EMP..

Thanks again.

Lawrence

Cynthia_sas
SAS Super FREQ

Hi:

  The trouble is that PROC REPORT for the LISTING destination ONLY has SPACING= and WIDTH=. Those options WILL not work in non-LISTING destinations. So your simple WIDTH= will not work. For HTML, RTF, PDF, etc, you would have to do:

define myvar / 'My header'

        style(column)={cellwidth=1in };

OR

define myvar / 'My header'

        style(column)={width=1in};

But your CELLWIDTH or WIDTH style attribute must be specified within the STYLE override - not just out on the DEFINE statement, as you show. BTW, you can't have 2 DEFINE statements for EMP -- only 1 allowed. The last one will "win", which, I suspect, is not what you want. You may find that if you use CELLWIDTH/WIDTH, you may not need your "fake" spacer column, so the header color issue won't be an issue.

If you are running SAS 9.1.3, you will need to use the CELLWIDTH attribute in your style override. If you are using 9.2 or higher, then either CELLWIDTH or WIDTH will work. I tend to use CELLWIDTH, because then I don't get myself confused with the "old" WIDTH= option that only works in LISTING.

cynthia

LB
Quartz | Level 8 LB
Quartz | Level 8

Cynthia-

This helps immensely although with the "fake headers"-it simply works on one level only and not the other. So I may have to create a fake column after all.

Thanks again for all your hard work.

Lawrence


sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 7937 views
  • 3 likes
  • 2 in conversation