Hi:
Just a few comments to add to what David said. Are you using either SAS/IntrNet and an SCL program or a SAS Stored Process (calling an SCL program)?
If so, you may find that your updated style template needs to be written to an item store or template store that "lives" on a server that is accessible to your platform configuration (SAS/IntrNet Application Server or Stored Process Server). (In other words, you cannot write the updated template to your personal C: drive.)
Next, if you are trying to open your result file with Excel (as indicated by your appsrv_header function), you may find that ODS HTML does not work as well as ODS HTML3. It turns out that ODS HTML in SAS 9 creates HTML 4.01 compliant tags and Excel is much happier with HTML 3.2 compliant tags. You may want to invoke ODS HTML3 instead of ODS HTML in your invocation code.
Finally to reiterate what David said, you need to control your new template location with a libname and an ODS PATH statement. Something like this:
[pre]
libname mytemp 'server-path-location-for-changed-templates';
ods path mytemp.templat(update)
sasuser.templat(update)
sashelp.tmplmst(read);
proc template;
define style styles.dashboard / store=mytemp.templat;
...
end;
run;
[/pre]
With this code, a folder or directory named "styles" will be created in the item store "mytemp.templat". Inside the "styles" folder, you will be creating a new style template called "dashboard". However, you will only want to write to mytemp.templat when you are creating or updating your new template. (Probably 1 time) Most of the time, when running jobs, you will just need to POINT to the new item store on the server like this:
[pre]
libname mytemp 'server-path-location-for-changed-templates';
ods path mytemp.templat(read)
sasuser.templat(read)
sashelp.tmplmst(read);
ods escapechar = '~';
options nonumber;
%let RV=%sysfunc(appsrv_header(Content-type, application/vnd.ms-excel));
%let RV=%sysfunc(appsrv_header(Content-disposition, %str(attachment; filename=temp.xls)));
ods html3 file=_webout style=styles.dashboard;
...more code...
ods html3 close;
[/pre]
cynthia