473,394 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Firefox vs IE on Excel File Generation

I am using a script to generate XL files by just sending headers and even if I only send one row of data, it takes forever for the Firefox box to allow me to Open/Save the file ... however, in IE it comes up almost instantly, even when there are around 100 rows of data.

Does anyone have any idea why this could be? It seems like a Firefox setting but I don't know what setting it could/would be.

Thanks,
Andrew
Apr 23 '08 #1
3 1794
TheServant
1,168 Expert 1GB
I am using a script to generate XL files by just sending headers and even if I only send one row of data, it takes forever for the Firefox box to allow me to Open/Save the file ... however, in IE it comes up almost instantly, even when there are around 100 rows of data.

Does anyone have any idea why this could be? It seems like a Firefox setting but I don't know what setting it could/would be.

Thanks,
Andrew
If it works on both, generally it means that it is the browser rather than your code. However, if you have an error in your code and that error is better dealt with on IE than Firefox, then that could also do it. Check your script for errors and also try it on Opera or even evil Safari. If it is a small script post it here so we can try and find your error (if you have one). Otherwise ask Firefox support for their opinion.
Apr 23 '08 #2
Here is my code for generating an XL sheet based on a query that's been built in another page. It's 32 lines but is a pretty basic loop. If I comment out the 4 headers at the end it loads the tab-delimited text well in both browsers so perhaps I'm using the wrong header or header settings?

[PHP]
$table = "Custom"; if (isset($_GET['table'])) $table = strtoupper($_GET['table']);
$header = "";
$data = "";
$strSQL = "SELECT * FROM Table"; //really a session var
//echo "<BR>".$strSQL."<BR>";
$result = mysql_query($strSQL);
$fields = mysql_num_fields($result);
for ($i = 0; $i < $fields; $i++) {
$header .= mysql_field_name($result, $i) . "\t";
}
while($row = mysql_fetch_row($result)) {
$line = '';
foreach($row as $value) {
if ((!isset($value)) OR ($value == "")) {
$value = "\t";
} else {
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line)."\n";
}
$data = str_replace("\r","",$data);
if ($data == "") {
$data = "\n(0) Records Found!\n";
}
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=".$table."_Query.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo "$header\n$data";
[/PHP]
Apr 23 '08 #3
Quick Update: I just tried[PHP]header("Content-type: application/vnd.msexcel"); //application/x-msdownload OR application/vnd.msexcel OR ???[/PHP] and got the same results where it seems a lot better in IE than FF.
Apr 23 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: krallabandi | last post by:
Hi, I am trying to generate Excel sheet using Provider=Microsoft.Jet.OLEDB.4.0; I am always getting the error while inserting data into any cell other than A. An unhandled exception of...
4
by: Robert | last post by:
I have created a .dll in C# which has a reference to Excel. When I add a strong name to the .dll in the AssemblyInfo.cs and try to rebuild, I get the following error: Assembly generation failed...
3
by: DS | last post by:
I try to generate a excel workbook using Excel object in ASP.NET program. When I implement the Excel workbook generation with out a thread it works fine. When I wrap all the excel generation...
3
by: krallabandi | last post by:
Hi, I am trying to generate Excel sheet using Provider=Microsoft.Jet.OLEDB.4.0; I am always getting the error while inserting data into any cell other than A. An unhandled exception of...
3
by: Jawad Rehman | last post by:
Hello everybody..... I have an excel file which is resided on server,there is some data on the cells .Now i want to generate dynamic graph on the basis of the data present in the excel file ...
1
by: =?Utf-8?B?S3VtYXIuQS5QLlA=?= | last post by:
I am using Excel automation for a report. Dim objExcel As New Excel.Application objExcel.DisplayAlerts = False Dim objWorkbooks As Excel.Workbooks = objExcel.Workbooks Dim objWorkbook As...
2
by: firstexact | last post by:
Hi guys, First post, hope you can help, I have done two sites www.trisant.co.uk and my own www.firstexact.co.uk. The 2 x 2 grid I originally envisaged goes haywire in Firefox as I get a 4 high by...
1
by: Jahamos | last post by:
Background: I have copy and pasted an Excel flowchart into a Dreamweaver html page. I created a frame on the top of the page as a viewer. I created hotspot links over the flowchart items. Each...
5
by: sheldonlg | last post by:
I am top-posting this one time because this in new stuff and I am leaving the bottom for reference and description of the problem. I am also adding comp.lang.php as this is all done in php and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.