Hi
I'm trying to fill a HTMLTextBox on a subreport programatically in order to change appearence depending on the data. I managed to get line breaks working by changing from BR to DIV tags, but I can't get the styles to work. Since I have a lot of subreports I really don't want to include FONT tags into the code and risk creating a maintenance nightmare. Is there a way to set styles programatically?
I've tried adding the HTML using a script that is called from the HTMLTextBox, such as
...
PositionLine = "<DIV Class='PositionCompany>'" & PositionLine & "</DIV>"
Return PositionLine
but this only gives me linebreaks, not the formatting. "'PositionCompany" is a style rule defined in the master report.
How do I call the CSS formatting? (By the way, I can't set it directly since I use several different style rules inside the same HTMLTextBoc depending on data.
Thanks in advance!
Re
Dennis
Public Shared Function Position(ByVal Company As String, ByVal City As String, ByVal Country As String, ByVal CompanyType As String, ByVal Title As String, ByVal DetailLong As String, ByVal DetailShort As String) As String |
Dim PositionLine As String = Company.ToString |
If City <> "" Then |
If PositionLine <> "" Then |
PositionLine += ", " & City.ToString |
Else |
PositionLine = City.ToString |
End If |
End If |
If Country <> "" Then |
If PositionLine <> "" Then |
PositionLine += ", " & Country.ToString |
Else |
PositionLine = Country.ToString |
End If |
End If |
If CompanyType <> "" Then |
If PositionLine <> "" Then |
PositionLine += " (" & CompanyType.ToString & ")" |
Else |
PositionLine = CompanyType.ToString |
End If |
End If |
If PositionLine <> "" Then |
PositionLine = "<DIV Class='PositionCompany'>" & PositionLine & "</DIV>" |
End If |
If Title <> "" Then |
If PositionLine <> "" Then |
PositionLine = PositionLine & "<DIV Class='PositionTitle'>" & Title.ToString & "</DIV>" |
End If |
End If |
If DetailShort <> "" Then |
If PositionLine <> "" Then |
PositionLine = PositionLine & "<DIV Class='PositionDetails'>" & DetailShort.ToString & "</DIV>" |
End If |
End If |
If DetailLong <> "" Then |
If PositionLine <> "" Then |
PositionLine = PositionLine & "<DIV Class='PositionDetails'>" & DetailLong.ToString & "</DIV>" |
End If |
End If |
Return PositionLine |
End Function |