簡體   English   中英

SAS ODS PDF 標題頁 2

[英]SAS ODS PDF title page 2

我以某種方式未能在 SAS PDF 輸出的第二頁上顯示標題。 我的代碼(就標題語句而言)與我之前編寫的完美運行的程序幾乎相同。 第 1 頁完全按預期工作,但盡管我做了各種努力,但第 2 頁根本沒有顯示標題。 我認為應該工作的代碼如下。 我取出了大部分實際信息以使其更易於閱讀,但出於某種原因,如果 proc 報告或 proc sgplot 中的任何內容可能會影響頁面上的標題,請告訴我,我可以分享更多信息。 謝謝您的幫助。

    ods pdf file="location/name";
    footnote "footnote";
    ods escapechar='^';
    ods pdf startpage=now;
    options orientation=portrait nodate;
    title1 '^S={Preimage="image"}';
    title2 height=12pt bold 'Page 1 title' ;
    
    
    proc report data= data1 
          /*variables and stuff*/
    run;
    ods pdf startpage =  no;
    
    proc report data= data2 
             /*variables and stuff*/
    run;
    ods pdf startpage=no;
    
    proc report data=data3 
           /*variables and stuff*/
    run;
    ods pdf startpage=no;
    
    proc report data=data4   
             /*variables and stuff*/
    run;
    
    title1;
    title2;
    
    

    *****Page 2;
    
    ods pdf startpage=now;
    options orientation=portrait;
    title3 'Page 2 Title';
    
    proc sgplot data=data5;
        /*variables and stuff*/  
    run;
    
    ods pdf startpage=no;

    proc sgplot data=data6 ;
            /*variables and stuff*/
    run;
    
    title3;
    ods pdf close;

我不相信以這種方式更改標題是可能的 - PDF 中的標題更像是 PDF 級別的。

在 SAS Communities 上查看此問題,我認為解決此問題的最佳方法是使用ODS TEXT ,它可以讓您在頁面上放置任意文本。

——

編輯:Reeza 說得對; 這是很有可能的,只要每個頁面上都有一個新的 Proc。 只要確保 NOGTITLE 這樣圖形就不會吞下您的標題。

指定 NOGTITLE 選項。 您的第二頁都是圖形,標題嵌入到圖形標題(在圖片中)中,而不是傳遞到 PDF 文件中。 僅供參考 - 使用單個 ODS PDF 語句而不是多個語句來設置選項是一個很好的做法,因為您可以覆蓋以前的設置。

這對我有用。

ods pdf file="/home/fkhurshed/Demo1/test.pdf" startpage=now;

footnote "footnote";
ods escapechar='^';

options orientation=portrait nodate;
title1 'Dummy Title';
title2 height=12pt bold 'Page 1 title' ;


proc report data= sashelp.class (obs=2);
       /*variables and stuff*/
      /*variables and stuff*/
run;
ods pdf startpage =  no;

proc report data= sashelp.class (obs=4);
       /*variables and stuff*/
         /*variables and stuff*/
run;
ods pdf startpage=no;

proc report data=sashelp.class  (obs=3);
       /*variables and stuff*/
run;
ods pdf startpage=no;

proc report data=sashelp.class (obs=2)   ;
         /*variables and stuff*/
run;



*****Page 2;

ods pdf startpage=now gtitle;
options orientation=portrait;
title1 'Page 2 Title';

proc sgplot data=sashelp.stocks ;
where stock = "IBM";
series x=date y=high;
    
run;

ods pdf startpage=no;

proc sgplot data=sashelp.stocks ;
where stock = "IBM";
series x=date y=high;
    
run;

title3;
ods pdf close;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM