So we built a new BAQ report using the knowledge base on E10 to concatenate detail rows in a BAQ to a single delimited field… This ended working out very well and we have the data normalized the way we want it before passing it to SSRS.
But we have one small nuance that we would like we would like to see if we can work out.
Is it possible to control when the line wraps in the textbox that the string is tied to is SSRS?
The individual pieces of data (between the commas) can be all different sizes and the string itself overall will vary. But we do not want the data to wrap and break up a single string between commas. We would only want the line to wrap after a comma. Hope this makes sense
Many text controls will naturally wrap at whitespace. If there is no whitespace available, it wraps where it has to. If it is possible to replace the commas with comma-space, it may wrap where you want it to.
I use this function in Report Properties /Code where i pass the text to appear in the textbox…
Public Function SplitComments(ByVal str As String) as String
Dim c() As String = Nothing
dim s as string = ""
c = str.Split(vbcrlf)
Dim i As Integer
For i = 0 To c.Length - 1
If i > 0 Then
s = s & vbCrLf & c(i)
Else
s = c(i)
End If
Next
return s
End Function
and call it as an expression for example
=Code.SplitComments(First(Fields!ShipComment.Value, “ShipHeadShipDtl”))
Well first, I did not create this code, i was told to use it…;). All I know is my comments text went from being linear (no line breaks ) to be using the valid line breaks originally intended. If I copied the text from within DB table record field to notepad, it showed correctly. But added to a SSRS report text box, it did not…Using this function does the split!
But I see what you mean (my VB is soo far away… ) looking at it…but it does split the comments! Just did a test with and then without and the text shows as expected with the code, and will not show with line breaks without!
Ah, so it finds the line-feeds in the output from Epicor and breaks the string accordingly. Similar to a List view in how “Copy to Excel” will carry over the line breaks but how “Copy All” or “Copy All Include Labels” will not carry over the line feeds when pasted into Excel.
Remember that C# is case sensitive, so I chalked it up to the export stripping the case out of the command and C# thus ignoring it. That’s just my guess
Here is another workaround. It involved changing the express for multiline fields.
Here is the code:
=IIf(InStr((Replace(Fields!FIELDNAME.Value, CHR(10), “CHR10”)), “CHR10”) > 0 AND InStr((Replace(Fields!FIELDNAME.Value, CHR(13), “CHR13”)), “CHR13”) = 0,