chewba_71
06-21-2005, 07:32 PM
Hello,
I am new to ActionScript.org as well as to Flash and ActionScript. I am a coldFusion developer using some of the new technology with mx 7. Currently, I am using the coldFusion Flash Forms and actionScript for a simple popup window displaying data. I am just testing this for for possible future development.
The problem that I am having is this, I have a page in the form that has a datagrid on it and I want to be able to export the information on the grid to excel. So, I created a button that creates a popup that loads a coldfusion page that has the content type set to excel. Below are snippets of the files.
This is the getURL call that creates the popup.
<cfoutput>
<cfsavecontent variable="pop">
getURL("javascript:window.open('index.cfm?fuseaction=Popup .excel&report=Popup.Details&OppId=#oppid#', 'USToExcel', 'width=900,height=630, Scrollbars=1, resizable=0'); void(0);");
</cfsavecontent>
</cfoutput>
<cfinput type="button" name="toExcel" value="To Excel" onClick="#pop#" >
This is the file that creates the excel page, minus some of the data.
<cfsetting enablecfoutputonly="Yes">
<!--- Set content type. --->
<cfcontent type="application/excel" reset="yes" >
<!--- Suggest default name for XLS file. --->
<!--- "Content-Disposition" in cfheader also ensures
relatively correct Internet Explorer behavior. --->
<cfheader name="Content-Disposition" value="filename=Schools.xls">
<style>
/* Style Definitions */
td.MsoNormal{
mso-style-parent:"";
border:thin solid #000000;
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
}
</style>
<cfoutput>
<table >
<tr>
<th class="MsoNormal">School Name</th>
<th class="MsoNormal">Parent Name</th>
<th class="MsoNormal">Enrollment</th>
</tr>
</table>
</cfoutput>
When I click the button that calls the getURL the new popup window opens for a second then disappears. If I comment out the code that sets the excel page's content type to excel the page displays the data fine. If I access the excel url directly with the content type set to excel the page displays correctly asking me to open or save the data. Only when I access the page with the getURL is it failing. I tried removing the void(0); from the getURL command and then it opens a new page displaying only (object). If I change the getURL to point to the url directly instead of opening a new window it works correctly. ie "getURL("index.cfm?fuseaction=Popup.excel&report=Popup.Details&OppId=#oppid#");" works correctly. The problem is that I need it to be a popup.
I was hoping someone here would maybe know of a fix to this problem or maybe has an idea of a work around. I can be email at ltd_ed@yahoo.com
Thank You,
Mike
I am new to ActionScript.org as well as to Flash and ActionScript. I am a coldFusion developer using some of the new technology with mx 7. Currently, I am using the coldFusion Flash Forms and actionScript for a simple popup window displaying data. I am just testing this for for possible future development.
The problem that I am having is this, I have a page in the form that has a datagrid on it and I want to be able to export the information on the grid to excel. So, I created a button that creates a popup that loads a coldfusion page that has the content type set to excel. Below are snippets of the files.
This is the getURL call that creates the popup.
<cfoutput>
<cfsavecontent variable="pop">
getURL("javascript:window.open('index.cfm?fuseaction=Popup .excel&report=Popup.Details&OppId=#oppid#', 'USToExcel', 'width=900,height=630, Scrollbars=1, resizable=0'); void(0);");
</cfsavecontent>
</cfoutput>
<cfinput type="button" name="toExcel" value="To Excel" onClick="#pop#" >
This is the file that creates the excel page, minus some of the data.
<cfsetting enablecfoutputonly="Yes">
<!--- Set content type. --->
<cfcontent type="application/excel" reset="yes" >
<!--- Suggest default name for XLS file. --->
<!--- "Content-Disposition" in cfheader also ensures
relatively correct Internet Explorer behavior. --->
<cfheader name="Content-Disposition" value="filename=Schools.xls">
<style>
/* Style Definitions */
td.MsoNormal{
mso-style-parent:"";
border:thin solid #000000;
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
}
</style>
<cfoutput>
<table >
<tr>
<th class="MsoNormal">School Name</th>
<th class="MsoNormal">Parent Name</th>
<th class="MsoNormal">Enrollment</th>
</tr>
</table>
</cfoutput>
When I click the button that calls the getURL the new popup window opens for a second then disappears. If I comment out the code that sets the excel page's content type to excel the page displays the data fine. If I access the excel url directly with the content type set to excel the page displays correctly asking me to open or save the data. Only when I access the page with the getURL is it failing. I tried removing the void(0); from the getURL command and then it opens a new page displaying only (object). If I change the getURL to point to the url directly instead of opening a new window it works correctly. ie "getURL("index.cfm?fuseaction=Popup.excel&report=Popup.Details&OppId=#oppid#");" works correctly. The problem is that I need it to be a popup.
I was hoping someone here would maybe know of a fix to this problem or maybe has an idea of a work around. I can be email at ltd_ed@yahoo.com
Thank You,
Mike