Public Function GenerateHtmlReport(ByVal ResultDataset As System.Data.DataSet) As String Implements IValidation.GenerateHtmlReport
Dim _StrBuil As New StringBuilder()
Dim clsHtmlBuilder As New HtmlBuilder()
Try
_StrBuil.AppendLine(Space(2) & clsHtmlBuilder.AddHr())
_StrBuil.AppendLine(Space(3) & clsHtmlBuilder.TextBig(ResultDataset.DataSetName))
_StrBuil.AppendLine(Space(5) & clsHtmlBuilder.AddLineBreak)
For Each _Tbl As DataTable In ResultDataset.Tables
If _Tbl Is Nothing OrElse _Tbl.Rows.Count = 0 Then Continue For
_StrBuil.AppendLine(Space(8) & clsHtmlBuilder.StartTable())
'set Table Header
'set Table Name
_StrBuil.AppendLine(Space(15) & clsHtmlBuilder.StartH4())
_StrBuil.AppendLine(Space(20) & _Tbl.TableName)
_StrBuil.AppendLine(Space(15) & clsHtmlBuilder.EndH4())
_StrBuil.AppendLine(Space(25) & clsHtmlBuilder.StartTableRow())
'set Column Name
For Each _col As DataColumn In _Tbl.Columns
_StrBuil.AppendLine(Space(35) & clsHtmlBuilder.StartTableHeader())
_StrBuil.AppendLine(Space(45) & _col.ColumnName)
_StrBuil.AppendLine(Space(35) & clsHtmlBuilder.EndTableHeader())
Next
_StrBuil.AppendLine(Space(25) & clsHtmlBuilder.EndTableRow())
'set Table Rows
For Each _dr As DataRow In _Tbl.Rows
_StrBuil.AppendLine(Space(25) & clsHtmlBuilder.StartTableRow())
For Each _col As DataColumn In _Tbl.Columns
If (Space(45) & _col.ColumnName = "Result") Then
_StrBuil.AppendLine(Space(35) & clsHtmlBuilder.StartTableCell())
Else
_StrBuil.AppendLine(Space(35) & clsHtmlBuilder.StartTableCell())
End If
_StrBuil.AppendLine(Space(45) & _dr(_col.ColumnName).ToString())
_StrBuil.AppendLine(Space(35) & clsHtmlBuilder.EndTableCell())
Next
_StrBuil.AppendLine(Space(25) & clsHtmlBuilder.EndTableRow())
Next
_StrBuil.AppendLine(Space(8) & clsHtmlBuilder.EndTable())
Next
_StrBuil.AppendLine(Space(5) & clsHtmlBuilder.AddLineBreak)
_StrBuil.AppendLine(Space(2) & clsHtmlBuilder.AddHr())
Catch ex As Exception
clsCommon.writeErrorLog("Error in Report Generation", "RuleSet2", "GenerateHtmlReport")
Throw ex
End Try
Return _StrBuil.ToString()
End Function
End Class
souce에 코드를 브레이크 라인을 제거소스 코드에 TD 사이
<td nowrap = "nowrap">
4F0B52DC0001
</td>
<td nowrap = "nowrap">
C006411
</td>
<td nowrap = "nowrap">
Christiansen
</td>
<td nowrap = "nowrap">
Cathy
</td>
<td nowrap = "nowrap">
19570406
</td>
<td nowrap = "nowrap">
</td>
http://www.WhatHaveYouTried.com – JDB
@ Cyborgx37이 지적했듯이 _ 시도한 것을 _ 보여주십시오. 문제가있는 곳을 지적하고 불필요한 코드를 제거한 후 [StringBuilder.Append] (http://msdn.microsoft.com/en-us/library/system.text.stringbuilder)와 다른 점을 확인하십시오. append.aspx) 및 [.AppendLine] (http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.appendline.aspx) –
무엇이 당신의 질문입니까 ?? –