<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom CSS not applying in SAS Studio using _webout + data null in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Custom-CSS-not-applying-in-SAS-Studio-using-webout-data-null/m-p/975362#M11480</link>
    <description>&lt;P&gt;Hi there! The issue you’re seeing happens because the SAS Studio Results Pane &lt;STRONG data-start="178" data-end="233"&gt;doesn’t render HTML/CSS as a real web browser would&lt;/STRONG&gt;, it just shows the raw text, so any CSS or HTML tags are ignored. That’s why your styles don’t show up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To actually see your styled HTML, write the output to a physical &lt;CODE data-start="419" data-end="426"&gt;.html&lt;/CODE&gt; file (using the &lt;CODE data-start="443" data-end="449"&gt;file&lt;/CODE&gt; statement), then open that file in your web browser (like Chrome or Firefox). There, your CSS will work as expected!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    file '/path/report_test.html';
    put '&amp;lt;html&amp;gt;';
    put '&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body{color:red;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;';
    put '&amp;lt;body&amp;gt;Testing CSS :)&amp;lt;/body&amp;gt;';
    put '&amp;lt;/html&amp;gt;';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After running, just open the file in your browser and you’ll see your styles!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="856" data-end="1005"&gt;The Results Pane in SAS Studio can’t render CSS from &lt;CODE data-start="924" data-end="933"&gt;_webout&lt;/CODE&gt;. For a styled view, save as a &lt;CODE data-start="964" data-end="971"&gt;.html&lt;/CODE&gt; file and open it in your browser.&lt;/P&gt;
&lt;P data-start="856" data-end="1005"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="76" data-end="442"&gt;&lt;STRONG data-start="76" data-end="91"&gt;By the way,&lt;/STRONG&gt; if you’re running your code through the SAS Job Execution Service (JES)—for example, using SAS Viya or deploying your jobs as web endpoints—the output &lt;STRONG data-start="243" data-end="251"&gt;will&lt;/STRONG&gt; be rendered in a real web browser. In that scenario, your HTML and CSS should display exactly as you designed, because the response goes straight to the browser, not the Studio Results Pane.&lt;/P&gt;
&lt;P data-start="76" data-end="442"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="444" data-end="634"&gt;So, if you test your HTML report using Job Execution (accessing via a browser), your CSS will apply and look as expected. The main limitation is really with SAS Studio’s Results Pane itself.&lt;/P&gt;
&lt;P data-start="444" data-end="634"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI data-start="651" data-end="722"&gt;
&lt;P data-start="653" data-end="722"&gt;&lt;STRONG data-start="653" data-end="680"&gt;SAS Studio Results Pane&lt;/STRONG&gt;: no real HTML/CSS rendering (raw output).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="723" data-end="814"&gt;
&lt;P data-start="725" data-end="814"&gt;&lt;STRONG data-start="725" data-end="758"&gt;Job Execution (JES) / Browser&lt;/STRONG&gt;: real HTML/CSS rendering, everything works as designed.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1007" data-end="1023" data-is-last-node="" data-is-only-node=""&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Fri, 19 Sep 2025 11:13:38 GMT</pubDate>
    <dc:creator>arthurdpereira</dc:creator>
    <dc:date>2025-09-19T11:13:38Z</dc:date>
    <item>
      <title>Custom CSS not applying in SAS Studio using _webout + data null</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Custom-CSS-not-applying-in-SAS-Studio-using-webout-data-null/m-p/973382#M11464</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to generate a custom HTML report using data _null_ and the _webout fileref in &lt;STRONG&gt;SAS Studio&lt;/STRONG&gt;. I'm injecting my own CSS styles directly into the HTML using PUT statements, but the CSS doesn't seem to apply at all when viewed in the SAS Studio results pane.&lt;/P&gt;&lt;P&gt;Here’s a simplified version of my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data _null_;
    file _webout;
    put '&amp;lt;style&amp;gt;';
    put '*,*:before,*:after{box-sizing:border-box}';
    put 'body{font-family:Arial,Helvetica,sans-serif;margin:0;padding:18px;}';
    put '.pm{max-width:820px;margin:0 auto;}';
    put '.pm-title{font-size:22px;font-weight:700;color:#2b5c83;';
    put '  border:2px solid #2b5c83;padding:10px 14px;border-radius:6px;';
    put '  margin-bottom:14px;display:inline-block;}';

    put '.card{border:1px solid #d9dee6;background:#f4f6f8;margin:10px 0;';
    put '  border-radius:8px;padding:16px 18px;}';
    put '.card.top{background:#e9f7e6;}';

    put '.card h3{margin:0 0 10px 0;font-size:16px;color:#2d4c6b;}';
    put '.card h3 .method{font-weight:700;text-decoration:underline;}';

    put '.metric{margin:8px 0;}';
    put '.metric .label{font-weight:700;color:#333;margin-bottom:4px;}';
    put '.metric .value{font-size:14px;color:#333;}';
    put '.metric .value.big{font-size:32px;line-height:1;color:#3a7bd5;';
    put '  font-weight:800;letter-spacing:0.5px;}';
    put '.metric .value.rate{font-size:18px;font-weight:700;}';
    put '&amp;lt;/style&amp;gt;';

	put '&amp;lt;div class="pm"&amp;gt;';
