473,551 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error when export to excel


I'm trying to export to excel.. using:

Response.Conten tType = "applicatio n/vnd.ms-excel"
Response.AddHea der "Content-disposition", "attachment;fil ename=" & sFileName
Response.AddHea der "Location",
"http://www.ascendas.co m/chinapartnerrew ards/" & sFileName

<html xmlns:x="urn:sc hemas-microsoft-com:office:exce l">

but the result i got was v irregular..

Firstly, i had 3 different location that tigger this file..
1) navagtion using flash file
2) a href pointin to the same url
3) a button also pointing to the url

The button i had no problem.. but the navagation give me different results
every time i tigger it.. 1st tigger --> popup showing to open or save the
excel file (correct result).. 2nd tigger --> popup showing to open or save as
asp file(wrong result)
3rd tigger --> no popup at all, the result was show at the IE itself.. but
once i clear the cache(cookies) in the IE the result wil reset itself to the
1st tigger result..

So as my <a href> some times it works.. some time it don't..

Is there any code that i can add in to solve this problem??
I had tried adding the cachecontrol.. but it will block out my download of
excel completely..

Thanx lotx..

May 31 '06 #1
0 1237

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Sonu | last post by:
Greetings - I am trying to export a tbl from Access 2000 that has 26,544 records. When I export the tbl to Excel, it only exports out 16,384 records. It also creates a tbl that shows the data export errors and it says the following - "Rows dropped due to worksheet row limit" I am stumped and any help will be greatly appreciated. Thx in...
by: anon | last post by:
Hello , I have a web application in which the pages have an "export to Excel" facility....while this works fine on the development machine, when the files are transferred to the server, the export to excel gives a Runtime Error in the application, is there any configuration necessary on the production server?Please help. Thanks, Ben ***...
by: Russ | last post by:
I have a usercontrol that is loaded by a webform. The usercontrol populates a datagrid which users need the capability to export data from the grid to Excel. The problem is that when I attempt to export the data to excel I get the following error message: Control 'RoomReservationReport1_dgReservations__ctl2__ctl0' of type...
by: Mortar | last post by:
i am dynamically creating controls when i do a server side export to an excel file. I can only get it to work if I have no <% %> anywhere in my html. i.e. i am writing out session name to the html <%=Session%>, and when i try and do the export i get: controls collection cannot be modified because the control contains code blocks (i.e. <%...
by: zhollywood | last post by:
OK... I'm not VBA illiterate, but I'm a BA trying to maintain a code-heavy Access 2002 (XP OS) front-end attached to Oracle tables. I have an export to Excel button that worked before the SP2 upgrade, and didn't work afterwards. Research shows me the upgrade caused a problem with a memo field in the export, causing the CopyFromRecordset of...
by: mina | last post by:
One of my client want to export data into excel file but he can not installed office just installed excel and want to export file into ..xls format at that time he got error .... Retrieving the COM class factory for component with CLSID{00024500-0000-0000-C000-000000000046}failed due to the following error.80040154 i hope any one help me...
by: forumaic | last post by:
Hello, I am trying to export data to excel from datagrid, and I am getting an error: "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." Error details: System.Web.HttpException was unhandled by user code Message="The Controls collection cannot be modified because the control contains...
by: =?Utf-8?B?bWFuaWthMDI=?= | last post by:
Hi, I have a GridView control in page called eventslisting which is inheriting from a MasterPage. The normal code to export to GridView does not work and gives me an error - "Control of type GridView must be placed inside form tag with runat = server". I understand that this is because my Masterpage has the formtag and not the eventslisting...
by: accessvbanewbie | last post by:
I keep getting an error stating OBJECT VARIABLE OR WITH BLOCK VARIABLE NOT SET. This error just recently began to happen. I am exporting some records to excel into a preformatted report. The records are exported successfully but this error pops up before the export is completed. When I run the debugger this line gives the error...
by: ielamrani | last post by:
Hi, I am getting this error when I try to export to an excel sheet. When I click on a button to export the first time it's fine, I rename the exported excel sheet and I try to export it again and I get the error: Runtime Error 1004: Method ‘Cells’ of Object ‘_Global’ failed It highlight this line: Range("A1:L1").Select sorry the code behind...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.