What I've done for this kind of thing is just stuck a cfheader with filetype for excel, right on the HTML page. It streams to the browser and opens in excel.
Some issues with this approach: security settings on the client can muck it up. Using a cfsavecontent could get you around that, perhaps write the content to a file, push the user to a page with a link to the newly created file? That would get around some of the security issues inherent with streaming the content immediately. Cheers, Kris On 7/4/07, Will Tomlinson <[EMAIL PROTECTED]> wrote: > I have a fairly complex query that generates a fairly complex report in the > browser.. just html tables with some data, some nested tables with its own > data, etc. No problem with that part. > > The part I'm havin trouble tryin to figure out is how to generate some > downloadable reports out of it. It's like, what should the routine be for > this? > > In my head I've come up with using <cfsavecontent> to save a sort of, > snapshot of the page in a SESSION variable. The user clicks the "export to > html" link, and I'll build an html page they can dload via <cfcontent>. So as > far as that's concerned, would that work ok? > > I also need to export this data to excel. Now, I've been usin ben nadel's > sweet POI utility to generate some other excel files, works like a champ. But > I'm havin a hard time even figuring out the routine to do this, before it > even gets to that point. > > 1. User lands on the page. > 2. Makes some filter selections. > 3. report is generated on their .cfm page. > 4. User clicks "export to excel" link. > 5. What now? Do I re-run the query all over again? > Is there a way that query can be saved so I can use it again when he clicks > the link? > > Thanks, > Will > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:282921 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

