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

Hi All,

 

I know this has been discussed but I'm still having trouble getting my titles to display once exported and opened in excel.

 

I have added the ODS _ALL_ Close; and it exports with the title but nothing appears in the Results- SAS Report Tab.

 

Am I doing anything wrong here or can I change my code to show the title, and results, whether I want to look at it in SAS or in excel?

 

I am using SAS 9.4.

 

data test;
 Input Date $ Calls TRAN_CNT TranPCT;
 Datalines;

31Dec17 50272 8550  0.17 
07Jan18 116514 17122  0.15 
14Jan18 136281 19738  0.14 
21Jan18 136927 22330  0.16 
28Jan18 122398 20942  0.17 
04Feb18 155274 25898  0.17 
11Feb18 157051 24900  0.16 
18Feb18 147162 23166  0.16 
25Feb18 146725 22998  0.16 
04Mar18 150231 21788  0.15 
11Mar18 144226 19737  0.14 
18Mar18 139741 19844  0.14 
25Mar18 142968 18928  0.13 

;
Run;


ODS _ALL_ CLOSE;

ods excel file="C:/Test/misc/test.XLSX";
ODS EXCEL options(sheet_interval="none" embedded_titles='yes') gtitle gfootnote;

Proc SGPlot data=Test;

	Title "Test Data";
	VBar Date / response=TRAN_CNT  Fillattrs=(Color=BIGB);
	VLine Date / response=TranPCT y2axis lineattrs=(color=VIPK thickness=5) Legendlabel='Tran %';
	Yaxis values=(0 to 30000 by 2500);
	y2axis values=(0 to .20 by .02) Label='Tran %';
	format TRAN_CNT Comma8.;
Run;

Title;

ODS Excel Close;

Any help appreciated.

 

Cheers

 

Dean

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Using the GTITLE option says that the title will be put into the image produced by Proc SGPLOT.

 

If you want to have the title as text within the Excel, use the NOGTITLE, NOGFOOTNOTE option

 

If would also set the options as you open the Excel ODS destination like so:

ods excel file="C:/temp/test.XLSX"
  options(sheet_interval="none" embedded_titles='yes') nogtitle gfootnote
;

View solution in original post

5 REPLIES 5
ballardw
Super User

@DME790 wrote:

Hi All,

 

I know this has been discussed but I'm still having trouble getting my titles to display once exported and opened in excel.

 

I have added the ODS _ALL_ Close; and it exports with the title but nothing appears in the Results- SAS Report Tab.

 

Am I doing anything wrong here or can I change my code to show the title, and results, whether I want to look at it in SAS or in excel?

 

I am using SAS 9.4.

 

Any help appreciated.

 

Cheers

 

Dean


The Results window is the ODS HTML display. When you use ODS _all_ close; then you closed the HTML output and there isn't anything to send to the Results window.

 

WHY  are you using ODS _all_ Close? With 9.4 the default destination is ODS HTML and nothing else. IF you were sending output to other destinations such as LISTING or PDF or RTF close them after use. Otherwise your _all_ close is basically only closing the result window.

DME790
Pyrite | Level 9

Thanks @ballardw ,

 

That makes sense. I used the ODS _ALL_ Close as I found it in another answer.

 

Cheers

 

Dean

BrunoMueller
SAS Super FREQ

Using the GTITLE option says that the title will be put into the image produced by Proc SGPLOT.

 

If you want to have the title as text within the Excel, use the NOGTITLE, NOGFOOTNOTE option

 

If would also set the options as you open the Excel ODS destination like so:

ods excel file="C:/temp/test.XLSX"
  options(sheet_interval="none" embedded_titles='yes') nogtitle gfootnote
;
DME790
Pyrite | Level 9

Thanks @BrunoMueller 

 

 

Works now.

 

Cheers

 

Dean

DME790
Pyrite | Level 9

Thanks @BrunoMueller 

 

 

Works now.

 

Cheers

 

Dean

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 2430 views
  • 0 likes
  • 3 in conversation