Answered
CFContent / Excel Output issue
I'm trying to do a simple query to output data to the browser
in Excel format but I keep running into the same problem... which
is similar to those I've seen in other posts here. I've been
browsing the forums for a while trying every suggestion I can find
to solve my problem but so far nothing works.
The process is triggered by the user choosing an "Excel" radio button on a form and then clicking a submit button. The form action then processes the user's selection criteria through a series of queries and then attempts to open the output as Excel data. Like others here, Excel tries to open as the CFM url I called instead of the XLS filename I've added to the CFHeader tag. The REALLY strange thing is that if I choose CANCEL and then submit the form a second time, the file opens as it should... without fail.
If I comment the CFContent and CFHeader tags the browser displays the report data as expected with no errors.
I believe Excel is tripping up on something but I just can't figure out what. I have a similar process in another part of my site that uses a link to trigger the report instead of a form submit and that works just fine. Am I missing something here in the difference between a link and a form submit?
Here is where things appear to be failing. The commented lines are just to show you what I have tried. I'm currently using the variables.strExcel_Out variable for output. This was created using CFSaveContent and running the report code dspSemaReportOutput2.cfm. I've also tried running that directly without the variable. I get the same results no matter what I change so I'm missing something.
Any thoughts or suggestions would be appreciated.
The process is triggered by the user choosing an "Excel" radio button on a form and then clicking a submit button. The form action then processes the user's selection criteria through a series of queries and then attempts to open the output as Excel data. Like others here, Excel tries to open as the CFM url I called instead of the XLS filename I've added to the CFHeader tag. The REALLY strange thing is that if I choose CANCEL and then submit the form a second time, the file opens as it should... without fail.
If I comment the CFContent and CFHeader tags the browser displays the report data as expected with no errors.
I believe Excel is tripping up on something but I just can't figure out what. I have a similar process in another part of my site that uses a link to trigger the report instead of a form submit and that works just fine. Am I missing something here in the difference between a link and a form submit?
Here is where things appear to be failing. The commented lines are just to show you what I have tried. I'm currently using the variables.strExcel_Out variable for output. This was created using CFSaveContent and running the report code dspSemaReportOutput2.cfm. I've also tried running that directly without the variable. I get the same results no matter what I change so I'm missing something.
Any thoughts or suggestions would be appreciated.
