Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
file Handling
Bhargav Coca
Is it possible to push a html table into a file using simple file handeling. If so can any one show me how. I mean table with images included in it.
Thank you
Find more posts tagged with
Comments
jbonifaci
I think you need to be a little more specific. Do you just want to open a file and print html to it...
open(FILE, '>filePath');
print FILE <<HTML;
Content-Type: text/html; charset=ISO-8859-1
<html>
<body>
<table>
<tr>
<td><img src='imagePath' /></td>
</tr>
</table>
</body>
</html>
HTML
close(FILE);
That will open a file and print html to it that has table and image tags. Pretty straight forward.
~Jeff
Bhargav Coca
sorry the question turned out to be in a different way than it was intended for. I was trying the reverse apprroach for my issue posted here earlier.I am writing to a doc file and trying to set header and footer for a doc page from a tpl.
Here is the samll snippet.
<iw_pt name="contracting1"/>
<iw_perl><![CDATA[
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $iwmount = TeamSite::Config::iwgetmount();
$propFile = "$iwmount/default/main/NECWEB/WORKAREA/legal/docroot/docs/Test2.doc";
open(OUT, ">$propFile");
my $aboutType=iwpt_dcr_value("dcr.position.customerName");
print OUT "$aboutType\n";
<iw_perl><![CDATA[
print OUT <<HTML;
Content-Type:text/html;
charset=ISO-8859-1
]]></iw_perl>
<html>
<body>
<table>
<tr>
<td><img src='Y:/default/main/NECWEB/WORKAREA/legal/templatedata/CITS/contract/images/line' /></td>
</tr>
</table>
</body>
</html>
<iw_perl><![CDATA[
HTML
close(OUT);
]]></iw_perl>
Thank you
jbonifaci
You need to remove the the lines in red:
print OUT <<HTML;
Content-Type:text/html;
charset=ISO-8859-1
]]></iw_perl>
<html>
<body>
<table>
<tr>
<td><img src='Y:/default/main/NECWEB/WORKAREA/legal/templatedata/CITS/contract/images/line' /></td>
</tr>
</table>
</body>
</html>
<iw_perl><![CDATA[
HTML
close(OUT);
~Jeff
Bhargav Coca
No, its not working
I am writing it into doc file not as a html.
Thanks
Adam Stoller
I'm not sure, but I don't think you can write directly into a .doc file like that. I believe .doc files are
binary
You probably want to download / install / use:
Win32::Word::Writer
Win32::Word::Writer::Table
I have
not
used these modules - I simply did a search on
http://search.cpan.org
and found them.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com