I’ve been working on something at work which is interesting, odd and stupid at the same time. It’s a business plan for one of the web site’s that I am working on. Each year this group puts out a business plan, which is a good idea in itself, but they crazy part is they want it displayed on the web site in Excel or spreadsheet format.
Now I’m not just talking about tabular data out of table. That would be too easy. I could just dump it out using CFGrid. What makes it difficult is the fact that they may have an entry in one cell in the first column that spans multiple cells in the next column. Which makes it difficult. Now I could be off my rocker and I might be making this harder than usual which I usually do. I don’t have a lot of experience using CFGrid and from what I’ve read you can’t do something like that using that tag.
My brain might also be a little less frazzled if I was starting this from scratch. I inherited this site from some other group. They’ve written a custom business_plan.cfm page that is included based on results from a query in a page called summary.cfm. The summary page is like 250 lines at the most and most of that is standard layout and some includes. The business_plan page is over 450 lines and its a mess.
There is one main query that is, if memory serves, a five way inner join. From this they have a series of conditionals using cfif of course that determine which queries run to get the rest of the data. See another thing that makes this a little more challenging is that all the business plan data is spread over 8 tables in SQL Server.
Now further down in the script there are other queries that reference the main query to get the data from. So they have something like:
Let me recap. I’ve got one main query, two sub queries which get author and goal information, several smaller queries which pull data from the main query. Many and I do mean many conditionals that check recordcounts here and there to determine rowcount and colspan size which create the proper layout of the business plan to display it in spreadsheet form on the web. All of this does work and it’s bargain at only 450 lines.
Here’s the kicker. When I run it the page is over 2500 lines long. And it is slow. We are also now mandated to use the latest CSS company templates at work for new websites or upgraded websites. This basic HTML tabular spreadsheet tool completely overwrites my footer at the bottom of the page which is written in CSS.
So yeah, you could say I’ve got a little problem. I thought first to go to the customer and ask them if they need it in spreadhseet format and of course that’s what they are use to and they like it so that’s what we are using. So now I’m thinking of rewriting it, because I’ve been banging my head against the wall and I haven’t been able to make much progress in the way of cleaning it up.
More on this post to follow. I’ll write back when I’ve cleaned it up and fixed the problem.
RSS feed for comments on this post · TrackBack URI
Leave a reply
You must be logged in to post a comment.