CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Export To Excel Memo Field Issue

Print topic Send  topic

Author Message
afrausto

Posts: 66
Posted: 10/05/2006, 11:48 AM

Hello,

Has anyone experienced an issue with memo fields when trying to export a grid to excel. For some reason, if the content in the Memo field contains several paragraphs when it is displayed in the worksheet the paragraphs are broken into separate cells. For example

ID      Name        Comments  
-----------------------------------------------------------  
1    |  George  |   This is an example, of what happens.  |  
-----------------------------------------------------------  
     |          |   A new paragraph begins in this cell.  |  
-----------------------------------------------------------  
2    |  Ralph   |   New comments for this record.         |  
-----------------------------------------------------------

I've done some research in MS Office Excel Help and the only suggestion was to add x:str to the <td>, like so <td x:str> to tell MS Excel that the cell is string data. That did nothing.

Any suggestions would be greatly appreciated.

Thanks
View profile  Send private message
Edd


Posts: 547
Posted: 10/07/2006, 8:02 PM

Your issue is CR in the memo field. Can you provide a more explanation on the extract process?

Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
afrausto

Posts: 66
Posted: 10/09/2006, 8:27 AM

Edd,

This is what I have in OnInitializeView:

Dim ExportFileName  
  
 ExportFileName = "EG-Export.xls"  
	If(CCGetFromGet("export","") = "1") Then  
	Response.Buffer = true  
	'Hide the ToExcelLink Link   
	'ToExcelLink.Visible = False  
	'Link1.Visible = False  
	'Header.Visible = False  
  
	'Set Content type to Excel  
         Response.ContentType="application/vnd.ms-excel"  
    'Fix IE 5.0-5.5 bug with Content-Disposition=attachment  
	If InStr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE 5.5;") OR _  
       InStr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE 5.0;") Then  
  		Response.AddHeader "Content-Disposition", "filename=" & ExportFileName & ";"  
	Else  
  		Response.AddHeader "Content-Disposition", "attachment; filename=" & ExportFileName  & ";"  
	End if  
 End if

This is what I have for BeforeSelect:

 If(CCGetFromGet("export","") = "1") Then  
	'Show up to 10,000 records  
	eg.PageSize = 10000  
	'Hide the Navigator  
	eg.Navigator.Visible = false  
 End if

I tried to replace vbCrLf within my memo fields with <br>, even though it worked I now had to contend with the <br> tags.

eg.ProjectDescription.value = Replace(eg.ProjectDescription.value,vbcrlf,"<br>")

Any suggestion how to deal with Carriage Returns in MS Excel.

Thanks.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.