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-level。
查看 this question on 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;
我无法在 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-level。
查看 this question on 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;