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);

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212497
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to