<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to export a chart to excel in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-a-chart-to-excel/m-p/641765#M23966</link>
    <description>&lt;P&gt;I would start with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods excel file='c:\folder\path\myexcelfile.xlsx';

&amp;lt;code that generates the results I want in Excel&amp;gt;

ods excel close;&lt;/PRE&gt;
&lt;P&gt;There are lots of options that go into things like naming tabs and such though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By code that generates results I generally mean just the report or graphic output. Things like your template and macro definitions and all of the data manipulation are better done prior to the display part.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2020 22:21:56 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-04-21T22:21:56Z</dc:date>
    <item>
      <title>How to export a chart to excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-a-chart-to-excel/m-p/641763#M23965</link>
      <description>Here is what I'm using to create the chart it's in the result window&lt;BR /&gt;&lt;BR /&gt;/* Define the line chart template */&lt;BR /&gt;proc template;&lt;BR /&gt;define statgraph linechart;&lt;BR /&gt;begingraph;&lt;BR /&gt;/* Create a dynamic variable for the year */&lt;BR /&gt;dynamic year;&lt;BR /&gt;&lt;BR /&gt;/* Define the display attributes for each stock. Since&lt;BR /&gt;DISCRETEATTRMAP does not support the MARKERATTRS=&lt;BR /&gt;suboption SIZE=, the marker size is set separately. */&lt;BR /&gt;discreteattrmap name="company" / ignorecase=true ;&lt;BR /&gt;value "shoe" /&lt;BR /&gt;markerattrs=(color=blue symbol=trianglefilled)&lt;BR /&gt;lineattrs=(color=lightblue pattern=solid);&lt;BR /&gt;value "skirt" /&lt;BR /&gt;markerattrs=(color=red symbol=circlefilled)&lt;BR /&gt;lineattrs=(color=verylightred pattern=solid);&lt;BR /&gt;value "pants" /&lt;BR /&gt;markerattrs=(color=orange symbol=squarefilled)&lt;BR /&gt;lineattrs=(color=verylightorange pattern=solid);&lt;BR /&gt;enddiscreteattrmap ;&lt;BR /&gt;&lt;BR /&gt;/* Associate the attribute map with input data column Stock and&lt;BR /&gt;assign the name STOCKATTRS to the named association */&lt;BR /&gt;discreteattrvar attrvar=companyattrs var=company attrmap="company" ;&lt;BR /&gt;&lt;BR /&gt;entrytitle "company Index Performance in " year;&lt;BR /&gt;layout overlay /&lt;BR /&gt;/* Add a grid */&lt;BR /&gt;xaxisopts=(griddisplay=on gridattrs=(pattern=dot&lt;BR /&gt;color=lightgray))&lt;BR /&gt;yaxisopts=(griddisplay=on gridattrs=(pattern=dot&lt;BR /&gt;color=lightgray));&lt;BR /&gt;linechart category=date response=close / name="linechart"&lt;BR /&gt;/* Compute the mean */&lt;BR /&gt;stat=mean&lt;BR /&gt;&lt;BR /&gt;/* Group by stock using the specified attributes */&lt;BR /&gt;group=companyattrs&lt;BR /&gt;&lt;BR /&gt;/* Display the lines and markers */&lt;BR /&gt;display=(line markers)&lt;BR /&gt;&lt;BR /&gt;/* Set the marker size */&lt;BR /&gt;markerattrs=(size=6)&lt;BR /&gt;&lt;BR /&gt;/* Show vertex labels and specify their attributes */&lt;BR /&gt;vertexlabel=true&lt;BR /&gt;vertexlabelattrs=(size=7pt)&lt;BR /&gt;vertexlabelformat=dollar4.0;&lt;BR /&gt;&lt;BR /&gt;/* Add a legend */&lt;BR /&gt;discretelegend "linechart";&lt;BR /&gt;endlayout;&lt;BR /&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/* Create a macro that generates a line chart for a specific year */&lt;BR /&gt;%macro genchart(year=);&lt;BR /&gt;/* Generate the chart */&lt;BR /&gt;proc sgrender data=companys template=linechart;&lt;BR /&gt;where year(date)=&amp;amp;year; /* Get the data for the specified year */&lt;BR /&gt;format date monname3.; /* Format the date as 3-letter month */&lt;BR /&gt;dynamic year="&amp;amp;year;"; /* Pass the year to the template */&lt;BR /&gt;run;&lt;BR /&gt;%mend genchart;&lt;BR /&gt;&lt;BR /&gt;/* Generate a chart for 2001 */&lt;BR /&gt;%genchart(year=2020);</description>
      <pubDate>Tue, 21 Apr 2020 22:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-a-chart-to-excel/m-p/641763#M23965</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2020-04-21T22:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to export a chart to excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-a-chart-to-excel/m-p/641765#M23966</link>
      <description>&lt;P&gt;I would start with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods excel file='c:\folder\path\myexcelfile.xlsx';

&amp;lt;code that generates the results I want in Excel&amp;gt;

ods excel close;&lt;/PRE&gt;
&lt;P&gt;There are lots of options that go into things like naming tabs and such though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By code that generates results I generally mean just the report or graphic output. Things like your template and macro definitions and all of the data manipulation are better done prior to the display part.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 22:21:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-export-a-chart-to-excel/m-p/641765#M23966</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-21T22:21:56Z</dc:date>
    </item>
  </channel>
</rss>

