daniel50096230
August 12th, 2009, 10:43 PM
I have the following code in my vb.net:
lbl.Text = lbl.Text & "<table width=""100%"" border=""1"" bordercolor=""#111111"" cellpadding=""0"" cellspacing=""1"" style=""border-collapse: collapse"">"
lbl.Text = lbl.Text & "<tr>"
lbl.Text = lbl.Text & "<td class=""tableHeader2"" style=""height: 42px; max-width: 4%; text-align: center; FONT-WEIGHT: bold; FONT-SIZE: 8px; COLOR: #000000; FONT-FAMILY: Arial; BACKGROUND-COLOR: #cccccc;"">"
lbl.Text = lbl.Text & "GRN"
lbl.Text = lbl.Text & "</td>"
lbl.text=lbl.text & "</tr>"
lbl.Text = lbl.Text & "<tr>"
lbl.Text = lbl.Text & "<td style=""text-align: center;"">" + ShortenDescription(dsDetails.Tables(0).Rows(b).Item("GRNNo").ToString(),5)
lbl.Text = lbl.Text & "</td>"
lbl.text=lbl.text & "</tr>"
Public Function ShortenDescription(ByVal str As String, ByVal len As Integer) As String
If String.IsNullOrEmpty(str) Then
Return String.Empty
ElseIf str.Length > len Then
Return String.Format("{0}...", str.Substring(0, len))
Else
Return str
End If
End Function
in the GRNNo, there are around 10 character, but I would like to wrap the text after 5 character. However, although I had create a function to make it wrap, but it will display "12345..." rather than wrap the text.Anyone can teach me how to wrap the text?
lbl.Text = lbl.Text & "<table width=""100%"" border=""1"" bordercolor=""#111111"" cellpadding=""0"" cellspacing=""1"" style=""border-collapse: collapse"">"
lbl.Text = lbl.Text & "<tr>"
lbl.Text = lbl.Text & "<td class=""tableHeader2"" style=""height: 42px; max-width: 4%; text-align: center; FONT-WEIGHT: bold; FONT-SIZE: 8px; COLOR: #000000; FONT-FAMILY: Arial; BACKGROUND-COLOR: #cccccc;"">"
lbl.Text = lbl.Text & "GRN"
lbl.Text = lbl.Text & "</td>"
lbl.text=lbl.text & "</tr>"
lbl.Text = lbl.Text & "<tr>"
lbl.Text = lbl.Text & "<td style=""text-align: center;"">" + ShortenDescription(dsDetails.Tables(0).Rows(b).Item("GRNNo").ToString(),5)
lbl.Text = lbl.Text & "</td>"
lbl.text=lbl.text & "</tr>"
Public Function ShortenDescription(ByVal str As String, ByVal len As Integer) As String
If String.IsNullOrEmpty(str) Then
Return String.Empty
ElseIf str.Length > len Then
Return String.Format("{0}...", str.Substring(0, len))
Else
Return str
End If
End Function
in the GRNNo, there are around 10 character, but I would like to wrap the text after 5 character. However, although I had create a function to make it wrap, but it will display "12345..." rather than wrap the text.Anyone can teach me how to wrap the text?