Desktop productivity for business analysts and programmers

cellwidth doesnt work

Reply
Frequent Contributor
Posts: 97

cellwidth doesnt work

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;
SAS Super FREQ
Posts: 8,719

Re: cellwidth doesnt work

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
Frequent Contributor
Posts: 97

Re: cellwidth doesnt work

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...
SAS Super FREQ
Posts: 8,719

Re: cellwidth doesnt work

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
Ask a Question
Discussion stats
  • 3 replies
  • 114 views
  • 0 likes
  • 2 in conversation