LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 7 May 2010 17:00:00 -0400
Reply-To:   Ya Huang <ya.huang@AMYLIN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ya Huang <ya.huang@AMYLIN.COM>
Subject:   Re: Style to a proc report compute block
Comments:   To: Kevin Morgan <crafty876@HOTMAIL.COM>

Compute before MTPRDcode / style=[blabla...]; MTPRDLINE=put(MTPRDCODE, $grain_code.); line @ 1 Mtprdline $30. ; endcomp;

On Fri, 7 May 2010 15:51:40 -0500, Sudo Ku <crafty876@HOTMAIL.COM> wrote:

>Hello: > >I am working on a small report and I have almost got it exactly where I want it, almost.... I have two small issues that I need to overcome... > >1) I need to add some style to the put statement in the compute block which is a line for a grain name (wheat, durum, oats etc). in the report the grain name occurs before sub-types of each grain are summed. What I would like to do is apply some style to the actual grain name (at minimum it needs to be bold but I might also want to add some background color). I can format the columns in the fashion I want but the Style= statement in the compute block doesn?t work. >2) I also want to make the totals row always appear black. At present the format cfore will make the foreground white in the totals row if the total is 0. >I am using my own style sheet for this report. So if there is way of preparing adding to the style sheet to deal with either of these issues I?d be happy for the advice. > >An example of my code with some notes on what I am hoping to correct: > > >data have; >input MTPRDCode $ MTPSweeklycode $ DMWCDesc $ & opening_balance closing_balance; >cards; >01 A 1 CWRS 136128.860 141904.028 >01 B 2 CWRS 96344.050 108507.634 >01 C 3 CWRS 51657.319 55569.038 >01 D S.WHITE SP 52.130 52.130 >01 E TF 1 CWRS 1067.545 1610.529 >01 F TF 2 CWRS 1417.307 1866.211 >01 G TF 3 CWRS 1203.986 1292.969 >01 H 1 EXSTG RS 7273.104 1432.969 >01 I PRAIRIE SP 302.586 564.784 >01 J 2 EXSTG RS 1110.678 1110.678 >01 L CW FEED 12611.215 14222.265 >01 M DAMPS 262.668 262.668 >01 N H.WHITE SP 6804.797 6804.797 >01 P RED WINTER 29054.077 29232.469 >01 Q OTHERS 53631.099 55688.901 >01 R T 1EXSTGRS 0.000 0.000 >01 S T 2EXSTGRS 63.035 63.035 >01 W TF OTHERS 1253.815 1609.915 >02 A 1AMB DUR 36112.268 58591.791 >02 B 2AMB DUR 33861.260 26250.386 >02 C 3AMB DUR 16801.792 20179.876 >02 E 4AMB DUR 3288.688 3288.688 >02 F TOUGHS 4175.483 3344.559 >02 G DAMPS 638.915 638.915 >02 H OTHERS 6379.443 7860.343 >03 A 1 C W 1379.954 76.414 >03 B 2 C W 289.010 74.200 >03 C 3 C W 419.486 41.606 >03 D 4 C W -0.000 -0.000 >03 J TOUGHS -0.000 -0.000 >; >run; > >proc format; >value cfore >Low - -0.001 ='Black' >-0.001 - 0.001 = 'White' >0.001 - high = 'Black'; > >Value $grain_code >'01'='Wheat' >'02'='Durum' >'03'='Oats'; >run; > >OPtions Papersize="letter" nobyline Orientation='landscape' linesize=100 nopage nodate; >ODS rtf file="C:\SAS-L Proc Report Question.rtf" style=Printer /*I have a custom style sheet that I am using, > Printer is for this example*/; > >Proc report data=have nowindows split="_"; >Title J=C "SAS-L Summary Report" J=R "Program name & loc here"; >Title2"For GSW Week &Report_week Ending &GSWCAL_Fin"; >Footnote "Report Generaterated on &sysdate9. @ &systime."; >columns MTPRDCode MTPSweeklycode DMWCDesc opening_balance closing_balance; >define MTPRDcode / Group Format=$Grain_code. "Grain" noprint; >define MTPSWeeklycode / Group noprint; >define DMWCDesc / Group " " ; > *Style(Column)= {background=cxCCCCCC} /*CGC Medium Grey*/ > *style(column)={cellwidth=90pt}; >Define Opening_Balance / analysis sum format=comma18.3 "Opening_Balance" > style(column)={cellwidth=110pt > foreground=cfore.}; >Define Closing_Balance / analysis sum format=comma18.3 "Closing_Balance" > style(column)={cellwidth=110pt > foreground=cfore.}; >Compute before MTPRDcode; > MTPRDLINE=put(MTPRDCODE, $grain_code.); >line @ 1 Mtprdline $30. ; /*<--would like to apply to style to word that appears on this line*/ >endcomp; >****Create a textline for totals NB MTPRDcode is supressed***; >Compute after MTPRDcode; >DMWCDesc="Total"; >endcomp; >break after mtprdcode / summarize skip > Style(summary) = {foreground=DMBLACK font_weight=bold}; *<--This style starment doesn't work either > the Style (column) is taking preceedence; >run; >ods rtf close; > >Thanks for the help, >Kevin > > > >_________________________________________________________________ >30 days of prizes to be won with Hotmail. Enter Here. >http://go.microsoft.com/?linkid=9729709


Back to: Top of message | Previous page | Main SAS-L page