Help using Base SAS procedures

Proc Report - Two reports on 1 page

Reply
N/A
Posts: 0

Proc Report - Two reports on 1 page

I am trying to get 2 reports onto the same page. When I add the startpage=no I get both on the page, but report 2's title doesn't show. Any suggestions? I have provided the code below....

options nodate nonumber ;
ods pdf file="C:\PC_SAS\Page 3 Testing.pdf" style=Custom startpage=no;
ods escapechar='^';

proc report data=example8 nowd split='*' missing
style(report)={ outputwidth=7 in}
style(summary)={just=center htmlstyle="border-top:2px thick double black"}
style(header)=header{just=center background=ligr font_size=10pt font_face="TimesRoman"
font_weight=bold};
title1
j=c '^S={preimage="D:\Documents and Settings\amr\Desktop\HReport\Logo For Top Of Report.jpg"}'
j=c ' '
j=c ' '
j=c 'Dealer: 0415'
j=c ' '
j=c '^S={background=ligr }Where are your customers spending?'
j=c ' '
j=c ' '
j=c 'Net Purchases (01/08-12/08):'
j=c ' '
j=c '______________________________________________________'
j=c ' Whos taking money out of your pocket? '
j=c ' Competitive Retail Store Spending (Top 5 locations) '
j=c '______________________________________________________';
column flavor calories price;
define flavor/order;
define price/ sum;
rbreak after/summarize ol skip;
compute after;
flavor = 'Total';
endcomp;



proc report data=example8 nowd split='*' missing
style(report)={ outputwidth=7 in}
style(summary)={just=center htmlstyle="border-top:2px thick double black"}
style(header)=header{just=center background=white font_size=10pt font_face="TimesRoman"
font_weight=bold}
style(column)={just=center background=white font_size=10pt font_face="TimesRoman"
font_weight=medium};
title1
j=c 'Where are your customers Using their HD cards?'
j=c ' ';

column flavor calories price;
define flavor/order;
define price/ sum;
footnote1 j=r 'Page ^{thispage} of 4';

run;
ods _all_ close;
ods listing;
SAS Super FREQ
Posts: 8,743

Re: Proc Report - Two reports on 1 page

Hi:
This is the way that ODS PDF works. If you want to write a "pseudo-title", use either ODS PDF TEXT= (SAS 9.1.3) or ODS TEXT= (SAS 9.2):
[pre]
ods pdf .... startpage=no;
** proc report 1;

ods pdf text='Where are your customers using their HD cards? ';
ods pdf text= ' ';

** proc report 2;
ods pdf close;
[/pre]

If you are already using a custom style template (which it looks like you are), then you can modify the UserText style element to center justify and bold the text and change the font:
[pre]
style UserText from UserText/
font_face='Helvetica'
font_weight=bold
just=c;
[/pre]

You may have noticed that the HTMLSTYLE= attributes that you are using do not have an impact on your ODS PDF output. However, if you are running in SAS 9.2, you -can- use CSS style properties in a CSS file to impact your PDF report -- you might try the CSSSTYLE option in SAS 9.2 if you need to use CSS attributes to set table elements.

It looks to me like you want to simulate an "overline" above your summary with the HTMLSTYLE code -- HTMLSTYLE only works with ODS HTML or Markup family destinations that support the specification of CSS style properties, as documented here:
http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/a002972093.htm (look for HTMLSTYLE in the list of style attributes)


You might investigate the text-decoration attribute with ODS PDF, instead. Starting in SAS 9.2, it is available and will overline and underline text with ODS PDF, as described on page 4 of this paper:
http://support.sas.com/resources/papers/sgf2008/odspdf.pdf

As an alternative, also in SAS 9.2, using bordertopstyle and bordertopcolor attributes worked for me as shown in the program below to simulate an overline above a summary -- I put the overline in cyan so it would stand out.

cynthia

[pre]
ods pdf file='c:\temp\overline.pdf' style=journal;

proc report data=sashelp.class nowd
style(summary)={bordertopstyle=solid bordertopcolor=cyan};
column name age height sex;
rbreak after / summarize;
run;
ods _all_ close;
[/pre]
N/A
Posts: 0

Re: Proc Report - Two reports on 1 page

The ODS PDF worked great! Thank you.

Is there a way to get rid of the lines around the report? Currently the output looks like an excel sheet.
SAS Super FREQ
Posts: 8,743

Re: Proc Report - Two reports on 1 page

Hi:
To get rid of the interior table lines in the report, try the JOURNAL style, as shown in my code snippet.

Alternately, if you just want to remove all the interior table lines without changing what you currently specify in STYLE=, use PROC REPORT STYLE= overrides:
[pre]
proc report data=xxx.yyy nowd
style(report0={outputwidth=7in rules=none frame=void cellspacing=0};
. . . rest of report code . . .
run;
[/pre]

cynthia
N/A
Posts: 0

Re: Proc Report - Two reports on 1 page

Also a way to put box around a title or ods pdf text? I'm in 9.1.3.
SAS Super FREQ
Posts: 8,743

Re: Proc Report - Two reports on 1 page

Hi:
I believe that to put a box around the SAS Title text or the text string specified by ODS PDF TEXT=, you have to change the style template using Style Template 9.1.3 syntax, as described in this paper:
http://www2.sas.com/proceedings/sugi30/132-30.pdf

The snippet of code that I included previously would have to be changed for UserText and you'd also have to change the style template for the SystemTitle and possibly the TitleandNoteContainer elements. Since you are using a custom style template (your original code posted had STYLE=CUSTOM), you might also work with the person who wrote the CUSTOM template to alter it so that boxes are put around the title and user text.

cynthia
Ask a Question
Discussion stats
  • 5 replies
  • 142 views
  • 0 likes
  • 2 in conversation