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)
creating word doc
Bhargav Coca
I am TS6.5 on win 2000, I have the same old problem with generating a word doc. here is my tpl attached with the post. I can display items which are not replicants in the word, but for the replicants it is failing. Please let me know where i am going wrong.
Thank you
Find more posts tagged with
Comments
jbonifaci
Which lines of code are you having a problem with? What is the problem you are experiencing? What is being output to the document? How does it differ from what you actually want output?
~Jeff
Bhargav Coca
Ok, I am getting the system admin and end dates into the word doc, I am not getting the "Current Projects" and "Project status" and Non-Project into the work document. I have defined them outside the word creating string and called it inside the table too. But still it doesn't like to take it.
Thanks
jbonifaci
What are the values of $currentproject, $rojectstatus and $nonproject? As we talked about before, even if this code is currently working, at the end of the iterate, which comes before the creation of the word doc, these would contain the values of these fields in the last replicant only. The rest of the replicants would be ignored.
Also, the way the tpl currently is, nothing will currently be output the browser or generated file in your table for Current Projects, Project Status and Non-Project Tasks. This is because you are not outputting these values, but only assigning them to variables.
Anothing thing I noticed is the following:
<iw_perl>
...
my $fileContent = <<
FILE_CONTENT
;
...
###################Setting Extended Atrributes#############
<iw_perl>
<![CDATA[
use TeamSite::Config;
my $OFile = iwpt_get_ofile_name();
$OFile =~s#\\#/#g;
open(MYFILE, ">$OFile"); #We have to create our output file before setting the attributes
close(MYFILE);
my $IWHome = TeamSite::Config::iwgethome();
$IWHome =~s#\\#/#g;
my $IWExtAttr = "$IWHome/bin/iwextattr.exe";
my $setSystemAdministrator = "$IWExtAttr -s \"SystemAdministrator\"=\"".iwpt_dcr_value('dcr.StatusReport.SystemAdministrator') ."\" $OFile";
my $setStatusForWeekEnding = "$IWExtAttr -s \"StatusForWeekEnding\"=\"".iwpt_dcr_value('dcr.StatusReport.StatusForWeekEnding') ."\" $OFile";
my $setCurrentProjects = "$IWExtAttr -s \"Keywords\"=\"".iwpt_dcr_value('dcr.StatusReport.keywords') ."\" $OFile";
system($setCurrentProjects);
system($setSystemAdministrator);
system($setStatusForWeekEnding);
]]>
</iw_perl>
########################################################################
...
FILE_CONTENT
...
</iw_perl>
First of all, you'll notice that you have an iw_perl tag nested inside another iw_perl tag. Worse yet, you'll notice that this nested iw_perl chunk of code is within a here doc. For both of these reasons, I can't imagine this is working. If for some weird reason it is, it is far from a best practice and should be rearchitected for many reasons. The best of which is that there is no apparent reason for it to be where it is.
~Jeff