March 11, 2010

Pages


Search Site


Subscribe

...to receive future posts via email.

Topics



Archives

Entries Tagged as 'ColdFusion'

CFSpreadsheet Bug. Or is it? You decide…

February 18 2010 by Adam

During the CF9 Beta process I was among several people who submitted bugs about the headerRow attribute of the new CFSpreadsheet tag, and how it might not be working as well as it could:

When specifying the headerrow attribute in [CFSpreadsheet], the column names are retrieved from the header row, but they are also included in the first row of the query. The expected behavior is that they should not be included in the query at all, only as the column names. [#72740]

I was contacted by an Adobe engineer about my bug report, and after some back and forth essentially I was told that this isn't a bug. Before we get any further, let me make sure I've explained this perfectly clearly. Let's start with a spreadsheet with some data in it, and column headings:

sample data

Now, let's read the contents of that spreadsheet into a query, setting the column names based on that first row of data:

<cfspreadsheet
    action="read"
    headerRow="1"
    query="result"
    src="#expandpath('./test.xls')#"
/>
<cfdump var="#result#" />

And here's what gets dumped:

dump of data query

It might be a little subtle, so if you didn't immediately notice, let me point it out: The column headers remain in the data. I would expect that the use of the headerRow attribute would "eat" the headers from the data. I can't think of a logical reason they should remain in…

I verified that this behavior is the same for both Excel 97 (xls) and OOXML (xlsx) file formats.

Do you agree that the header rows should be "eaten"? Disagree? I'd like to know.

Despite the public bug tracker, Adobe is strangely quiet on this issue. I've had some correspondence with one of the engineers, who told me it wasn't a bug (my own bug was closed and marked as a duplicate, but #72740 remains open, marked as not a duplicate, verified (usually meaning reproduced), and somehow, not reproduced…).

In my correspondence with Adobe, I was told that to get the desired behavior I should do the following:

<cfspreadsheet
    action="read"
    headerRow="1"
    query="result"
    src="#expandpath('./test.xls')#"
    rows="2-65536"
/>

The only difference between this and my original code is the addition of the rows attribute; so it's not that much extra work. What it's doing is specifying to skip the header row and return all rows of data up to the theoretical maximum (the number is the Excel 2003 row limit, (2^16) and Adobe confirmed that this is the limit for ColdFusion as well).

This specifies that I want to skip the header row, does in fact get me the results I want, and in general isn't terribly difficult. On the other hand, I've basically been asked to commit the number 65536 to memory, or to put it on a post-it on the side of my monitor, so that I can refer back to it later. So for that reason, I don't consider it an acceptable work-around.

To me, an acceptable work-around might be implementing one of these syntaxes: rows="2+" or rows="2-" or rows="2..". For what it's worth, the documentation for the rows attribute currently reads:

The range of rows to read. Specify a single number, a hypen-separated row range, a comma-separated list, or any combination of these; for example: 1,3-6,9.

Still, a work-around would be a black eye in this case, in my humble opinion. What reason is there to leave the header values in the data set? Can anyone out there give a practical example for wanting them to stay? Until I see one, I will continue to believe that they should be removed; and while I would begrudgingly accept a work-around, I'd really much rather see the issue addressed because I want to see ColdFusion become the best platform & language it can be.

If you agree with me, I would encourage you to leave a comment on the open bug indicating so, and vote for it. If enough people agree with me, perhaps Adobe will answer the call.

Posted in ColdFusion | 6 comments

LogViewer 1.1

February 04 2010 by Adam

Mango 1.4.3 has been released, and is available via automatic update. As far as I know, the only difference between 1.4.2 and 1.4.3 is a fix for a bug I reported with the new logging functionality.

Version 1.4.2 of Mango introduced logging to the database and gets rid of the old web-accessible log files. Users of LogViewer will need to update the plugin in order to manage their logs.

This update to LogViewer reflects some changes to the way logging works. In particular, there are now several different types of errors, not just two. For now, all errors are displayed together — but I may change that later to let you specify just one type to display. I may also add pagination, if there is a demand for it.

Plugin:
LogViewer
Version:
1.1
Requires:
Mango Blog 1.4.3+
Auto-install URL:
http://fusiongrokker.com/get/LogViewer

Users still on an older version of Mango (pre 1.4.2) can still download LogViewer 1.0.

LogViewer source is now hosted on GitHub.

Posted in ColdFusion | My projects | Mango | 7 comments

The Best of ColdFusion 9: CFaaS

January 20 2010 by Adam

I had some information ready to be posted here when I submitted my entry into Ray's Best of CF9 contest, but he covers it pretty well in his review post; and he was kind enough to host the video on his S3 account. I've also posted the video on my Vimeo account, so here it is again for reference:

You can download the source code here. Unfortunately, I haven't found any more time to continue working on this; and I have to admit that as cool as the CFaaS feature is, I'm not terribly motivated to go further with this mail client because I know it will eventually get canned. Why write a mail client when you use Outlook every day?

So it was a fun way to play with Flex 4, the latest Swiz build at the time, AIR, and CFaaS; but I don't think I'll bother continuing to mess with it.

Posted in ColdFusion | Frameworks | Flex | AIR | Swiz | 0 comments

Adobe Community Professional

January 19 2010 by Adam

Woot, more resumé fodder! [Note to my employer: Not that I'm looking! ;)]

Today I found out that I'm among those selected to join the Adobe Community Professionals program (formerly Community Experts, aka A.C.E. — but there was a conflict with Adobe Certified Experts, thus the change).

I took over as manager of Philly CFUG last October, and through that I've been working on my stage-freight and hopefully helping the Philly CF community start to re-awaken. I'm working on my own presentations, submitting topics for conferences and CFUG meetings, and still working as a copy editor for FAQU, which I personally hope finds a way to get back into print as the economy stabilizes.

2010 is going to be a great year. I'm just glad I get to go along for the ride.

Posted in Adobe | ColdFusion | Philadelphia | 2 comments

Scope Priority Changes in ColdFusion 9

December 07 2009 by Adam

According to the documentation regarding the order in which unscoped variables are evaluated for ColdFusion 8 vs. the documentation for ColdFusion 9, there have been some not insignificant changes in scope priority. Are these typos in the documentation, or have things really been changed?

Read more...

Posted in ColdFusion | 5 comments