BookmarkSubscribeRSS Feed
SanjayM
Calcite | Level 5
Hi

Check the url
http://support.sas.com/forums/thread.jspa?messageID=5732ᙤ

ods html file='c:\temp\cw.html';
proc report data=sashelp.class nowd;
column name age height;
define age /display
style(column)={just=center cellwidth=400px};
run;
ods html close;

The code above generates an html file in temp folder that means to view a report we have to save the html in some tem folder.

If I dont want to save the html file and view the output in the browser how can I do it.
We use EG to develop the report.

Our code is.....

ODS PATH sashelp.mystore(read) SASHELP.TMPLMST (READ);
ods path show;
options nobyline nocenter ;


proc report data=WORK.QUERY_FOR_QUERY1731 nowd headskip split='*' spacing=1 formchar='-' ;
column col1 col2;
title j=l 'Report ID' j=c 'Report Title' j=r "%sysfunc(intnx(day1,"&sysdate"d,-1),ddmmyy10.)";
define Col1 / style(column)={just=center cellwidth=400px};
define Col2 / style(column)={just=center cellwidth=100px};
...
...
run;
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Here's what I did:
1) started EG
2) started a new project
3) pasted this code into a code node (WITHOUT the ODS HTML statements)
[pre]

proc report data=sashelp.class nowd;
column name age height;
define age /display style(column)={just=center cellwidth=400px};
run;

[/pre]
4) checked my EG options to make sure that HTML was selected as the result type (NOT SASReport)
5) Ran the code on Local
6) Ran the code on my other server
7) when the HTML output came back to EG, my cellwidth for the AGE column and my centering did work.

You do not need the ODS HTML sandwich statements in an EG code node. You can just take them out; however if you are testing code in a code node, using the ODS HTML "sandwich " is a quick way to create an HTML file for comparison purposes that you can go back to -- since you control the name of the file. However, if you make sure that the result type in EG is RTF, PDF or HTML, then you should find that cellwidth works for you -- even when you execute the code on a server other than Local.

If you are turning this program into a stored process and then returning the results to Web Report Studio, you may find that cellwidth does not work. There are some style= overrides that do not work correctly for WRS -- I think this might be one of them.

If you are using any other kind of output from EG -- such as TXT or LISTING output, then this technique will NOT work to widen the AGE column.

If you are still having problems with EG and style= overrides, your best bet for help is to contact Tech Support.

cynthia
SanjayM
Calcite | Level 5
We have some more columns. Hence the cellwidth keeps shrinking as we increase the columns

Try running the below code.

proc report data=sashelp.class nowd;
column name age height name age height name age height name age height;
define name /display style(column)={just=center cellwidth=400px};
run;

We want to standardize the column widths and the paper size
Please help...
Cynthia_sas
SAS Super FREQ
Hi,
What is your destination of choice?? HTML, RTF, PDF??? You cannot expect SAS to respect a papersize (as for PDF) and then expect cellwidth to stay fixed. ODS does the best it can to fit the report onto the page. So, yes, cellwidth will not be fixed if you try to put too much on a table row. And, every destination may treat cellwidth differently. Right now, RTF might behave differently depending on the font and margins. HTML and your browser may not respect the kind of HTML that gets written:
[pre]
style=" width: 400px;"
[/pre]

Your best bet for help, if you really have issues with cellwidth, is to contact Tech Support -- your technique may have to change depending on your destination and/or whether you are turning this code into code for a stored process. And, you may find out that what you want to do may work best in one destination over another.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1060 views
  • 0 likes
  • 2 in conversation