This content has been marked as final. Show 6 replies
Not sure what a fix to your current issue might be, but could you get away with creating 1 Excel file with multiple worksheets instead of multiple Excel file with 1 Worksheet each? If so, that might fix your multiple download issue. You can create multiple worksheet Excel files using the Jakarta POI Java package (which you probably already have on your server if you are using CFMX 7). I think I've seen some Custom Tag wrappers for POI that make it even easier to use.
Otherwise, your zip solution might be your best bet. Browsers can be rather finicky about both frames and file downloads and when you mix multiple instances of both together you never know what might happen.
Thanks for the response. We do have the POI package and I have a little bit of familiarity with it. Multiple worksheets would be an ideal solution as that was the original request - the customer will actually be combining the multiple files into separate worksheets in a single file. But that will involve quite a bit of time for me to get up to speed on the ins and outs of the package and figuring out how things like formatting.
For now I "solved" the problem by delaying the submission of each form by 10 seconds, obviously not an ideal solution but it may suffice until I come up with something better.
I'm actually trying to generate multiple excel files at once, looping though a query and creating the files.
However, when I launch the code, it is generating only the last file and not one by one.
I unfortunately cannot use POI in this case because of heavy formatting of the excel files (tables, colspans, rowspans, colors, etc), unless you know of a way to do this with POI?
Initially the files were generated 1 by 1. This works, no problem.
But now, the users want the option to tick which files they want to generate and click on a Submit button to generate all the Excel files they have checked.
Any idea on this issue?
Pls also advise how you managed to delay the form submission by 10 seconds for each of the files you were creating.
Thanks and regards,
There is <cfzip> in CF8. I would:
Generate each XLS one at a time.
Put it in a temp directory on the web server
Zip them all up
Serve the zip to the client.
From a user perspective, this seems much better then dealing with multiple download dialogs.
If you're not in CF8, there are custom tags available though they may cost something.
Many thanks for your prompt reply.
I'll give it a try.
Have a very nice day!