|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
query2excel
Hi, i downloaded a cfx called query2excel and just wondering if either anyone else has used it and has come up with the same error, or whether i am doing something fundamentally wrong in coldfusion to get the following error:Richard White 04/15/08 09:41 A Sorry, I can't help you with this particular bug, but if you cannotAlan Rother 04/15/08 11:42 A Does it work without the hashes (they are unnecessary)? i.e.Dominic Watson 04/15/08 11:48 A hi dominicRichard White 04/15/08 11:58 A Shouldn't that be maxRows="#finalQuery.recordcount# + 1"Dave Francis 04/15/08 12:10 P tanks dave tried that but also unsuccessful, i think i will have to use the other component suggested here as this must be a bug in the cfxRichard White 04/15/08 12:56 P One last thing, then I'll shut up - have you tried taking the calculationDave Francis 04/15/08 01:25 P hi dave, thanks yes i have tried this as well :( still no joyRichard White 04/15/08 04:03 P thanks i will look into this as i do need more flexibilityRichard White 04/15/08 11:57 A If you copied that exactly...you have the +1 inside the pound signs...Eric Roberts 04/15/08 12:19 P GOT IT!!!Richard White 04/15/08 04:13 P It looks like my postings aren't making it to the list again...your problemEric Roberts 04/15/08 08:04 P hi eric, i tried that as well but didnt work, same error was coming upRichard White 04/15/08 08:09 P thanks eric, when i tried this is said '+' cannot be recognised - i even tried putting it as you say but inside quotes, and also tried a val function wrapped around. just seemed that no combination worked with itRichard White 04/15/08 08:12 P Have you tried putting the calculation in brackets first so that itDaniel Kessler 04/15/08 02:19 P Hi Daniel, just tried this to no success :( thanks thoughRichard White 04/15/08 04:07 P You have the "#" signs around the entire statement. That will produce anEric Roberts 04/15/08 08:01 P FWIW -- you can do some calculations within pound signs -- something likeJosh Nathanson 04/15/08 08:18 P Hi, i downloaded a cfx called query2excel and just wondering if either anyone else has used it and has come up with the same error, or whether i am doing something fundamentally wrong in coldfusion to get the following error: the code i am using is as follows: <cfx_query2excel query="finalQuery" templateFile="#expandPath('.')#\template_query_results.xls" outputFile="#expandPath('.')#\Excel_Downloads\#filePath#" startRow=1 maxRows=#finalQuery.recordcount+1# columnHeaderRow=1 appendOverwrites="true"> the error is on the maxrows attribute, it tells me that it must be numeric (maxRows=#finalQuery.recordcount+1#) however if i take out the +1 then it accepts it fine. i have even tried to setting variable to the recordcount + 1 then using that variable. it essentially works fine until i try to add 1 to it, no matter what way i try to add the 1. am i missing something simple or is there a bug with this cfx? thanks very much Sorry, I can't help you with this particular bug, but if you cannot find a solution let me suggest using Ben Nadels POI CFC. it's an amazing interface into creating Excel files from darn near any CF object. http://www.bennadel.com/projects/poi-utility.htm http://www.bennadel.com/blog/469-Creating-Microsoft-Excel-Files-Using-ColdFusion-And-POI.htm It works amazingly well. =] -- Alan Rother Adobe Certified Advanced ColdFusion MX 7 Developer Manager, Phoenix Cold Fusion User Group, AZCFUG.org Does it work without the hashes (they are unnecessary)? i.e. maxRows=finalQuery.recordcount+1 OR maxRows="#finalQuery.recordcount+1#" Dominic -- Blog it up: http://fusion.dominicwatson.co.uk hi dominic its really strange as maxRows=#finalQuery.recordcount# works but maxRows=#finalQuery.recordcount+1# doesnt work i have also tried it both ways as you suggested below but it keeps saying maxrows must be numeric thanks ----- Excess quoted text cut - see Original Post for more ----- Shouldn't that be maxRows="#finalQuery.recordcount# + 1" Does it work without the hashes (they are unnecessary)? i.e. maxRows=finalQuery.recordcount+1 OR maxRows="#finalQuery.recordcount+1#" Dominic -- Blog it up: http://fusion.dominicwatson.co.uk tanks dave tried that but also unsuccessful, i think i will have to use the other component suggested here as this must be a bug in the cfx thanks ----- Excess quoted text cut - see Original Post for more ----- One last thing, then I'll shut up - have you tried taking the calculation outside? ie <cfset x = finalQuery.recordcount + 1> ... maxRows=x, (or maxRows="#x#") tanks dave tried that but also unsuccessful, i think i will have to use the other component suggested here as this must be a bug in the cfx thanks ----- Excess quoted text cut - see Original Post for more ----- hi dave, thanks yes i have tried this as well :( still no joy thanks i will look into this as i do need more flexibility thanks If you copied that exactly...you have the +1 inside the pound signs... /*-----Original Message----- /* /*Sent: Tuesday, April 15, 2008 8:42 AM /*To: CF-Talk /*Subject: query2excel /* /*Hi, i downloaded a cfx called query2excel and just wondering if either /*anyone else has used it and has come up with the same error, or whether i /*am doing something fundamentally wrong in coldfusion to get the following /*error: /* /*the code i am using is as follows: /* /*<cfx_query2excel /* query="finalQuery" /* templateFile="#expandPath('.')#\template_query_results.xls" /* outputFile="#expandPath('.')#\Excel_Downloads\#filePath#" /* startRow=1 /* maxRows=#finalQuery.recordcount+1# /* columnHeaderRow=1 /* appendOverwrites="true"> /* /*the error is on the maxrows attribute, it tells me that it must be numeric /*(maxRows=#finalQuery.recordcount+1#) however if i take out the +1 then it /*accepts it fine. /* /*i have even tried to setting variable to the recordcount + 1 then using /*that variable. it essentially works fine until i try to add 1 to it, no /*matter what way i try to add the 1. /* /*am i missing something simple or is there a bug with this cfx? /* /*thanks very much /* /* /* /* GOT IT!!! i managed to fool it seeing as the + 1 wasn't working i added an empty row into the query <cfset queryaddrow(finalQuery)> and it then had the same affect as finalQuery.recordcount+1 and it went through fine :) thanks for all your help and suggestions, this must be a bug in this component and i will def look at the other component suggested on here for enhanced flexibility thanks again It looks like my postings aren't making it to the list again...your problem was that you had the +1 inside the # signs ie #query.recordcount+1# when it should be #query.recordcount#+1 The first is looking for a variable named "query.recordcount+1" that doesn't exist. Eric /*-----Original Message----- /* /*Sent: Tuesday, April 15, 2008 3:14 PM /*To: CF-Talk /*Subject: Re: query2excel /* /*GOT IT!!! /* /*i managed to fool it seeing as the + 1 wasn't working /* /*i added an empty row into the query <cfset queryaddrow(finalQuery)> /* /*and it then had the same affect as finalQuery.recordcount+1 and it went /*through fine :) /* /*thanks for all your help and suggestions, this must be a bug in this /*component and i will def look at the other component suggested on here for /*enhanced flexibility /* /*thanks again /* /* hi eric, i tried that as well but didnt work, same error was coming up ----- Excess quoted text cut - see Original Post for more ----- thanks eric, when i tried this is said '+' cannot be recognised - i even tried putting it as you say but inside quotes, and also tried a val function wrapped around. just seemed that no combination worked with it ----- Excess quoted text cut - see Original Post for more ----- Have you tried putting the calculation in brackets first so that it calculates and then inserts the sum? maxRows=#(finalQuery.recordcount+1)# -- Daniel Kessler University of Maryland College Park School of Public Health 3302E HHP Building College Park, MD 20742-2611 Phone: 301-405-2545 http://sph.umd.edu Hi Daniel, just tried this to no success :( thanks though ----- Excess quoted text cut - see Original Post for more ----- You have the "#" signs around the entire statement. That will produce an error as "(finalQuery.recordcount+1" does not exist as a variable. Type maxRows=#finalQuery.recordcount#+1 Eric /*-----Original Message----- /* /*Sent: Tuesday, April 15, 2008 3:08 PM /*To: CF-Talk /*Subject: Re: query2excel /* /*Hi Daniel, just tried this to no success :( thanks though /* /* /* /*>Have you tried putting the calculation in brackets first so that it /*>calculates and then inserts the sum? /*> /*>maxRows=#(finalQuery.recordcount+1)# /*> /*> /*>-- /*> /*>Daniel Kessler /*> /*>University of Maryland College Park /*>School of Public Health /*>3302E HHP Building /*>College Park, MD 20742-2611 /*>Phone: 301-405-2545 /*>http://sph.umd.edu /* /* FWIW -- you can do some calculations within pound signs -- something like #myquery.recordcount+1# should work I think, as long as myquery exists as a query. If the query doesn't exist it will error of course. So, it's possible that the OP's actual problem was that the query wasn't defined. <cfset myvar = 2> <cfoutput>#myvar + 1#</cfoutput> This will output 3. -- Josh ----- Excess quoted text cut - see Original Post for more -----
|
May 18, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||