I often pull in a full data set then use query of a query to pull subsets of data from it. The purpose is to minimize the number of hits to the database server (which is usually the cheif bottleneck of any application). This works pretty well, but today I stumbled on a tip that can really save some effort and reduce the sheer number of lines of code. It has to do with using aggregate functions to derive other values from the data. For example, if I have a large query that is being output in a row and I want totals at the bottom I usually run a query like this:
Read More
We are all aware that the report builder application is a template generation tool. It's quite useful with a number of nifty features. One of the cool things about it is that you can define a report template using dummy data that can be replaced at run time. This allows you to run and test the display attributes and charts of your report using something simple like CFQUERYNEW( ) which you then replace with the actual query by passing it into the CFREPORT tag.
What I was hoping for however, was a template that produced a file format that we could unpack and examine. Our goal would not be to become report writers for our clients (isn't that really a content editors job?). Our goal is to produce tools where they can mine and access the data themselves. I would love to be able to allow a web based user to generate their own reports from a wizard. Indeed we have a system very much like this for Ms SQL that makes use of the various stored procs for data type introspection and allows a user to build 1 or more queries to use in a report.
The biggest flaw in our system is the rather limited template system we have. I was hoping to be able to replace "front-end" template with an auto-generated CFR file. However, Macromedia in a disappointing move, has chosen to encrypt the CFR files. effectively making them useless except as a limited time-saver for developers faced with handling report content. I suppose a DBA or Access programmer could pretty easily get up to speed on the report builder. But as far as I can see there is no way to make use of this file format programmatically.
Silly me, I assumeed you couldn't insert images into a flash CFGRID. I stumbed across this example on an excellent blog by As Fusion (laura Arguello and Nahuel Foronda). Apparently you can insert thumbnails right into the grid using an HTML element. That's a new one on me. The trick is to bind a column in the grid to a CfFormItem. As always, someone will always find a way.
It's trying not to have adequate access to the client side movie produced by a flash form. For example, I Have a large number of panels in an accordian pane and I want to hide or unhide them based on user preferences. I also want to resize the form movie as the panels are "hidden" to make better use of the visible area of the screen. I wanted to be able to change the "height" and "width" parameters of the movie.
The problem is, that while the "NOSCRIPT" block has an ID parameter to it, the "document.write" block that outputs the object tag does not have and ID parameter attached to it (in spite of my putting ID="blah" in the CFFORM tag). That seems like a bug. Anyway, I went about trying to find another way to access the properties of the embeded movie. I came up with the following:
Read More
While I'm enjoying the power and especially the "look and feel" of the new flash forms interface I'm are a little frustrated with the lack of good debugging information. It would be nice if additional information could be ported into the Coldfusion debugging info at the bottom - or a perhaps a log file could be written. It's very hard to know what's going on. When a flash form is long it takes a while to compile anyway. Because I don't know how long it should take I end up sitting on my hands waiting for the little "initializing" to appear. If it doesn't I assume something has gone wrong internally and start looking at the code. That's not exactly slam dunk debugging.
Locking among CF developers arouses the same sort of Ire as the Linux Vs. MS debate. There are CF developers who believe that locking is unnecessary in most cases and locking everything is an unnecessary waste of time and effort. There are others who believe that everything should be locked without regard to any examination of the data or its significance. Both camps have salient points and I do not fault either of them for their viewpoint. In our case we err on the side of caution. We lock every write for the session and application scope and we lock "most" reads of the session scope. That's our standard and I only mention it to get it out of the way. I do not intend write an apology on wether you should lock or not. Instead, I think we should examine how locking syntax varies and how it used appropriately (or inappropriately).
Read More
Did you ever get frustrated with the <cfinclude> tag? If you started out in HTML you probably have. Why is it that you can put an image in a directory and put a cfm file in the same directory, but not have them work the same? You can call <img src="images/blah.jpg"> and it seems to work just fine, but when you try to do <cfinclude template="images/blah.cfm"> it doesn't work? Aren't the 2 items in the same path? Nope, and here's why.
Read More