Traditional web-based reporting with SAS BI tools

Design of List Reports

Reply
Contributor
Posts: 62

Design of List Reports

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

Re: Design of List Reports

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]
Post a Question
Discussion Stats
  • 1 reply
  • 148 views
  • 0 likes
  • 2 in conversation