There is a way to name and create individual reports - you have to use POI
from Apache.  If you are on CFMX 6.1 you need to download it, but if you are
on CFMX 7 then you can use POI straight out of the box!

http://jakarta.apache.org/poi/index.html

Do not go down the HTML route its crap - slow and cumbersome.  

With POI you can do the following (this is straight out of my code so wont
work straight off but you get the idea).  You can also merge columns
etc...very powerful.


// begin Java / Excel stuff
        workBook =
createObject("java","org.apache.poi.hssf.usermodel.HSSFWorkbook").init();
        workSheet = workBook.createSheet();
        workBook.setSheetName(0, "Sheet Name");

        // Add headings row, bold, underline
        font = workBook.createFont();
        font.setBoldweight(font.BOLDWEIGHT_BOLD);
        style = workBook.createCellStyle();
        style.setFont(font);
        style.setWrapText(false);

        // Add headings row, bold, underline
        row = workSheet.createRow(0);
        font.setUnderline(true);
        style.setFont(font);
        for (i=1; i LTE ArrayLen(aColumns); i=i+1) {
                cell = row.createCell(Evaluate(i-1));
                cell.setCellvalue(aColumns[i].ColumnDesc);
                cell.setCellStyle(style);
                // set width, supposedly in units of 1/256 of character
width
                workSheet.setColumnWidth(Evaluate(i-1),
Evaluate((Len(ListFirst(aColumns[i].ColumnDesc, " ")) + 2) * 256));
        }

        // Add data from query in session
        for (j=1; j LTE session.rsExhibitorData.RecordCount; j=j+1) {
                row = workSheet.createRow(Evaluate(j));
                for (i=1; i LTE ArrayLen(aColumns); i=i+1) {
                        cell = row.createCell(Evaluate(i-1));
                        // add data
        
cell.setCellvalue(session.rsExhibitorData[aColumns[i].ColumnName][j]);

                }
        }

        filename = GetDirectoryFromPath(GetCurrentTemplatePath()) &
CreateUUID() & ".xls";
        fileOutStream =
createObject("java","java.io.FileOutputStream").init(filename);
        workBook.write(fileOutStream);
        fileOutStream.close();

        zipfilename = "report_" &
DateFormat(CreateDate(year(now()),month(now()),day(now())),"mm_dd_yyyy") &
".zip";
        // zip up
        ZipFileNew(expandPath("#zipfilename#"),filename);






-----Original Message-----
From: J Elder [mailto:[EMAIL PROTECTED] 
Sent: 21 July 2005 20:13
To: CF-Talk
Subject: Re: cfcontent - for an excel file

Best way to do this is create the excel file and save as html. Then
use that source.
This is what you need:

<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet 1</x:Name>
    <x:WorksheetOptions>
     <x:Print>
      <x:ValidPrinterInfo/>
      <x:HorizontalResolution>600</x:HorizontalResolution>
      <x:Verti
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212496
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to