BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Wang_Yajun
Obsidian | Level 7

Hello,

 

Combined ODS HTML statement with PROC SGPLOT, I tried to generate a bunch of both separate .png files and .html files, and it really worked, and can be viewed on my local computer perfectly(See the Source Code below). When I tried to share the .png and .html files with my colleagues, the .html files cannot be opened by  IE, and generated an error message "Internet explorer has disabled the execution script and active control",  I wonder if there is any way to display the .html files correctly in any PC.

 

ODS HTML PATH ="&path.\贷款投向行业分析" GPATH = "&path.\贷款投向行业分析\图片" FILE = "各银行制造业大类投向占比.html";
OPTIONS NOBYLINE;
ODS GRAPHICS / IMAGEMAP=ON;
PROC SGPLOT DATA=ANA_IB_BIND_MFG_P2_ADJ(WHERE=(INDUSTRY_NAME_G NE '制造业合计')) DATTRMAP = ATTRMAP_LINE_2;
	BY BANK_ORDER1 CN_SHORTNAME NOTSORTED ;
	TITLE '#BYVAL1..#BYVAL2--2015年4季度至2017年3季度制造业大类投向占比';
	SERIES X =  REP_DT Y = LOAN_BAL_ALL_PCT/ MARKERS GROUP = INDUSTRY_NAME_G GROUPORDER = DATA ATTRID = INDUS_B
	SMOOTHCONNECT
	TIP = (REP_DT INDUSTRY_NAME_G LOAN_BAL_ALL_PCT)
	TIPLABEL = (AUTO '行业' '投向占比')
	;
	XAXIS  VALUEATTRS = (SIZE = 8 WEIGHT = BOLD) DISPLAY = (NOLABEL)  
	VALUESFORMAT = YYQC4.
	INTERVAL = QUARTER
	VALUES=("31DEC15"d TO "31DEC17"d BY QUARTER) 
	;
	YAXIS 
	VALUES=(0.15 0.2 TO 0.4 BY 0.025) 
	VALUEATTRS = (SIZE = 8 FAMILY = ARIAL) LABELATTRS = (Weight=Bold SIZE = 8) LABELPOS= DATACENTER GRID;
	KEYLEGEND  /NOBORDER POSITION = BOTTOMLEFT ACROSS = 3 AUTOITEMSIZE TITLE = "" ;
RUN;
ODS HTML CLOSE;
ODS HTML;

 Undisplayed Html Screenshot.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

I think the main problem is that the path is getting embedded in your HTML file. When you share you output with your colleagues, they do not have those paths. My recommendation is that you do the following on the ODS HTML statement:

 

1. Put (url=none) after the PATH option to prevent the path from being added to the HTML file.

2. Remove the GPATH option so that your images are written to the same directory as your HTML output.

 

Then, they can download the attachments into one directory and see the result as you do.

 

Hope this helps!

Dan

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

I think the main problem is that the path is getting embedded in your HTML file. When you share you output with your colleagues, they do not have those paths. My recommendation is that you do the following on the ODS HTML statement:

 

1. Put (url=none) after the PATH option to prevent the path from being added to the HTML file.

2. Remove the GPATH option so that your images are written to the same directory as your HTML output.

 

Then, they can download the attachments into one directory and see the result as you do.

 

Hope this helps!

Dan

Wang_Yajun
Obsidian | Level 7

Thanks for your reply, it really worked. 

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 1985 views
  • 0 likes
  • 2 in conversation