BookmarkSubscribeRSS Feed
JDMTX
Fluorite | Level 6
Need some input on the construct of a list report that I am working on in WRS. Does anyone now the answer to the following items?

1. When a list report is rendered in WRS via the use of a stored process, do the proc report or proc print procedures explicitly control column layout and column wrapping or are these setting overridden by WRS?
2. Does WRS support the creation of list reports where the columns of a data observations can be split across multiple rows. I know that I can dow this in Crystal Reports and Cognos but have not seen this capability explicitly mentioned in any user documentation. For example, a single record consists of a name and address on line 1 and line two of observation consists of a comment.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
It is possible, if you use PROC PRINT or PROC REPORT in a stored process, that the output might look different than it does in an ODS HTML file or in an EG report. This is because Web Report Studio "receives" all stored process output as SASReport XML and the column wrapping could be impacted by Web Report Studio settings. The column layout -- if by this you mean the left-to-right order of the variables on the report -- that should be the same whether you use Web Report Studio or EG or ODS HTML, RTF or PDF for your stored process. If you mean something else by "layout", then you'll have to explain further.

The only feature of PROC REPORT that might not work with Web Report Studio is the use of the LINE statement -- there is not a good way for the SASReport XML to display LINE statement output and in earlier versions of the BI Platform, a stored process that contained a LINE statement did not render correctly in Web Report Studio: http://support.sas.com/kb/19/950.html

About your second question ... an observation in a SAS dataset has only rows and columns -- it does not have "report lines". Let's consider this data, for example:
[pre]
name address comment
Sam Iam 1234 Seuss Blvd Does not like green eggs and ham
J. A. Berwock 5678 Wonderland Dr Very cantakerous client
Kermit Frog 123 Sesame Street Says that it is not easy being green
Gobo Fraggle 567 Fraggle Rock Plays well with others
[/pre]

It seems to me that you are asking whether a report based on the above data can be displayed on multiple report rows. And the answer is, not by default. By default, a simple List report would create a report with 4 rows (1 row for each obs) and 3 columns (1 report column for each variable).

However, you could write a report using PROC REPORT and a LINE statement to put the comment under the name and address -- you would essentially have NAME and ADDRESS on one report row and then have the comment underneath the NAME and ADDRESS on a second report row -- however, you'd have to use a LINE statement to accomplish this. So in versions of Web Report Studio that did not support the LINE statement in a stored process, this approach would not work.

Another approach would be to restructure the data, as shown in the program below. I haven't tested it as a stored process, but a simple report like this should be OK in Web Report Studio. (You might still have to lose the LINE statement that provides the extra spacing.)

cynthia
[pre]
** make some fake client data with comment variable;
data client_info;
length name $25 address $25 comment $200;
infile datalines dlm=',' dsd;
input name $ address $ comment $;
origord = _n_;
return;
datalines;
"Sam Iam","1234 Seuss Blvd","Does not like green eggs and ham"
"J. A. Berwock","5678 Wonderland Dr","Very cantakerous client"
"Kermit Frog","123 Sesame Street","Says that it is not easy being green"
"Gobo Fraggle","567 Fraggle Rock","Plays well with others"
;
run;

** restructure data so there are multiple report lines for every observation;
data alt_method;
length info $200 Type $8;
set client_info;
keep origord linenum type info;
linenum = 1;
type = 'Name';
info = trim(name);
output;
linenum = 2;
type = 'Address';
info = trim(address);
output;
linenum = 3;
type = 'Comment';
info = trim(comment);
output;
run;

** show report using restructured data;
ods listing close;
ods html file='c:\temp\pseudo_wrap.html' style=sasweb;
proc report data=alt_method nowd;
column origord linenum type info;
define origord / order noprint;
define linenum / order noprint;
define type / order order=data 'Type' style(column)=Header;
define info / display 'Information';
compute after origord;
line ' ';
endcomp;
run;
ods html close;
[/pre]

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!

How to Concatenate Values

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.

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
  • 1 reply
  • 735 views
  • 0 likes
  • 2 in conversation