ColdFusion 10 Charting - Funnel Chart and Playing with the Legend

A blog reader asked on the chart post yesterday about Funnel charts in ColdFusion 10. So, I whipped up a quick demo of the same.

View Demo (Refresh screen if demo doesn't load the first time)

You will see that there are two charts. The default render doesn't show the legend at a good place, and fortunately with ZingChart + CF10 functionality we are able to position it much better by specifying the legend attribute for cfchart.

Let's look at the code.


ColdFusion 10 Charting - The new stuff

ColdFusion 10 includes a good number of charting enhancements including Client Side Charting using the ZingChart library. This is great news as we can look at ZingChart documentation to look at some of the new things you can do with Charts in ColdFusion 10.

I started playing around with this and did a quick demo of pie and bar charts with some of the new options.
View Demo (Free CF10 beta hosting from Hostek!. If it doesn't load, refresh page).

Code is pretty simple, just had to look through ZingChart documentation to exact structure builds. Code Follows...


ColdFusion 10 Beta and Windows 7 Install

Due to work keeping my quite busy along with a drop in how much coding I actually do while working means I have not been following CF 10 and CF community that closely. But I was pretty excited to find last week that the ColdFusion 10 (Zeus) beta has been out for a few weeks now. Time to code a bit more then!

The first thing to do was install it on my new SSD (get one, its good stuff) with Windows 7. IIS was already setup for ColdFusion 9, so I just went ahead with the install. Everything seemed to be going well (lots of password warnings), but the administrator wouldn't open at the last step. Now, I hit a lot of issues installing CF9 on Windows 7 64-bit and I was hoping this was not a repetition of those issues. Thankfully it wasn't. The main change I had to made was to install the .NET Extensibility, ASP.NET and CGI features for World Wide Web Services under IIS. After that, I re-install CF 10 and everything was good to go.

Logged into CF Admin, and this is nice, very nice. What I am talking about is actually the new update installer that Adobe has included now. For anybody working with ColdFusion in production environments, 1-click install removes a big headache. Apart from that, the new Clear Query Cache option will be one of my favorite enhancements. Same thing with ability to clear cache for specific paths. This means when doing a Production hot fix, I don't need to reset cache for the whole application.

Anyway, if you have not yet download CF 10 beta, get it now:
ColdFusion 10 - Adobe Labs

Delete Duplicates using CTE in SQL Server

This is a blog post for future reference and this has proved useful to me over the past year ever (ever since I found it online). And it's time to transfer the method from email to blog.

CTE is to me (from what little I know of advanced SQL concepts) a pretty powerful feature. It stands for Common Table Expression and is basically a temporary result set (table) of data that you can use within the same query execution.

I do this via a two step process, first query verifies that the CTE is generated properly, second one uses the CTE to delete the Duplicates.

Quite frankly, I still have no idea how exactly this works, I just know it has worked for me in the past. If any SQL Guru who comes upon this post wants to explain how this exactly works in the comments section it would be very appreciated.

view plain print about
1/* Build CTE and select records to verify everything looks good */
9WHERE rnk >
11/* After verification, build CTE again and now Delete the duplicates */
19WHERE rnk > 1

The first query builds the CTE and we first verify that the built CTE is good, expected duplicates show up. The second query then deletes the duplicates.

In both queries, you have to replace the "ID" and "name" parts of the query based on your table. And you might now always know what exactly to use here, well then experiment. I usually start with using the duplicate column in the "name" part.

This has been of use particularly in cases where the tables have duplicate data but there is no PK (or a good PK) available to drive the deletion. And maybe there is an easier way too now.

Browser Detection using jQuery

After finally getting this blog back up online, the next step was to upgrade to the latest blogCFC version (which ships with the awesome theme you see). After being done with that, I noticed this is the first time I had used the blog with Chrome, and the one thing that didn't work in Chrome is display of the RSS feed. And no better way to remind myself how to accomplish this again in the future than blogging it!

The RSS in IE/Firefox is styled (I believe because of the in built RSS reader?):

The RSS in Chrome is not styled:

One good solution to this would be to just use the Feedburner link for the RSS feed ( and it displays good in all browsers. But I saw it as a good opportunity to use jQuery to redirect the click based on the browser. So, now if you click the RSS link on the navigation, it will show the default blogCFC RSS in IE/Firefox but for Chrome it will go to the feedburner link.

Now the main issue I encountered (and the solution is documented at various places on the internet) is that the built in jQuery browser detection doesn't differentiate between chrome and safari. You can see this at work here (try it with different browsers)

On Chrome, the default output will detect safari. So some changes had to be made to that.

Really simple to do using jQuery too. Let's look at the code.


cffileupload Tag - Uploading Multiple Files

Back in beta, I had made a post on this new tag in ColdFusion 9. It creates a Flash interface allowing the user to upload multiple files to the server. A pretty easy way to achieve something powerful. Back in beta, there was also a bug with the funtionality. It was that ColdFusion was not automatically passing back Success, Failure messages. With the release now, that has been taken care of, so we can revise the beta code.

Demo currently unavailable

Lets take a look at how simple the code is


cffileupload Tag - Event Handlers

Continuing with exploring the new multi-file upload tag functionality in ColdFusion 9, this post will build on the previous post and add event handlers. We are able to work with 3 event handlers:

  1. onComplete - Called after each file finishes uploading
  2. onError - Called when a file upload errors out
  3. onUploadComplete - Called when all the files finish uploading
Demo currently unavailable.

Lets take a look at the code.


Installing ColdFusion 9 64-but on Windows 7 64-bit Experience

This weekend I got me a new laptop from Dell (Studio 15). I got it with 4 GB RAM (to me it has become a minumum now) which naturally meant going with a 64-bit OS. So, I now had this nice new laptop with Windows 7 x64 and once I was done cleaning out the bloatware, it was time to install ColdFusion. It turned out to be quite an experience and took much longer then I anticipated. But first, lets get one thing straight here, Adobe doesn't really provide any documentation on what you need to do to install CF properly on IIS 7.5. There is no, "verify these windows component are installed" document or screen. In any case, I had installed ColdFusion 9 on Windows 32-bit succesfully, and needless to say I felt (over)confident that I could do the same for Windows 7 64-bit.

I started out by configuring Windows have the IIS6 modules installed, I knew I had to do that. Then I ran the ColdFusion 9 install, no errors, got to the end, "Press OK to start CF Admin", did that. The CF Admin screen came up and did not work. IIS 7 told me about missing extension configuration. I realized at that point something was missed in my IIS reconfiguration, and it turned out it was the ISAPI Extensions under World Wide Web Services options, so I turned all those things on, Windows reconfigured IIS for me. I opened IIS, saw tha the ISAPI extensions and filters were not installed. Ready to go right? Wrong.

Still could not get to CF Admin. Ok, lets uninstall and install CF9 I thought, since now IIS has everything it needs for proper configuration. So I did that, uninstall then install and once again pressed "OK" at the end. Out comes the CF Admin page, "Click here" to continue configuration. Yay, victory was my first though. But then I noticed, something was not right. There was no Adobe logo, no images were showing up. Doesn't matter, I was able to open a .cfm page, so I continued with the configuration and then was logged into the Admin. Still no images. By the way, the Admin looks really bad if you can't see images. So, I closed the browser and opened a new IE window and went to //localhost/cfide/administraor/ and IIS 7 gives me an Error!! But thats where the CF Admin is located, but apparently IIS can't handle the request properly.

Sigh, I did some googling. Verified that the ISAPI handlers for .cfm extensions were pointing to the right DLL. Someone suggested uninstalling CF, deleting all CF directories and installing again. So I dd that, but same error again. Still can't see images in CF Admin. Frustrating, already installed CF9 3 times. Verified IIS setup again, all looks good there. I uninstall CF9 again, restart computer, delete directories, install CF9 again and same issue again. At that point, google had helped me as much as it can. I try to use the server configuration tool but I can't remove the current flawed IIS configuration from it (some error about not able to remove things).

Decide it time to start from scratch. So, I uninstall CF9, delete CF directories, restart computer. Uninstall IIS7 from windows, restart computer. Then reinstall IIS7 and restart computer. Then reinstall CF9 and Victory!! Everything works properly. Apparently, installing the ISAP Extensions after installing CF9 screwed up the installs and configurations in IIS. So, well, it worked now. Logged into CF Admin, //localhost/cfide/administrator/ resolved properly.

But that was not the End of the Story.

Apparently, setting up a MS Access Datasource on Windows 64-bit is another issue faced by various users. You would get an error about DRIVERPATH not defined. Well I thought, if CF can't set it up, I will set it up in Windows and use ODBC socket. But the issue is that the 64-bit Windows don't come with the relevant drivers needed to setup Access Datasource in Windows. After trying to figure out how to resolve this, googling and finding some information here and there, not much help was found. In the end it was realized, that the Windows\System32\odbcad32.exe file contained the proper drivers but the Windows\SysWOW64\odbcad32.exe did not contain the drivers. So the solution was to copy over the .exe from System32 to SysWOW64. I went through with that and it worked!! Even though, ColdFusion still gave a DRIVERPATH undefned error, the datasource was verified properly and I could run all my MS Access based demos.

Whew, finally, was done with setting up Coldfusion 9 64-bit on Windows 7 64-bit.

ExtJS 3.0 Editor Grid with ColdFusion + Ext Toolbar Play

I hadn't looked at the Ext JS library in a while, but this weekend, I took a look at it with the idea of eventually building out a full CRUD grid using Ext JS and ColdFusion. It took some time, particularly trying to figure out the phantom records implementation, but its done now.

View the Demo

And as always, time to look at the code.


Using jQuery based jqGrid with ColdFusion Revisited: Full CRUD grid with Advanced Searching

It has been a while since I made my last blog post as work has kept me very busy. Over the weekend I saw that a new jqGrid version had been released and that it contained in-built advanced searching (called multiple search). I also thought it was a good time to revisit my earlier blog post on a full CRUD grid and update it to 3.6 specifications.

This implementation uses the following jqGrid features:

  1. Inbuilt Form based Add, Edit, Delete and Search functionality
  2. Search is done using new Multiple Search feature
  3. Exploration of a few additional colModel parameters

View the Demo : this is all realtime, any updates made will be reflected in the grid.
Now, lets look at the code


More Entries

/* ChartBeat Testing */