Yes, creating Tab-delimited files is a great way to create data files in Excel. The only real difference between that way and the example above is that by using HTML, you can create formatted excel file.
- Coldfusion Output Excel File
- Export Excel File To Access
- Export Excel File To Jpg
- Export Excel File To Pdf
Active6 years, 1 month ago
Disclaimer: I am new into coldfusion.I am trying to create an Excel 2010 document with images and multiple tabs.I have been able to get this to output into XLS, but I cannot get the image into the file.
I have not been able to find a complete example of how to Properly create an XLSx file.I would prefer to learn the right way and develop my own bad habits later, rather than just have bad habits.
Here is an example:
Various processes that cover most of the usual water treatment applications are included to calculate the design and performance of an IX plant.
BTThomasBTThomas
2 Answers
I would suggest using the built-in spreadsheet functions of ColdFusion (first introduced in version 9). Here is the documentation for the SpreadsheetNew function. If you set the
xmlformat
parameter to 'true' it will create an .xlsx file.There are several examples on the web (and here on SO) of how to use these ColdFusion functions. Raymond Camden has a nice example here of how to generate a spreadsheet and deliver it directly to the user using the
Miguel-FMiguel-Fcfcontent
tag. Here is another example from Raymond that builds on the first example.12.3k4 gold badges27 silver badges49 bronze badges
I've been working on this all week and wanted to share the results. This code works for me using CF 9 on Windows Server 2008 R2. By the way, CFSpreadsheet seems to consume a lot of memory on larger exports. For this reason, we increased the server's physical memory then used CF Administrator to increase the jvm heap size in the Administrator -> Java and JVM settings. My max java heap size is now 3072 Gig.Need help? I recommend you contact Charlie Arehart on server issues: [email protected]
Code:
Example query is called 'Myquery' Spreadsheet is called 'Myspreadsheet' I export the spreadsheet to a subdirectory called 'xlsx' I use cflocation to direct the browser to the spreadsheet. The browser prompts the user to open, save or cancel.
Dave Kraft
user2618574user2618574
Not the answer you're looking for? Browse other questions tagged excelcoldfusionexcel-2007openxmlexcel-2010 or ask your own question.
Active4 years, 11 months ago
I'm using the code below to export data from a database to an Excel sheet. What I want to do is have a certain set of fields be exported to a different sheet in the same workbook. The end result being that each person's data is on a separate sheet rather than all combined on the same sheet like this code is doing. Any thoughts as to how I can write a formula or a piece of ColdFusion than will let me do this?
Also I'm using ColdFusion 8 so I can't use the cfspreadsheet function.
dukedevil294
dukedevil294dukedevil294
4 Answers
If you can't use
<cfspreadsheet>
, then I suggest using the Apache POI project instead of the simple 'HTML as Excel via CFCONTENT' approach. POI enables you to create actual Excel spreadsheets with all of the fun that's associated with them.Ben Nadel has a CFC wrapper that exposes the multi-sheet parts of the API.
Adrian J. MorenoAdrian J. Moreno10.7k1 gold badge26 silver badges35 bronze badges
I know this is an old topic, but this solution would have been helpful if I had found it earlier. However, here is a basic function call that should allow any number of queries put into an excel sheet with multiple tabs.
Peavey6505Peavey6505
Apache POI is def the way to go. http://poi.apache.org/
Take the time to read the documentation and do some tests bc it gives you total control rather than trying to fudge HTML tables with CSS.
Coldfusion Output Excel File
user1261365user1261365
If you can avoid using this method, it would be best. Excel is smart enough to output your HTML in an 'spreadsheet' looking output but it is still an HTML document with an xls extension. I've had several problems using spreadsheets created like this that expect an actual Excel file. In ColdFusion, if you try reading this file with cfspreadsheet you will most likely get a an error that says something like
expected binary input file
(or something close to that) and you'll have to use excel to save as
to make it an actual Excel spreadsheet. Not to mention this is a static output. You can't include any formulas or any fun stuff like iKnowKungFoo indicated.Export Excel File To Access
Since that doesn't answer your question, in addition to the POI tools you could also look into other BI tools, like JasperSoft, Crystal Reports, or if you're using Oracle or MS SQL Server you could look into Oracle's BI tools or SSRS for SQL Server. There are several BI tools that are free without a support option, I believe JasperSoft is one of them.
Back to ColdFusion, I've never tried using CFReport with report builder to create an Excel formated report but in CF 8 the excel format is available. I'm not sure if you can create multiple sheets with it, I would assume not considering the below snipit but it may be worth looking into. I couldn't find anything but it's early, I'm sick, and my google-foo is a bit slow this morning.
Export Excel File To Jpg
Note: The Excel report output format type provides limited support for the formatting options available in ColdFusion Reporting. Images and charts are not supported and numeric data containing formatting (commas, percents, currency, and so on) appear as plain text in Excel. The Excel output format supports simple reports only and Adobe recommends that you give careful design and layout consideration to reports designed for Excel output.
Openwall wordlists collection full version download. This wordlist is provided as a single text file. Its size is almost 500 MB and it has over 40 million entries. There's also a list of the common passwords and unique words for all the languages combined in one file (over 40 MB for almost 4 million entries). Finally, there's a huge list of all the common passwords and words from all the languages with word mangling rules applied (to form other likely passwords, such as by adding capitalization or digits to words) and any duplicates purged. The included languages are: Afrikaans, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Hungarian, Italian, Japanese, Latin, Norwegian, Polish, Russian, Spanish, Swahili, Swedish, Turkish, and Yiddish.
TravisTravisExport Excel File To Pdf
3,8652 gold badges17 silver badges31 bronze badges