alignment of detail in each column did not match with column header.

I used code list bellow to export cr to excel. The problem is the alignment of detail in each column did not match with column header. In report design view, they are all match. Is there any way to fix it?     

.....
ExpOptions.ExportFormatType = ExportFormatType.Excel
ExpOptions.FormatOptions = New ExcelFormatOptions
Dim req As New ExportRequestContext
req.ExportInfo = ExpOptions
'Dim s As Stream
's = Rpt.FormatEngine.ExportToStream(req)
Dim strExportFile, strFileId As String
strFileId = HttpContext.Current.Session.SessionID & "_" & Replace(FormatDateTime(Now, DateFormat.ShortTime), ":", "") & ".xls"
Dim s As System.IO.MemoryStream = Rpt.ExportToStream(ExportFormatType.Excel)
With HttpContext.Current.Response
.ClearContent()
.ClearHeaders()
.ContentType = "application/xls"
.AddHeader("Content-Disposition", "inline; filename=" & strFileId)
.BinaryWrite(s.ToArray)
.End()
End With
0
aspfun
11/8/2004 9:24:18 PM
asp.net.crystal-reports 7043 articles. 0 followers. Follow

1 Replies
461 Views

Similar Articles

[PageSpeed] 9

This is an issue with Excel, not Crystal.  By default, Excel aligns numeric columns to the right, and text columns to the left.  I don't think there's an option in CR .NET to change this.

You could try right-aligning your headers, or adding a double-quote (") to the beginning of the header title, which is an old shorthand way of telling Excel to right-align the column. Or, you could prepend a single-quote (') to the beginning of your numberic fields, and have them left-aligned.
If my post is your answer, please mark it as the answer. It will bring good karma.

Crystal Alliance
My Blog
Florist Blogs
0
rjdudley
11/9/2004 2:02:11 PM
Reply: