0

I am using a telerik asp.net control to output the contents of a grid to excel. I am creating the html myself and then the grid is doing the export. I'm not sure if the grid is doing anything fancy but here is a snippet of the html I am creating for export . I am creating the export in a vb.net stringbuilder

output.AppendLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">")
output.AppendLine("<html xmlns=""http://www.w3.org/1999/xhtml"">")
output.AppendLine("<head><style type=""text/css""> body {font: arial; font-size: 24px} .title {background-color: #eeeeee; font-size: 24px; font-weight:bold; height: 70px; vertical-align: middle;} .header{background-color: blue; font-weight=bold; text-align: left;} .data{border:1px solid black;text-align:left;vertical-align: top;} </style></head>")
output.AppendFormat("<body ><table><tr><td colspan=""8"" class=""title"" style=""width:1000px;"">{0} Report for {1} from {2: dd/MM/yyyy} to {3: dd/MM/yyyy}", Me.ReportTitle, GetCommaSeparatedListOfItems(cblVehicles, "vehicles"), dpStartDate.SelectedDate, dpEndDate.SelectedDate)

The problem I am having is that the excel content is not the same as that specified in my html. In excel the title is calibri size 18 rather than arial size 24. The body text is calibri 11 rather than arial 24.

So i have 2 questions:

1) how do i see the html source of the document when it is open in excel 2) how do i fix my output such that the excel document displays what is in the html output

thanks a lot

user2274191
  • 843
  • 2
  • 14
  • 24

1 Answers1

0

The following example would probably help you:

How-to-format-excel-file-with-styles-fonts-colors-tables-etc

How to format excel file with styles, fonts, colors, tables etc with pure PHP?

Community
  • 1
  • 1
  • hi - i'd already seen that before posting the question. It doesnt help me with my issue and why my code isn't producing the intended formatting – user2274191 Aug 29 '13 at 17:02