Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posthtml

Status
Not open for further replies.

Kosa13

MIS
Mar 13, 2007
10
0
0
PL
Hello SAS programmers.

I am trying to do (using ODS) very simple HTML site. I wrote a code like this:



Data Fakedata;
Length fakevar $ 1;
Label fakevar = '00'X;
Fakevar = ' ';
Run;

Proc Template;
DEFINE STYLE Fish_Style;
STYLE Body / backgroundimage ="C:\Temp\Fishing_Club\Files\Tlo_1.gif" watermark=ON;
STYLE SysTitleAndFooterContainer / background = _undef_;
STYLE Systemtitle / background = _undef_;
STYLE SystemFooter FROM TitlesAndFooters "Controls system footer text." /
PROTECTSPECIALCHARS = OFF
background = _undef_;
END;
Run;


ODS HTML BODY="C:\Temp\Fishing_Club\Fish1.html" Style=Fish_Style;

TITLE1 " ";
TITLE2 COLOR="#FFEB8C" JUSTIFY=CENTER HEIGHT=6 FONT="Castellar" "Fishing Club";


Proc Print Data=Fakedata noobs label;
Var Fakevar / style(data) = [just=right
posthtml =
"
<a href='C:\Documents and Settings\kostas\Desktop\Photo\2007_06_19 - Wypad na Bolenia\IMG_4062.JPG'>
<IMG src='C:\Documents and Settings\kostas\Desktop\Photo\2007_06_19 - Wypad na Bolenia\IMG_4062.JPG'
height=125 width=100 alt='...' > </a>

<a href='C:\Documents and Settings\kostas\Desktop\Photo\2007_06_19 - Wypad na Bolenia\IMG_4063.JPG'>
<IMG src='C:\Documents and Settings\kostas\Desktop\Photo\2007_06_19 - Wypad na Bolenia\IMG_4063.JPG'
height=100 width=125 alt='...' > </a>

<a href='C:\Documents and Settings\kostas\Desktop\Photo\2007_06_19 - Wypad na Bolenia\IMG_4064.JPG'>
<IMG src='C:\Documents and Settings\kostas\Desktop\Photo\2007_06_19 - Wypad na Bolenia\IMG_4064.JPG'
height=100 width=125 alt='...' > </a>

"];
Run;

ODS HTML CLOSE;



Unfortunately I have WARNIG:

"WARNING: The quoted string currently being processed has become more than 512 characters long. You may have unbalanced quotation marks"

...and I don't now how correct this.

When I put more photos every photos are erased from the site.


Any solutions ???

Regards & thx
 
Hi Kosa13,

Im not 100% sure, but i think the problem might be with your posthtml = statement... I cant see any missing quotes, so i think it might just be a problem with the length of the statement.

It might be better if you put all your code into a Dataset below is a quick example of how it could be done:-

Code:
data Raw_Files; 
	length Dir folder File $50; 
  	input Dir & folder & File; 
	cards; 
	C:\Documents and Settings\kostas\Desktop\Photo\  2007_06_19 - Wypad na Bolenia\  IMG_4062.JPG 
	C:\Documents and Settings\kostas\Desktop\Photo\  2007_06_19 - Wypad na Bolenia\  IMG_4063.JPG 
	; 
run;

Data Format_Files;
	set Raw_Files;
	Length URL $300;
	URL = '<A Href="'||Trim(left(Dir))||Trim(left(folder))||Trim(left(File))||'"><Img Src="'||Trim(left(Dir))||Trim(left(folder))||Trim(left(File))||'"height=125 width=100 alt="..."> </a>';
run;


ODS HTML BODY="C:\Temp\Fishing_Club\Fish1.html" Style=Fish_Style;
	TITLE1 " ";
	TITLE2 COLOR="#FFEB8C" JUSTIFY=CENTER HEIGHT=6 FONT="Castellar" "Fishing Club";
		Proc Print Data=Format_Files(keep=URL) noobs label;
		Run;
ODS HTML CLOSE;

Hope that helps, lemme know if not.

Shenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top