Copy link to clipboard
Copied
I am hoping someone can help me with Ben's POI utility to create a multi-tab spreadsheet. Don't get me wrong I have the code working completely - using CF9!
Here's the problem...my cfm template is almost 800 lines long - and to make matteres worse I was asked to create an addition worksheet - which means this one template will be the longest code file - in terms of amount of code written in ONE file - within my application... ...I generally do not like to write more than 250 - 300 lines of code in one CF template...
So one would think that the simplest solution would be to use CFINCLUDE - but it doesn't work...to be precise, nothing happens at all - no error, no output, nothing! - it's as if ColdFusion ignored the cfinclude call completely...
This is the code in the main template...
<!--- .: Import the POI tag library :. --->
<cfimport taglib="../assets/cf/tags/poi/" prefix="poi" />
<!--- .: *** ***** ******* MAIN.CFM ******* ***** *** :. --->
<!--- .: Create an excel document and store binary data into REQUEST variable :. --->
<poi:document name="REQUEST.ExcelData" file="#ExpandPath('./elements/reports/dynamic/DeliveryServicesRpt.xls')#"
style="font-family:verdana; font-size:10pt; color:black; white-space:nowrap;">
<!--- .: Define style classes :. --->
<poi:classes>
<poi:class name="class1" style="font-family:verdana; background-color:GREY_25_PERCENT; color:black; font-size:10pt;
text-align:center;" />
<poi:class name="class2" style="font-family:verdana; background-color:RED; color:white; font-size:10pt; text-align:center" />
<poi:class name="class3" style="font-family:verdana; background-color:DARK_RED; color:white; font-size:10pt; text-align:center" />
</poi:classes>
<!--- .: Define Sheets :. --->
<poi:sheets>
<!--- .: [1] Exec Summary by Dollars :. --->
<cfinclude template="execSum.cfm"> <!--- .: THIS CODE DOES NOT :. --->
</poi:sheets>
This is the code in the included template...
<!--- .: *** ***** ******* EXECSUM.CFM ******* ***** *** :. --->
<poi:sheet name="Exec Summary by Dollars" freezerow="1" orientation="landscape">
<poi:columns>
<!--- .: this is for the default column: Company :. --->
<poi:column style="width:250px;" />
... ... ...
</poi:columns>
... ... ...
<!--- .: GRAND TOTAL :. --->
<poi:row>
<poi:cell class="grandTot" value="Grand Total" style="text-align:right;" />
... ... ...
</poi:row>
</poi:sheet>
Does anyone know what's causing this...or better yet is there a solution / work around...
You need the CFIMPORT in every file that uses the tag lib. Otherwise the CF compiler diesn't know to look for non-CF tags which also need compiling.
--
Adam
Copy link to clipboard
Copied
You need the CFIMPORT in every file that uses the tag lib. Otherwise the CF compiler diesn't know to look for non-CF tags which also need compiling.
--
Adam
Copy link to clipboard
Copied
@Adam Cameron: WOW!!! I am extremely embrasses that I missed that...I am actually at a lost for words... Thanks Adam!