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
|
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.
|