BookmarkSubscribeRSS Feed
Aman4SAS
Obsidian | Level 7

Hi,

I have to create two report in a single sheet [one after one];

I am facing problem with column width. as i required different column width for  both report.

i.e. Column A width for first report in 2in and for second report 4in.

Is it possible in SAS?

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

ods tagsets.excelxp file=....;

ods tagsets.excelxp options(sheet_name="Sheetname");

proc report data=first...

     define column / style(column)=[width=2in];

...

proc report data=second...

     define column / style(column)=[width=4in];

...

ods tagsets.excelxp options(sheet_name="Next sheet");

...

Note: Actually saying that, it might not work.  Reason is SAS reports by column per dataset.  Try, though I don't think you will be able to get mixed column widths.  However you could export your data and write a VBA script to place data where you like in a template file, that's relatively easy though you need to know VBA.

ballardw
Super User

If you can do this in Excel (not SAS to Excel) without merging cells I'd be very surprised. Excel basically doesn't support that behavior, at least that I've seen.

PDF and RTF but not Excel.

Aman4SAS
Obsidian | Level 7

Yes , true excel doesnt support that behaviour, but thanks to all of u, i hav solved my issue with adding leading and trailing blank columns in my second report. Thanks

SASKiwi
PROC Star

I've used that solution as well. The other option is to convince the customer to accept their reports on different tabs, not always possible I know....

Aman4SAS
Obsidian | Level 7

But i m still fail to do one thing, how to increse hight of lines, becaz its being overlap, i m doing it by cut sort the long line into many sort line, but i believe there must b a solution in sas

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
  • 5 replies
  • 1310 views
  • 0 likes
  • 4 in conversation