When I am using the below code, I am seeing proper formatted reports in my EG but if I send it on email the columns are shrink and small. In my outlook email the output column is not aligned and formatted. When I am getting an option of how the message is displayed and to view it in a browser I am getting proper format and column width. IS there any way I can increase the size/width of column size. Is it code issue or email setting issue
Proc Report data=BS1_Sample_code Missing split="*" nowd
Style (report)= {just=left borderwidth=0.5 font =('zurich b',9PT) bordercolor=black font_size=2}
Style (header)= {foreground=white background=blue font_size=2 font=('zurich b',9PT) fontweight=bold bordercolor=black}
Style (column)= {just=center foreground=black font_size=2 borderwidth=0.5 borderstyle=solid bordercolor=black};
column ("Balance Sheet - Amount- (USD) in 1000's"(Entity_Cd Vs_Product VS_Product_L1
CURRENT_DAY_USD PREVIOUS_DAY_USD Variance Variance_per));
Define Entity_Cd/"ENTITY" group style={just=L cellwidth=0.9} ;
Define Vs_Product/"Vs Product" group style={just=L cellwidth=0.9} ;
Define VS_Product_L1/"VS_Product_L1" group style={just=L cellwidth=0.9} ;
Define CURRENT_DAY_USD/analysis sum "11JUN2023 - AMOUNT USD" format= 20. style={just=r cellwidth=0.5};
Define PREVIOUS_DAY_USD/analysis sum "10JUN2023 - AMOUNT USD" format= 20. style={just=r cellwidth=0.5};
Define Variance/analysis sum "Variance" format= 20. style={just=r cellwidth=0.5};
Define Variance_per/"Variance %" computed format=percent8.2 style={just=r cellwidth=0.5};
compute Variance_per;
Variance_per=(CURRENT_DAY_USD.sum-PREVIOUS_DAY_USD.sum)/PREVIOUS_DAY_USD.sum;
endcomp;
compute after Vs_Product;
Vs_Product="Total"||''||Vs_Product;
call define(_row_,"style","style={background=cxEEFFFF}");
endcomp;
break after Vs_Product / dol skip summarize;
rbreak after / style ={background=brown};
Suggestion with options like Cellwidth: supply a unit of measure. One piece of software might default to a different unit so what you think is .9 inches might be interpreted as .9cm elsewhere. Same with fonts use a standard unit of measure like points instead of the relative font_size=2. Do you know what that 2 means?
Another approach would be to create a document format like RTF and PDF, where you can see the result externally from the email program and attach the document instead of placing the report directly into the email.
@sameer112217 wrote:
When I am using the below code, I am seeing proper formatted reports in my EG but if I send it on email the columns are shrink and small. In my outlook email the output column is not aligned and formatted. When I am getting an option of how the message is displayed and to view it in a browser I am getting proper format and column width. IS there any way I can increase the size/width of column size. Is it code issue or email setting issue
Proc Report data=BS1_Sample_code Missing split="*" nowd
Style (report)= {just=left borderwidth=0.5 font =('zurich b',9PT) bordercolor=black font_size=2}
Style (header)= {foreground=white background=blue font_size=2 font=('zurich b',9PT) fontweight=bold bordercolor=black}
Style (column)= {just=center foreground=black font_size=2 borderwidth=0.5 borderstyle=solid bordercolor=black};column ("Balance Sheet - Amount- (USD) in 1000's"(Entity_Cd Vs_Product VS_Product_L1
CURRENT_DAY_USD PREVIOUS_DAY_USD Variance Variance_per));Define Entity_Cd/"ENTITY" group style={just=L cellwidth=0.9} ;
Define Vs_Product/"Vs Product" group style={just=L cellwidth=0.9} ;
Define VS_Product_L1/"VS_Product_L1" group style={just=L cellwidth=0.9} ;
Define CURRENT_DAY_USD/analysis sum "11JUN2023 - AMOUNT USD" format= 20. style={just=r cellwidth=0.5};
Define PREVIOUS_DAY_USD/analysis sum "10JUN2023 - AMOUNT USD" format= 20. style={just=r cellwidth=0.5};
Define Variance/analysis sum "Variance" format= 20. style={just=r cellwidth=0.5};
Define Variance_per/"Variance %" computed format=percent8.2 style={just=r cellwidth=0.5};compute Variance_per;
Variance_per=(CURRENT_DAY_USD.sum-PREVIOUS_DAY_USD.sum)/PREVIOUS_DAY_USD.sum;
endcomp;compute after Vs_Product;
Vs_Product="Total"||''||Vs_Product;
call define(_row_,"style","style={background=cxEEFFFF}");
endcomp;
break after Vs_Product / dol skip summarize;
rbreak after / style ={background=brown};
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.