R
Ruskin Hardie
There is an iframe in my document that is hidden, which is the target for a
submitted form. When the form is submitted, some javascript sets a hidden
div, to displaying, eg:
document.getElementById('hiddendiv').style.display = '';
This div, simply has the words "building csv file, please wait", and is
used, because their is no indication in IE, as to what is happening, when
the user clicks on 'Results in CSV format', to return a report as a CSV
file.
The form is submitted to the hidden iframe. The asp page that is used in the
action of the form (run.csv.report.asp), has a content type of
"text/comma-separated-values" and a response header of
""Content-Disposition","filename=report.csv".
If the report returns no records, in the asp page, I can return either;
<html>
<body onload="
window.top.document.getElementById('hiddendiv').style.display='none';
alert('No records have been found for your report');"></body></html>
Or if the number of records is greater than 65535 (maximum number of rows
Excel can handle);
<html>
<body onload="
window.top.document.getElementById('hiddendiv').style.display='none';
alert('Too many records for Excel.\nPlease refine your search
criteria'');"></body></html>
However, if records are found, because the response is a csv, (ie:
response.write "field1,field2,field3" & vbCrLf) I can not use the javascript
of;
window.top.document.getElementById('hiddendiv').style.display='none';
Otherwise, this line is included in the csv file and the div is not hidden
when the report is finished.
Is there anyway to hide the div on the client, after the server has created
the report?
submitted form. When the form is submitted, some javascript sets a hidden
div, to displaying, eg:
document.getElementById('hiddendiv').style.display = '';
This div, simply has the words "building csv file, please wait", and is
used, because their is no indication in IE, as to what is happening, when
the user clicks on 'Results in CSV format', to return a report as a CSV
file.
The form is submitted to the hidden iframe. The asp page that is used in the
action of the form (run.csv.report.asp), has a content type of
"text/comma-separated-values" and a response header of
""Content-Disposition","filename=report.csv".
If the report returns no records, in the asp page, I can return either;
<html>
<body onload="
window.top.document.getElementById('hiddendiv').style.display='none';
alert('No records have been found for your report');"></body></html>
Or if the number of records is greater than 65535 (maximum number of rows
Excel can handle);
<html>
<body onload="
window.top.document.getElementById('hiddendiv').style.display='none';
alert('Too many records for Excel.\nPlease refine your search
criteria'');"></body></html>
However, if records are found, because the response is a csv, (ie:
response.write "field1,field2,field3" & vbCrLf) I can not use the javascript
of;
window.top.document.getElementById('hiddendiv').style.display='none';
Otherwise, this line is included in the csv file and the div is not hidden
when the report is finished.
Is there anyway to hide the div on the client, after the server has created
the report?