How show colors in export to excel in asp.net
<p>iam doing export functionality in asp.net1.1....
I want to highlight some records in red color when i export to excel...
following is my code to export records in excel but i want some records in red colors...
So how to do this plz help me out.</p>

<pre><code>Public Shared Sub ExportToExcelInvitee(ByVal query As String, _
                                       ByRef Response As System.Web.HttpResponse, _
                                       Optional ByVal exportDataset As DataSet = Nothing)
        Dim index As Integer
        Dim colIndex As Integer
        Dim columnCount As Integer
        Dim excelDataSet As DataSet
        Dim cnt As Integer

        Const PROC As String = CLASSNAME &amp; ".ExportToExcelInvitee"
        Try

            If IsNothing(exportDataset) Then
                excelDataSet = ExecuteDataset(query)
            Else
                excelDataSet = exportDataset
            End If

            If Not IsNothing(excelDataSet) Then
                If excelDataSet.Tables(0).Rows.Count &lt;&gt; 0 Then

                    Response.Clear()
                    Response.ContentType = "application/vnd.ms-excel"
                    Response.Charset = ""
                    Response.AddHeader("Content-Disposition", "attachment; filename=List.xls")

                    Response.Write("&lt;TABLE border=1&gt;")
                    Response.Write("&lt;TR&gt;")
                    Response.Write("&lt;TD&gt;&lt;DIV align=center&gt;&lt;B&gt;Sr. No.&lt;/B&gt;&lt;/DIV&gt;&lt;/TD&gt;")
                    columnCount = excelDataSet.Tables(0).Columns.Count - 1
                    For index = 2 To columnCount

                        Response.Write("&lt;TD&gt;" &amp; _
                                          "&lt;DIV align=center&gt;" + _
                                                "&lt;B&gt;" &amp; excelDataSet.Tables(0).Columns(index).ColumnName.ToString &amp; "&lt;/B&gt;" + _
                                          "&lt;/DIV&gt;" &amp; _
                                       "&lt;/TD&gt;")

                    Next
                    Response.Write("&lt;/TR&gt;")
                    Response.Write("&lt;TR&gt;")
                    ' Loop to leave one empty line after header, 
                    ' Loopimg to add the TD with black boders which doens not get added if only TR added
                    For index = 2 To columnCount
                        Response.Write("&lt;TD&gt;&lt;/TD&gt;")
                    Next
                    Response.Write("&lt;/TR&gt;")

                    cnt = 1
                    For index = 0 To excelDataSet.Tables(0).Rows.Count - 1
                        If Not (excelDataSet.Tables(0).Rows(index).RowState = DataRowState.Deleted) Then

                            Response.Write("&lt;TR&gt;")
                            Response.Write("&lt;TD&gt;" &amp; _
                                              "&lt;DIV align=left&gt;" &amp; _
                                                  (cnt).ToString() &amp; _
                                              "&lt;/DIV&gt;" &amp; _
                                            "&lt;/TD&gt;")
                            For colIndex = 2 To columnCount

                                Response.Write("&lt;TD valign=top&gt;" &amp; _
                                                  "&lt;DIV align=left&gt;" &amp; _
                                                       excelDataSet.Tables(0).Rows(index).Item(colIndex).ToString() &amp; _
                                                  "&lt;/DIV&gt;" &amp; _
                                               "&lt;/TD&gt;")

                            Next
                            Response.Write("&lt;/TR&gt;")
                            cnt = cnt + 1
                        End If
                    Next
                    Response.Write("&lt;/TABLE&gt;")
                    Response.End()

                End If 'DataSet must contain data
            End If 'DataSet must contain data

        Catch ex As Exception
            Call ErrorLog(PROC &amp; ", " &amp; ex.Source, ex.Message)
        End Try

    End Sub
</code></pre>
