LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Programming Line Breaks into Cells

I found the solution!

I was using the following header in an ASP page to generate an Excel
spreadsheet from a database report.

----
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "attachment;
filename=JPIJobsProfiles.XLS"
----

But the output streamed into excel did not contain any chr(10) line breaks -
hence no line breaks in my Excel cell.

The solution is two-fold.

1) At the server level use 'Replace(strText, chr(13), "<br /")' to convert
chr(10) into "<br /".
2) The problem then is that "<br /" in Excel would split the text over
multiple cells. The solution was to use the following style in the ASP
page for the '<br' tag:

----
br {mso-data-placement:same-cell;}
----

I found this solution online, but am reposting for the benefit of others.

Regards,
Wayne C.


 
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
Parsing line breaks into separate cells JaneA28206 Excel Discussion (Misc queries) 3 October 27th 09 01:37 PM
how do I remove line breaks from several cells? JR Excel Discussion (Misc queries) 3 May 15th 09 03:20 AM
Removing Manual Line Breaks in Multiple Cells Jules Excel Discussion (Misc queries) 2 January 30th 09 08:09 PM
Line Breaks in cells - Mac OS X Leopard plunkettphoto Excel Discussion (Misc queries) 1 August 7th 08 08:34 PM
Line breaks in my cells... AkelA Excel Discussion (Misc queries) 3 October 3rd 07 07:18 PM


All times are GMT +1. The time now is 05:52 AM.

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

About Us

"It's about Microsoft Excel"