Re: writing to ms excel with jexcel [heur SPAMTRAP]
On Sun, 11 May 2008 10:13:09 -0400 (EDT), Richard White [EMAIL PROTECTED] wrote: kind enough to provide me with a translation of the java instructions into coldfusion please :) cfscript outFile = createObject(java, java.io.File).init(e:\temp\excel\test.xls); workBook=createObject(java,jxl.Workbook).createWorkbook(outFile); labelObj=createObject(java,jxl.write.Label); numberObj=createObject(java,jxl.write.Number); sheet = workBook.createSheet(First Sheet, 0); thisLabel=labelObj.init(0,0,happy happy gizmo); sheet.addCell(thisLabel); thisNumber=numberObj.init(0, 1, 3.1459); sheet.addCell(thisNumber); workbook.write(); workbook.close(); /cfscript ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305065 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: writing to ms excel with jexcel [heur SPAMTRAP]
thanks very much paul, it works perfectly :) thanks again richard kind enough to provide me with a translation of the java instructions into coldfusion please :) cfscript outFile = createObject(java, java.io.File).init(e:\temp\excel\test.xls); workBook=createObject(java,jxl.Workbook).createWorkbook(outFile); labelObj=createObject(java,jxl.write.Label); numberObj=createObject(java,jxl.write.Number); sheet = workBook.createSheet(First Sheet, 0); thisLabel=labelObj.init(0,0,happy happy gizmo); sheet.addCell(thisLabel); thisNumber=numberObj.init(0, 1, 3.1459); sheet.addCell(thisNumber); workbook.write(); workbook.close(); /cfscript ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305066 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: writing to ms excel with jexcel [heur SPAMTRAP]
hi paul, thanks again for this just one more thing then i have everything i need :) there are sections in the documentation that allows for number formatting and date formatting such as: WritableCellFormat integerFormat = new WritableCellFormat (NumberFormats.INTEGER); Number number2 = new Number(0, 4, 3.141519, integerFormat); sheet.addCell(number2); WritableCellFormat floatFormat = new WritableCellFormat (NumberFormats.FLOAT); Number number3 = new Number(1, 4, 3.141519, floatFormat); sheet.addCell(number3); NumberFormat fivedps = new NumberFormat(#.#); WritableCellFormat fivedpsFormat = new WritableCellFormat(fivedps); Number number4 = new Number(2, 4, 3.141519, fivedpsFormat); sheet.addCell(number4); // Get the current date and time from the Calendar object Date now = Calendar.getInstance().getTime(); DateFormat customDateFormat = new DateFormat (dd MMM hh:mm:ss); WritableCellFormat dateFormat = new WritableCellFormat (customDateFormat); DateTime dateCell = new DateTime(0, 6, now, dateFormat); sheet.addCell(dateCell); and i have noticed that you translated it to: labelObj=createObject(java,jxl.write.Label); numberObj=createObject(java,jxl.write.Number); thisLabel=labelObj.init(0,0,happy happy gizmo); sheet.addCell(thisLabel); thisNumber=numberObj.init(0, 1, 3.1459); sheet.addCell(thisNumber); therefore how would you translate this formatting stated above thanks very much richard kind enough to provide me with a translation of the java instructions into coldfusion please :) cfscript outFile = createObject(java, java.io.File).init(e:\temp\excel\test.xls); workBook=createObject(java,jxl.Workbook).createWorkbook(outFile); labelObj=createObject(java,jxl.write.Label); numberObj=createObject(java,jxl.write.Number); sheet = workBook.createSheet(First Sheet, 0); thisLabel=labelObj.init(0,0,happy happy gizmo); sheet.addCell(thisLabel); thisNumber=numberObj.init(0, 1, 3.1459); sheet.addCell(thisNumber); workbook.write(); workbook.close(); /cfscript ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305067 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: writing to ms excel with jexcel [heur SPAMTRAP]
therefore how would you translate this formatting stated above cfscript outFile = createObject(java, java.io.File).init( e:\temp\excel\test.xls ); workBook=createObject(java,jxl.Workbook).createWorkbook(outFile); labelObj=createObject(java,jxl.write.Label); numberObj=createObject(java,jxl.write.Number); sheet = workBook.createSheet(First Sheet, 0); thisLabel=labelObj.init(0,0,happy happy gizmo); sheet.addCell(thisLabel); thisNumber=numberObj.init(0, 1, 3.1459); sheet.addCell(thisNumber); NumberFormats = createObject(java, jxl.write.NumberFormats); WritableCellFormat = createObject(java, jxl.write.WritableCellFormat); Number = createObject(java, jxl.write.Number); DateFormat = createObject(java, jxl.write.DateFormat); DateTime = createObject(java, jxl.write.DateTime); Calendar = createObject(java, java.util.Calendar); NumberFormat = createObject(java, jxl.write.NumberFormat); integerFormat = WritableCellFormat.init( NumberFormats.INTEGER ); number2 = Number.init( 0, 4, 3.141519, integerFormat ); sheet.addCell( number2 ); floatFormat = WritableCellFormat.init( NumberFormats.FLOAT ); number3 = Number.init( 1, 4, 3.141519, floatFormat ); sheet.addCell( number3 ); // note, # signs are escaped/doubled for CF fivedps = NumberFormat.init(##.##); fivedpsFormat = WritableCellFormat.init( fivedps ); number4 = Number.init( 2, 4, 3.141519, fivedpsFormat ); sheet.addCell( number4 ); // Get the current date and time from the Calendar object now = Calendar.getInstance().getTime(); customDateFormat = DateFormat.init( dd MMM hh:mm:ss ); dateFormat = WritableCellFormat.init( customDateFormat ); dateCell = DateTime.init( 0, 6, now, dateFormat ); sheet.addCell( dateCell ); workbook.write(); workbook.close(); WriteOutput(Done); /cfscript ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305069 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: writing to ms excel with jexcel [heur SPAMTRAP]
excellent, thanks very much :) works fine!!! therefore how would you translate this formatting stated above cfscript outFile = createObject(java, java.io.File).init( e:\temp\excel\test.xls ); workBook=createObject(java,jxl.Workbook).createWorkbook(outFile); labelObj=createObject(java,jxl.write.Label); numberObj=createObject(java,jxl.write.Number); sheet = workBook.createSheet(First Sheet, 0); thisLabel=labelObj.init(0,0,happy happy gizmo); sheet.addCell(thisLabel); thisNumber=numberObj.init(0, 1, 3.1459); sheet.addCell(thisNumber); NumberFormats = createObject(java, jxl.write.NumberFormats); WritableCellFormat = createObject(java, jxl.write.WritableCellFormat); Number = createObject(java, jxl.write.Number); DateFormat = createObject(java, jxl.write.DateFormat); DateTime = createObject(java, jxl.write.DateTime); Calendar = createObject(java, java.util.Calendar); NumberFormat = createObject(java, jxl.write.NumberFormat); integerFormat = WritableCellFormat.init( NumberFormats.INTEGER ); number2 = Number.init( 0, 4, 3.141519, integerFormat ); sheet.addCell( number2 ); floatFormat = WritableCellFormat.init( NumberFormats.FLOAT ); number3 = Number.init( 1, 4, 3.141519, floatFormat ); sheet.addCell( number3 ); // note, # signs are escaped/doubled for CF fivedps = NumberFormat.init(##.##); fivedpsFormat = WritableCellFormat.init( fivedps ); number4 = Number.init( 2, 4, 3.141519, fivedpsFormat ); sheet.addCell( number4 ); // Get the current date and time from the Calendar object now = Calendar.getInstance().getTime(); customDateFormat = DateFormat.init( dd MMM hh:mm:ss ); dateFormat = WritableCellFormat.init( customDateFormat ); dateCell = DateTime.init( 0, 6, now, dateFormat ); sheet.addCell( dateCell ); workbook.write(); workbook.close(); WriteOutput(Done); /cfscript ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305071 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4