Sorry for the delay in responding and also for the lengthy posting.
The check sum method will definitely be helpful to minimize the QA after the review cycle. Couple of suggestions:
1) Option to calculate the check sum and to check the contents of the document triggered through STP. This would allow only super user or system admin to perform these tasks so there is better control over the process.
2) Identify only those tables/outputs that got modified during the review cycle using the check sum method. This would facilitate refreshing only the modified tables rather than the entire document.
Here is the work around I am working to implement this requirement. For most part this seems to be working but I haven’t done extensive testing yet. Any comments or feedback will be greatly appreciated. Also, please let me know if there are pitfalls I need to be aware of. Thanks in advance.
1) Using ODS RTF created an rtf document with the table (called before %stpbegin)
2) Using HAUTO/OLE methods copied the table and pasted as a picture and saved the document as Filtered Web Page. This creates a gif image of the table. (called before %stpbegin)
3) Using ODS tagsets.MSOffice2k created a table with a single row and inserted the image using preimage.
Notes/Observations:
1) Had to add sassrv to the users group to provide access to the file system.
2) Re-installed the object spawner service with –nonoxcmd option
3) This works only if HTML format is selected. The RTF format sets the _ODSDEST to rtf and ODS RTF accepts only jpg image and I didn’t have much luck in creating a jpg from a gif programmatically. Even when I forced the macro variable _ODSDEST to tagsets.msoffice2k for some reason no output was generated (no error in the log). (NEED HELP)
4) This approach is going to cost the company more SAS licensing cost, since our metadata/STP server is on a UNIX platform and OLE can be run only on a Windows platform. The proposal is to either install required base products + integration technology or base products + SAS/Connect on the Windows server.
Here is the program:
*ProcessBody;
%global _insertresultas;
/*
***To Test from a SAS Session***;
%let _insertresultas=image;
filename _webout temp;
*/
/********************************************
Location for temporary rtf file***
The gif file will be saved in a location
relative to this path.
*********************************************/
%let rtfDoc=\\rkenr314557700\d$\SAS\tmp\myrtf.rtf;
ods path work.mytemplate(update) sashelp.tmplmst(read);
/***************************Override Style****************************
Style is set to MyStyle. Requires cellspacing to be a minimum of 3 for
the image to capture lines.
*********************************************************************/
proc template;
delete styles.myStyle;
define style styles.myStyle;
parent=styles.rtf;
style header from headersandfooters /
background=white
foreground=black
cellspacing=3
font_size=2
font_weight=bold
;
style rowheader from rowheader /
background=white
foreground=black
cellspacing=3
font_size=2
font_weight=medium
;
style table from table /
background=white
borderwidth=1
cellspacing=3
font_size=2
frame=void
rules=all
;
end;
run;
%macro runResult;
options nodate nonumber;
title;
footnote;
data work.company;
set sashelp.company;
label
level2="Level2"
level1="Level1"
level5="Level5"
deptHead="Department Head"
level3="Level3"
level4="Level4"
job1="Job"
n="Count"
;
if _n_ <= 20 then output;
run;
/***************************Override Destination**********************
Destination should be tagsets.MSOffice2K equivalent to selecting
HTML in the Add-In option. This is needed due to ODS RTF requires
a jpg file instead of gif file. MS Word creates a gif file when
the document is saved as Filtered HTML. Need to revisit if
destination is other than MS Office.
*********************************************************************/
%if not %sysfunc(symexist(_ODSDEST)) %then
%global _ODSDEST;;
%let _ODSDEST=tagsets.MSOffice2K;
/***************************Override Stylesheet***********************
Style Sheet is set to blank.
*********************************************************************/
%if %sysfunc(symexist(_ODSSTYLESHEET)) %then
%let _ODSSTYLESHEET=;;
/***************************Override Style****************************
Style is set to MyStyle.
*********************************************************************/
%if %sysfunc(symexist(_ODSSTYLE)) %then
%let _ODSSTYLE=Styles.MyStyle;;
%if %lowcase(&_insertresultas) eq image %then %do;
%global imagefile;
ods noresults;
ods rtf file="&rtfDoc" style=&_ODSSTYLE;
proc template;
delete styles.myTableStyle;
define table styles.myTableStyle;
column
%let dsid=%sysfunc(open(work.company,i));
%do i=1 %to %sysfunc(attrn(&dsid,nvars));
%sysfunc(varname(&dsid,&i))
%end;
%let dsid=%sysfunc(close(&dsid));
;
end;
test data=work.company;
run;
ods rtf close;
ods results;
/***SCL Entry to create a gif image of the table***/
proc display c=openarch.callentries.getTableImage.scl batch;
run;
options mprint;
%stpbegin;
data work.class;
set sashelp.class;
keep sex;
label sex=" ";
sex='';
if _n_=1 then output;
run;
proc print data=work.class noobs split='*' label
style(table)={rules=groups cellspacing=0 frame=box}
style(header)={just=l protectspecialchars=on nobreakspace=on}
style(data)={preimage="&imagefile" cellwidth=100%}
;
run;
%stpend;
%let deleteRTF=y;
%let deleteHTM=y;
%let deleteIMG=n;
/***Delete temporary files***/
/***The gif file cannot be deleted until the image is inserted***/
/***Need to come up with a way to delete these files later***/
proc display c=openarch.callentries.deleteTempFile.scl batch;
run;
%end;
%mend runResult;
%runResult;
... View more