Hi,
trying to align image and text to top that are both used in report title.
options orientation=portrait papersize=A4 nodate nonumber nocenter missing='' nomprint leftmargin=2cm rightmargin=1cm topmargin=1cm bottommargin=1cm nobyline ; ods listing close; ods noptitle; ods results on; ods escapechar='^'; data aaa; aaa = 'aaa'; output; run; ods pdf file="C:\test_report.pdf" style=styles.SasDocPrinter; ods pdf nobookmarkgen; title j=l '^S={just=l preimage="http://3h.ca/wp-content/uploads/2015/09/google_2015_logo_detail-300x100.png"}' j=r '^{style [font_size=10pt font_face=arial] TITLE 1 HERE}^{newline}^{style [font_size=10pt font_face=arial] TITLE 2 HERE ^{thispage}}'; proc report data = aaa; run; ods pdf close; ods listing;
Tried with VJUST and WHITESPACE, but no luck. ODS LAYOUT is not an option, as this should be printed on every page in report. Any ideas?
Thank you in advance.
so I guess POSTIMAGE won't work either, the result will be vice versa. I also saw, there is an IMAGE option, but can't test it right now. However, maybe there are other ideas, how image (aligned to left) and several lines of text with page number (aligned right) can be presented with top vertical alignment (as in an image attached to initial post), so that pattern will be applied to every page of the report? Number of pages is not defined, so this should be dynamic solution. Output should be in PDF.
Hi, well, yes, I can play around with ODS LAYOUT, but that doesn't solve my issue.. I want this header printed on every page of the report and number of pages is not defined, but ODS LAYOUT let's me generate header only on first page...
/* START: Prep data */ %macro create_data; %macro _dummy; %mend _dummy; data aaa; %do i = 1 %to 50; aaa = 'aaa'; output; %end; run; %mend create_data; %create_data; /* END: Prep data */ options orientation=portrait papersize=A4 nodate nonumber nocenter missing='' nomprint leftmargin=2cm rightmargin=1cm topmargin=1cm bottommargin=1cm nobyline ; ods listing close; ods noptitle; ods results on; ods escapechar='^'; title; footnote; ods pdf file="C:\test_report.pdf" notoc style=styles.SasDocPrinter; ods pdf nobookmarkgen; ods layout gridded x=.1 in y=.1in columns=2 rows=2; ods region width=65% height=5%; data _null_; dcl odsout obj(); obj.layout_gridded(columns: 1, column_gutter: "0in", row_gutter: "0in"); obj.region(); obj.image(file: "http://3h.ca/wp-content/uploads/2015/09/google_2015_logo_detail-300x100.png", width: "200px", height: "60px"); obj.layout_end(); run; ods region width=25% height=5% style={backgroundcolor=cxafbd91 textalign=r}; ods text='^{style [font_size=10pt font_face=arial textalign=r] TITLE 1 HERE}^{newline}^{style [font_size=10pt font_face=arial textalign=r] TITLE 2 HERE, Page ^{thispage}}'; ods region width=65%; proc report data = aaa; run; ods layout end; ods _all_ close; ods listing;
This is gridded layout, so from my understanding, columns should be same width. Of course I can try with absolute layout, so this would work so that I would have 1st row with 2 columns for header and 2nd row with 1 column for report, but still, this doesn't solve my issue with header row printed on every page of the report.
Maybe I don't know something here? Maybe there is onption in ODS LAYOUT, that let's me print some particular REGION whenever new page starts? And in such way, that PROC REPORT continues printing where it left on previous page? I am quite new to ODS, so almost every research on this topic gives me something new 🙂
sorry for late response.. I have solved this by defining backgroundimage= in custom style. This way logo is displayed on every page and Title justified right.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.