run;

data _null_;
    set public.prediksi_premium_rate_row;
    file _webout mod; 
    put '&amp;lt;div&amp;gt;';
    put '  &amp;lt;h3&amp;gt;Model &amp;lt;span class="method"&amp;gt;' metode '&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;';

    put '  &amp;lt;div class="metric"&amp;gt;';
    put '    &amp;lt;div class="label"&amp;gt;Premium&amp;lt;/div&amp;gt;';
    put '    &amp;lt;div class="value big"&amp;gt;' premium comma20 '&amp;lt;/div&amp;gt;';
    put '  &amp;lt;/div&amp;gt;';

    put '  &amp;lt;div class="metric"&amp;gt;';
    put '    &amp;lt;div class="label"&amp;gt;Premium Rate&amp;lt;/div&amp;gt;';
    put '    &amp;lt;div class="value rate"&amp;gt;' rate COMMA12.4 '&amp;lt;/div&amp;gt;';
    put '  &amp;lt;/div&amp;gt;';
    put '&amp;lt;/div&amp;gt;';
run;

data _null_;
    file _webout mod;
    put '&amp;lt;/div&amp;gt;';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the styles are not applying at all (the text doesn’t change size or color). I'm expecting it to look styled, but it's just plain unformatted HTML.&lt;/P&gt;&lt;P&gt;My question is, why isn't the CSS applying in the _webout output in SAS Studio?&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 08:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Custom-CSS-not-applying-in-SAS-Studio-using-webout-data-null/m-p/973382#M11464</guid>
      <dc:creator>rabkabizan</dc:creator>
      <dc:date>2025-08-27T08:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Custom CSS not applying in SAS Studio using _webout + data null</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Custom-CSS-not-applying-in-SAS-Studio-using-webout-data-null/m-p/975362#M11480</link>
      <description>&lt;P&gt;Hi there! The issue you’re seeing happens because the SAS Studio Results Pane &lt;STRONG data-start="178" data-end="233"&gt;doesn’t render HTML/CSS as a real web browser would&lt;/STRONG&gt;, it just shows the raw text, so any CSS or HTML tags are ignored. That’s why your styles don’t show up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To actually see your styled HTML, write the output to a physical &lt;CODE data-start="419" data-end="426"&gt;.html&lt;/CODE&gt; file (using the &lt;CODE data-start="443" data-end="449"&gt;file&lt;/CODE&gt; statement), then open that file in your web browser (like Chrome or Firefox). There, your CSS will work as expected!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    file '/path/report_test.html';
    put '&amp;lt;html&amp;gt;';
    put '&amp;lt;head&amp;gt;&amp;lt;style&amp;gt;body{color:red;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;';
    put '&amp;lt;body&amp;gt;Testing CSS :)&amp;lt;/body&amp;gt;';
    put '&amp;lt;/html&amp;gt;';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After running, just open the file in your browser and you’ll see your styles!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="856" data-end="1005"&gt;The Results Pane in SAS Studio can’t render CSS from &lt;CODE data-start="924" data-end="933"&gt;_webout&lt;/CODE&gt;. For a styled view, save as a &lt;CODE data-start="964" data-end="971"&gt;.html&lt;/CODE&gt; file and open it in your browser.&lt;/P&gt;
&lt;P data-start="856" data-end="1005"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="76" data-end="442"&gt;&lt;STRONG data-start="76" data-end="91"&gt;By the way,&lt;/STRONG&gt; if you’re running your code through the SAS Job Execution Service (JES)—for example, using SAS Viya or deploying your jobs as web endpoints—the output &lt;STRONG data-start="243" data-end="251"&gt;will&lt;/STRONG&gt; be rendered in a real web browser. In that scenario, your HTML and CSS should display exactly as you designed, because the response goes straight to the browser, not the Studio Results Pane.&lt;/P&gt;
&lt;P data-start="76" data-end="442"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="444" data-end="634"&gt;So, if you test your HTML report using Job Execution (accessing via a browser), your CSS will apply and look as expected. The main limitation is really with SAS Studio’s Results Pane itself.&lt;/P&gt;
&lt;P data-start="444" data-end="634"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI data-start="651" data-end="722"&gt;
&lt;P data-start="653" data-end="722"&gt;&lt;STRONG data-start="653" data-end="680"&gt;SAS Studio Results Pane&lt;/STRONG&gt;: no real HTML/CSS rendering (raw output).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="723" data-end="814"&gt;
&lt;P data-start="725" data-end="814"&gt;&lt;STRONG data-start="725" data-end="758"&gt;Job Execution (JES) / Browser&lt;/STRONG&gt;: real HTML/CSS rendering, everything works as designed.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1007" data-end="1023" data-is-last-node="" data-is-only-node=""&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 11:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Custom-CSS-not-applying-in-SAS-Studio-using-webout-data-null/m-p/975362#M11480</guid>
      <dc:creator>arthurdpereira</dc:creator>
      <dc:date>2025-09-19T11:13:38Z</dc:date>
    </item>
  </channel>
</rss>

