The SAS Output Delivery System and reporting techniques

export tables/report to excel

Reply
Occasional Contributor
Posts: 8

export tables/report to excel


Hi, I am a new user of SAS, the problem may be simple to you.

I may investigate by myself by studying papers/internet resources but I am in a bit urgent so would like to seek for your soultion.

I want to export the tables/report generated by proc tabulate/proc report/proc print to a excel file.

Currently I am using ods tagsets.excelcp to export to a xls file.

When I open the output excel file, it would ask something like "the file format is in a different format, do you want to continue to open it?"

Then I click yes, the tables are alright.

But just one thing that the background is all blank without any gridlines, even the box of "gridlines" in View tab is ticked.

I want to know is there any easy way to show the gridlines so that the file look like a normal excel file?

Or is there any better way to export to excel?

Thanks.

Grand Advisor
Posts: 17,321

Re: export tables/report to excel

46949 - You cannot use a style template with the ExcelXP tagset to add grid lines to the body of a w...

The workaround is also available in the full code section.

EDIT: but then you lose the table formatting.  I'd live with it if you can. Resave your workbook to XLSX to avoid the message, the format from tag sets is actually an XML file, not an XLSX.

The other workaround is to select the cells, unlock them and apply normal style but the selection part would be annoying IMO.

Respected Advisor
Posts: 3,060

Re: export tables/report to excel

One way to avoid the message when opening Excel is to use a file extension of XML in your ODS File = statement instead of XLS, since it is really XML anyway.

Ask a Question
Discussion stats
  • 2 replies
  • 401 views
  • 0 likes
  • 3 in conversation