The SAS Output Delivery System and reporting techniques

PDF titles and footnotes appear differently when using page breaks in PROC report

Reply
Occasional Contributor
Posts: 8

PDF titles and footnotes appear differently when using page breaks in PROC report

 

I'm running into a weird problem whilst using page breaks in proc report. Whenever I try break introduce page breaks for a grouping variable the first title for the page with that grouping appear differently from the rest; they appear slightly bold. This causes problem for us when we try to process the pdf in a pdf editor because apparently each title is being printed twice.

 

I have some code to demonstrate. Here is some test data with the same structure of the data I am trying to output.

 

 

data testdata;
do group_var1 = 1 to 4; do group_var2 = 1 to 30; do across_var1 = 1 to 10; result = 1; output; end; end; end; run;

 

The aim is to tabulate this data in such a way that multiple group_var1 groups do not appear on the same page. Whenever I split the page using by groups or a break variable I get the problem. If I don't split the page the problem doesn't appear, but then the data isn't being displayed correctly. I have code below which produces the three examples above.

 

options orientation=landscape nodate nonumber PAPERSIZE = A4 nobyline;
ods escapechar = "^";

ods pdf file = "path_to_dir\test_output_1_by_group.pdf";

	Title1 "Title 1";
	Title2 "Title 2";
	Footnote1 "Footnote 1";
	Footnote2 "Footnote 2";
	FOOTNOTE3 "^{thispage} / ^{lastpage}";

	proc report data = testdata;
		by group_var1;
		column group_var1 group_var2 across_var1, result;
		define group_var1 / group;
		define group_var2 / group;
		define across_var1 / across;
	run;

ods pdf close;

ods pdf file = "path_to_dir\test_output_2_page_breaks.pdf";

	Title1 "Title 1";
	Title2 "Title 2";
	Footnote1 "Footnote 1";
	Footnote2 "Footnote 2";
	FOOTNOTE3 "^{thispage} / ^{lastpage}";

	proc report data = testdata;
		column group_var1 group_var2 across_var1, result;

		define group_var1 / group;
		define group_var2 / group;
		define across_var1 / across;
break after group_var1 / page; run; ods pdf close; ods pdf file = "path_to_dir\test_output_3_none.pdf"; Title1 "Title 1"; Title2 "Title 2"; Footnote1 "Footnote 1"; Footnote2 "Footnote 2"; proc report data = testdata; column group_var1 group_var2 across_var1, result; define group_var1 / group; define group_var2 / group; define across_var1 / across; run; ods pdf close;

I have attached the pdfs which the above code reproduces. You should see for test_output 1 and 2 that whenever a new group_var1 value starts (odd pages) then the titles and footnotes appear different to the rest.

 

I am using SAS 9.4 and on Windows 7. If anyone can help resolve this issue for me it would be much appreciated.

 

Super User
Super User
Posts: 9,855

Re: PDF titles and footnotes appear differently when using page breaks in PROC report

Well, you haven't supplied a style, so its using a default.  You may want to check what the style states as that defines the output format.  

http://www2.sas.com/proceedings/sugi30/132-30.pdf

 

Its likely that in the style it is defaulting to this is the given behavior as it seems consistent.  

 

Respected Advisor
Posts: 3,867

Re: PDF titles and footnotes appear differently when using page breaks in PROC report

Interesting when I edit the PDF and cut the text of the footnote it still appears until I cut it again.  The text appears to be overplayed.  I don't know how to fix it and I haven't found anything about this at support.sas.com

Occasional Contributor
Posts: 8

Re: PDF titles and footnotes appear differently when using page breaks in PROC report

Posted in reply to data_null__

That is exactly what we found. This causes problems for us because (in addition to being inconsistent visually) we use the titles to automatically generate bookmarks and having multiple titles overlayed on top of each other causes problems. I just took another look at the pdfs with an online pdf editor and found that problem remains for the footnotes when not using page breaks but gets fixed for the titles

 

Thanks for the style suggestion RW9. We normally use a custom style but I removed it in the example for the sake of keeping the code simple and trying to isolate the problem. I tested again whilst including the style just to make sure and the problem still remains.

Super User
Super User
Posts: 9,855

Re: PDF titles and footnotes appear differently when using page breaks in PROC report

Well, I have to say that I have yet to be impressed with SAS->PDF in any sense, TOC, bookmarks etc.  Hence why I output my outputs to RTF, batch convert them, then use PDFtk to extract and apply bookmarks.  Much more controllable.

SAS Super FREQ
Posts: 9,433

Re: PDF titles and footnotes appear differently when using page breaks in PROC report

Hi:
This is the kind of issue that you need to report to Tech Support. You have code that illustrates the issue. It really appears as though your custom style is not relevant in this instance. Tech Support can look for any defects related to titles and if they don't find any, but they can replicate your issue, then they can involve the developers.

Cynthia
Ask a Question
Discussion stats
  • 5 replies
  • 114 views
  • 0 likes
  • 4 in conversation