HTML / Excel format problem

V

Velvet

I'm not sure if this is the correct group in which to post this, but here goes.

I'm creating a spreadsheet in an ASP page where I include the meta tag so that the browser converted the data into an excel file. The Meta tag is added as follows:
Response.AddHeader("Content-Type", "application/x-msexcel")

But no matter what I do, if the user tries to sort the data I get this error:
This operation requires the merged cells to be identically sized

I see that there is a workaround of highlighting the data and unmerging the cells, but I'm not sure that my client is going to go for that solution. However I cannot figure out why it thinks the cells are merged. All cells are individual when I create the page so I'm baffled.

Is there anyone who has figured out how to get rid of this problem?

Thanks,
Velvet
 
P

Peter Huang [MSFT]

Hi Velvet,

Thanks for your posting!
I did not understand your scenario very much.
Firstly I would like to clarify the scenario with you.
Do you mean you want to Export an Excel file in an asp page?
So that when the End User access to the ASP page with IE, the Excel
Application will open to show the Excel file.
or
Can you describe the scenario more clearly?

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
V

Velvet

Yes. Basically the ASP page find whether the user wants to see the data
from the query in HTML or to be saved as an XLS file. Depending on the form
selection I set the meta tag MIME type to HTML or XLS mode.

If the user chooses XLS (and I add the MIME type header), then the browser
pops up a message asking if they want to open the file or save it. My
customer wants to save it and then open it offline. When they open it,
after saving to the local hard drive, and he tried to sort the data he get's
the afore mentioned error.

The workaround to the error is to unmerge the merged cells, but I would
rather not have any of them merged in the first place. I'm wondering if
this is something I'm doing in my table (in the way of formatting) to make
the cells merge or if this is just par for the course when using the MIME
type for conversion. I think I'll just have it spit out one row and see if
the error still pops.

Thanks!
Velvet
 
V

Velvet

Ok, I only spit out about 40 rows and the error didn't happen. So now I'm
convinced it's something in the data. Maybe a double quote messing up the
formatting or something... More testing...
 
V

Velvet

Found it! It was a <br> that the client had added to the field contents in
the database.

Thanks!
 
P

Peter Huang [MSFT]

Hi Velvet,

Thanks for your quickly reply!
I am glad you have found the solution.
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top