export graphs to doc file

Accepted Solution Solved
Reply
Contributor
Posts: 29
Accepted Solution

export graphs to doc file

 Hi guys 

I just wanted to export this graph to the word file, I tried to do it with this code. the code was correct but the graph does not appear in the word file.

ods html file = ' C:\Users\Barkamih\Desktop\fat % ods\ proteina curve1.doc';
proc gplot data=fit;
title1' Lactation curve of milk fat depression ';
	plot pred*time TEST_DAY_PROT_PERCENT*time/overlay;
run;quit;
ods html close;

 kind regards 

 

Ibrahim  


Accepted Solutions
Solution
‎11-30-2017 10:47 AM
Super User
Posts: 8,590

Re: export graphs to doc file

ods rtf file = 'C:\Users\Barkamih\Desktop\fat_ods\proteina_curve1.rtf';

title1' Lactation curve of milk fat depression ';

proc gplot data=fit;
plot pred*time TEST_DAY_PROT_PERCENT*time/overlay;
run;

ods rtf close;

Do NOT use blanks or special characters in file or path names. They are never necessary and only cause confusion and work that can easily be avoided.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
PROC Star
Posts: 311

Re: export graphs to doc file

Use ODS RTF, not HTML.

Super User
Posts: 8,590

Re: export graphs to doc file

You are not creating a Word document file. You are writing a HTML file that is incorrectly named with a .doc extension.

HTML files do not embed graphics, they contain links to those graphics, and have them loaded separately by the user agent (usually a browser). This means you also have to make sure that the graphics are stored in a way that the link can be resolved when an application opens the HTML. Make proper use of the path= and gpath= options of the ods html statement, and the (url=) suboption for those.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 29

Re: export graphs to doc file

this is my path file 

C:\Users\Barkamih\Desktop\fat % ods

could you please write the correct code for this action, because I'm new in sas 

 

best regards 

 

Ibrahim 

Solution
‎11-30-2017 10:47 AM
Super User
Posts: 8,590

Re: export graphs to doc file

ods rtf file = 'C:\Users\Barkamih\Desktop\fat_ods\proteina_curve1.rtf';

title1' Lactation curve of milk fat depression ';

proc gplot data=fit;
plot pred*time TEST_DAY_PROT_PERCENT*time/overlay;
run;

ods rtf close;

Do NOT use blanks or special characters in file or path names. They are never necessary and only cause confusion and work that can easily be avoided.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 29

Re: export graphs to doc file

Posted in reply to KurtBremser
Thank you so much
I appreciate that
thank you again
regards
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 115 views
  • 3 likes
  • 3 in conversation