cfspreadsheet

Format <cfspreadsheet> as table

前提是你 提交于 2020-01-16 03:43:04
问题 I'm using <cfspreadsheet> to output a database query to an Excel spreadsheet. When these spreadsheets are created manually it is possible to highlight all the cells and 'Format as table' . This means when the table header is clicked, the user can sort the table ascending and descending. Is it possible to specify this formatting in the ColdFusion code when generating the Excel file? 回答1: If you are on Coldfusion 9, you can use SpreadSheetNew, then SpreadSheetAddRow, SpreadSheetFormat functions

Error while creating validation dropdown in spreadsheet using ColdFusion

对着背影说爱祢 提交于 2019-12-31 04:55:06
问题 I am just creating a validation dropdown in a spreadsheet, from a database query, using ColdFusion. But I am getting the following error "string literals in formulas can't be bigger then 255 character ASCII" Can any one please help to rectify this as I need this functionality urgently. <cfset pop_array = ArrayNew(1)> <cfset provider_name_array = ArrayNew(1)> <h1>Hello</h1> <cfquery name="qryGetPOP" datasource="webalc"> select distinct center_code from alc_pop<!--- where rownum<=10 ---> <

How to create a cfspreadsheet with protected cells

旧城冷巷雨未停 提交于 2019-12-31 00:56:11
问题 I am creating a spreadsheet object using cfspreadsheet. Would like to make some of the individual cells as protected (read-only). Please let me know if anybody has tried this before. I did try putting cell format as locked but it did not seems to work. Here is the sample code: <cfset a = spreadsheetnew()> <cfset format1 = structNew()> <cfset format1.locked=true> <cfset SpreadsheetFormatCell(a,format1,1,1)> <cfspreadsheet action="write" filename="#expandpath('.')#/test.xls" name="a" overwrite=

SpreadsheetFormatRow abruptly stops working

筅森魡賤 提交于 2019-12-20 02:15:16
问题 I've seen this post, but there does look to be a resolution. Anyway, I'm using ColdFusion 10 to generate an Excel spreadsheet. However, when I use SpreadsheetFormatRow() and pass in the rows to be formatted, it only does about 3 and then abruptly stops. Here is an example... ColdFusion Code <cfscript> rowCount = 1; headingRows = 4; // Create instance of new Spreadsheet excelSheet = SpreadsheetNew("ReportName",false); // HEADING (IMAGE) ROW FORMAT formatHeadingRow = StructNew();

Data row limits on cfspreadsheet

这一生的挚爱 提交于 2019-12-18 09:03:45
问题 I am loading about 20,000 rows into a <cfspreadsheet> . It throws an error: When I limit the number of rows to 15,000, I don't get an error. Is there a hard limit on the number of rows <cfspreadsheet> supports? 回答1: This sounds similiar to the issue I had here: How do I fix SpreadSheetAddRows function crashing when adding a large query?. If you have CF10 then you might be in luck 'cause that should be fixed now (as of Update 10 at least). 来源: https://stackoverflow.com/questions/19214735/data

comma in array element breaks spreadsheet

两盒软妹~` 提交于 2019-12-14 02:16:41
问题 When adding data to an array, one of the elements has commas in its value. An example of the value is "Trim marks at 103, 96, and 90". Using the following code to add the array elements to the spreadsheet object, the partdescription element, as described above, has its data span multiple columns in the spreadsheet. It is handled as separate elements and not one. <!---Create file name variable---> <cfset filenametouse = 'PartLevel_Report' /> <!---Set directory and full file path---> <cfset

Coldfusion: cfspreadsheet reading date incorrectly

徘徊边缘 提交于 2019-12-13 02:56:27
问题 Im using cfspreadsheet to read data from spreadsheets inside one of my applications. I've had a great deal of difficulty dealing with date columns. If I format the cell as date english (NZ) it displays right in the spreadsheet, but when I try to upload it switched the day and month. But If I change the format to a custom "dd/mm/yyyy" format it will upload without a problem. Why would using the default date formats within the spreadsheet mess up the format when a custom one doesn't? Is there a

CFspreadsheet adding a % to format a column

社会主义新天地 提交于 2019-12-13 02:48:02
问题 I am using CF10 and trying to add a % sign to a spreadsheet. I am having an issue with adding a % sign on my 5th column entries. (Only the entries starting the second row (not the header) and not the blank cells when the query is done running. <cftry> <cfset objSpreadsheet = SpreadsheetNew()> <cfset assocRows = ''> <!--- Create and format the header row. ---> <cfset SpreadsheetAddRow( objSpreadsheet, "Associate Name,Location,Checklists Generated by Associate,Checklists Generated by Selected

cfspreadsheet fails to read empty rows

拥有回忆 提交于 2019-12-12 22:06:34
问题 Given a spreadsheet with N logical rows Where one row is totally blank* cfspreadsheet action="read" will return a query with a RecordCount of N - 1. *A totally blank row is a row where every cell is actually blank. See CELL_TYPE_BLANK in the POI docs. Is it possible for cfspreadsheet to include empty rows? 回答1: No. Since spreadsheet data is not always contiguous, <cfspreadsheet action="read" query="queryName" ...> and <cfspreadsheet action="read" format="csv|html" ..> deliberately screen out

SpreadsheetFormatRows format color ColdFusion

╄→гoц情女王★ 提交于 2019-12-12 20:15:42
问题 I'm creating Excel files using ColdFusion and the SpreadsheetNew, SpreadsheetAddRows, SpreadsheetFormatRows, etc. functions. According to the docs that I have read located here their is a propery for color, and fgcolor. I'm a bit confused as to what the difference between the two are. Is one the text color and the other the background color? I've been using fgcolor to set the background color of rows. // HEADER ROW FORMAT formatHeaderRow = StructNew(); formatHeaderRow.fgcolor="royal_blue"; My