DATA Step, Macro, Functions and more

How to create title page for tagset.Excel.

Reply
Contributor
Posts: 43

How to create title page for tagset.Excel.

I want to create a title page that has four lines and one image on the right. I haven’t seen any command to put image on tagset.excelxp.

Does anyone have any idea how I could do this. 

Super User
Posts: 17,868

Re: How to create title page for tagset.Excel.

Tagset.ExcelXP does not support images.

If you need images you'll need to use another method such as ODS HTML or MSOFFICE

Contributor
Posts: 43

Re: How to create title page for tagset.Excel.

Do you know if MSOFFICE has title page?

Super User
Posts: 17,868

Re: How to create title page for tagset.Excel.

Sorry, no idea, you'll have to check the docs/papers.

SAS Super FREQ
Posts: 8,743

Re: How to create title page for tagset.Excel.

Hi, Usually, with any destination, if you want a TITLE page in the output, you have to make it your self. So in your case, you would make a first sheet in the workbook that contained the text of your title page. There have been some previous forum postings on creating your title page with a DATA step program and then using PROC REPORT or PROC PRINT to create the output.

The only thing that TAGSETS.EXCELXP will give you by default is an index of the sheets in the workbook or a contents of the sheets in the workbook, or both. Use the DOC='HELP' suboption to determine which suboption settings you use for the index vs the contents. The image issue is a Microsoft issue. By MICROSOFT design, the Spreadsheet Markup Language specification, does NOT support images. ODS TAGSETS.EXCELXP conforms to the Microsoft Spreadsheet Markup Language specification. This means no images.

   If you want a multi-sheet workbook with images, you will have to investigate the MSOFFICE2K_X destination, that is an HTML-based destination where you can request multi-sheet workbooks. However, if you do not need images, and you want a simple multi-sheet workbook, then the code below will make a 1st sheet that acts as a title sheet using TAGSETS.EXCELXP.

Cynthia

** make some data for a title page;
data title;
  length tline $100;
  ord=1;
  tline='My Title Page';
  output;
  ord=2;
  tline = 'by: Ima Programmer';
  output;
  ord=3;
  tline = "on: &sysdate";
  output;
run;
 
ods _all_ close;
title; footnote;
 
ods tagsets.excelxp file='c:\temp\withtitlepage.xml' style=sasweb
    options(doc='Help' autofit_height='yes' sheet_name='Title');
  
proc report data=title nowd noheader;
  column ord tline;
  define ord / order noprint;
  define tline / style(column)={font_weight=bold font_face=Arial font_size=20pt just=c cellwidth=6in};
  break after ord /;
  compute after ord;
    line ' ';
    line ' ';
    line ' ';
  endcomp;
  compute before;
    line ' ';
    line ' ';
    line ' ';
    line ' ';
  endcomp;
  compute tline;
   if ord in ( 2,3) then do;
     call define(_col_,'style','style={font_size=14pt just=r font_style=italic}');
   end;
  endcomp;
run;

  

ods tagsets.excelxp options(sheet_name='Class');
proc print data=sashelp.class;
run;

  

ods tagsets.excelxp options(sheet_name='Shoes');
proc print data=sashelp.shoes(obs=5);
run;

ods _all_ close;

Contributor
Posts: 43

Re: How to create title page for tagset.Excel.

Thanks for your help.

Ask a Question
Discussion stats
  • 5 replies
  • 430 views
  • 1 like
  • 3 in conversation