01-30-2015 05:04 AM
I got the following SAS code:
options nodate pageno=1 linesize=80 pagesize=40 obs=10;
define style styles.mycssstyle;
import "H:\SAS Makro\BVL_SASStyle_29012015_v1.css";
define style styles.mycssstyleprinter;
import "H:\SAS Makro\BVL_SASStyle_29012015_v1.css" print;
ods html file="H:\SAS Output Test\css.html" style=styles.mycssstyle;
ods pdf file="H:\SAS Output Test\css.pdf" style=styles.mycssstyleprinter;
proc contents data=sashelp.class;
ods _all_ close;
The CSS is attached.
1. my PDF output is totally odd, its 80 pages and massive letters, unreadable. why is that?
2. the SAS Report that the EG generated along the HTML and PDF is not styled, why is that?
It would be great if someone can share some insight. Its the first time I am using CSS together with SAS. I like the idea
I just need to learn how far it can be used to style SAS outputs.
01-30-2015 10:14 AM
Thanks for you reply. The HTML is the only output which is actually styled correctly dont want to change that.
Its the SAS Report that is not styled and the PDF which is really wrong.
01-30-2015 08:20 PM
So the HTML could look OK because you chose relative numbers for font sizes which is totally fine for HTML, but forces PDF to do a conversion from relative sizes to absolute PT sizes. I do not believe that the SAS Report XML - -such as that used by Web Report student or Enterprise Guide will use your all your CSS. For example, if you want to use a custom CSS file with Web Report Studio (and SAS Report format), you have to define your CSS file in the XML used by Web Report Studio. Also, it looks like you are importing the SAME CSS file into 1 style for PDF and another style for HTML and, granted, you are using a media type for the PDF style, but still, given that you've got a PARENT= and an IMPORT, I'm not sure how conflicting selectors would resolve. This seems a better question for Tech Support.
And, Reeza is correct, you could use your CSS file directly with either HTML, RTF or PDF by just specifying the CSSSTYLE= option, so I'm not sure you gain anything by importing the CSS file into a template.
02-09-2015 04:13 AM
Thanks for your reply. My gain by using an external CSS file is re-use of already
existing assets within the organization. I try to avoid re-capsuling into SAS.
When I can use the external CSS file within SAS than that is super great and I am happy.
Thanks for pointing out that the PDF conversion converts my relative pixel size to actual PT sizes.
That explains the mess up in the PDF output.
Furthermore. You are right. I use the SAME CSS file for PDF and HTML. That is really just for test purposes.