House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

query2excel

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
hi dominic
Richard White
04/15/08 11:58 A
GOT IT!!!
Richard White
04/15/08 04:13 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 09:41 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alan Rother
04/15/2008 11:42 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
04/15/2008 11:48 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 11:58 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Francis
04/15/2008 12:10 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 12:56 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Francis
04/15/2008 01:25 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 04:03 PM

hi dave, thanks yes i have tried this as well :( still no joy

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 11:57 AM

thanks i will look into this as i do need more flexibility thanks

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Eric Roberts
04/15/2008 12:19 PM

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 /* /* /* /*

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 04:13 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Eric Roberts
04/15/2008 08:04 PM

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 /* /*

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 08:09 PM

hi eric, i tried that as well but didnt work, same error was coming up ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 08:12 PM

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

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Daniel Kessler
04/15/2008 02:19 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Richard White
04/15/2008 04:07 PM

Hi Daniel, just tried this to no success :( thanks though ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Eric Roberts
04/15/2008 08:01 PM

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 /* /*

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Josh Nathanson
04/15/2008 08:18 PM

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


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

April 25, 2014

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30       

Designer, Developer and mobile workflow conference