LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default How to export plain text from web site to Excel without data conve

Hi all,

I have made a web site where I produce report data to be (optionally) viewed
in Excel at the client computer. This is how I do it i Visual Basic (Studio
2005, .NET 2.0) (extract) at the web server (in the *.aspx.vb file):

Dim delimiter As Char = vbTab
Response.Clear()
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.AppendHeader("content-disposition",
"inline;filename=report.xls")
Response.ContentType = "application/ms-excel"
Dim lstrbReportData As StringBuilder = GetTheData(delimiter)
Response.Write(lstrbReportData.ToString )
Response.End()
Response.Close()

This works fine EXCEPT that Excel will do data conversions. E.g. leading
zeroes are removed, values may be converted to dates etc.

Is there a way I can tell Excel to treat all data as plain text, similar to
when I manually import a text file to excel, where I can set all columns to
Text format instead of General?

Some Response.appendheader maybe?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel considers my formulas as plain text Kimmo Kallio Excel Worksheet Functions 10 January 16th 14 05:48 PM
Import word file into excel as plain text Nick Excel Discussion (Misc queries) 1 June 23rd 08 04:22 PM
Copying Data from Excel to MS Outlook in Plain Text Mode JohnGuts Excel Worksheet Functions 0 July 30th 06 09:57 PM
Import plain text with formulas into Excel schmiedel Excel Discussion (Misc queries) 2 October 13th 05 09:53 PM
How do I export data from Excel into an ODBC client / or plain tex Margaret Excel Discussion (Misc queries) 2 February 15th 05 09:51 PM


All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"