Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:22:52+00:00 2026-06-11T10:22:52+00:00

Public Function GenerateHtmlReport(ByVal ResultDataset As System.Data.DataSet) As String Implements IValidation.GenerateHtmlReport Dim _StrBuil As New

  • 0
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 code :

 <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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:22:54+00:00Added an answer on June 11, 2026 at 10:22 am

    Do you mean that you want the following?

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

    Try this:

    For Each _col As DataColumn In _Tbl.Columns
        If (Space(45) & _col.ColumnName = "Result") Then
            _StrBuil.Append(Space(35) & clsHtmlBuilder.StartTableCell())
        Else
            _StrBuil.Append(Space(35) & clsHtmlBuilder.StartTableCell())
        End If
        _StrBuil.Append(_dr(_col.ColumnName).ToString())
        _StrBuil.AppendLine(clsHtmlBuilder.EndTableCell())
    Next 
    

    (Use Append instead of AppendLine)

    If you try asking a clearer question, you may get a more relevant answerer.


    EDIT:
    In response to your comment, you can remove the gap between the last (empty) table cell by checking to make sure that the “attribute” value is not blank or null. The line of code that’s causing your problems is:

    _StrBuil.AppendLine(Space(45) & _dr(_col.ColumnName).ToString()) 
    

    This will print a line of text (with a new line character at the end) whether or not _dr(_col.ColumnName) represents a non-null/non-blank value. Wrap this satement if an if-block that ensures it is only executed if _dr(_col.ColumnName) is not null and not blank. You can use .Trim() to remove white-space from the value and String.IsNullOrEmpty() to make sure that there’s a non-blank value represented by the string.


    EDIT:
    For more information, please see the following links:

    • String.IsNullOrEmpty
    • String.Trim

    Think about what you want to accomplish, then write it down as a series of steps (maybe on paper first, then in code). If you cannot do that, then you cannot program (HINT: Almost anyone can program).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Public Function MethodOne(ByVal s As String) As String Dim sb As New StringBuilder() sb.Append(s)
Public Function Cricket() As List(Of String) Dim list2 As New List(Of String)() With {
Public Function TitleCase(ByVal strIn As String) Dim result As String = Dim culture As
Public Function GetTransformation(ByVal xmldata As String, ByVal Xsltpath As String) As String Dim writer
public function bmdToStr(bmd:BitmapData,width:int,height:int):String { var encoder:JPEGEncoder = new JPEGEncoder(); var encBytes:ByteArray = encoder.encode(bmd); return
Public Function CastToT(Of T)(ByVal GenericType(Of Object) data) As GenericType(Of T) Return DirectCast(data, GenericType(Of T))
Public Function Foo() as String() Dim bar As String = {bar1,bar2,bar3} Return bar End
Public Function CheckIfItemPresent(ByVal userID As String, ByVal itemID As String, ByVal itemPrice As Integer,
Public Function StartTableCell( _ Optional ByVal align As String = , _ Optional ByVal
Here is my code snippet: Public Function convert(ByVal robert As String) Try robert =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.