I'm trying to create a print out of my current screen into a report.
I'm using the compositelink to add links to the report. I have two grids to display wich I'm using printable component links and then other text which i'm using textbricks.
The last peice of text i wish to display is an overall comments field that can be a paragraph of text. This is not formatting correctly... eg isn't word wrapped.
I've created a demo project to show you and I have found that if the grid printable compennt link is not added to my compositelink link collection then the formatting works fine, or if my comments brick is added in first then it is fine.. but when it is at the end it does not format correctly.
I've also attached and image what i get in my live report.
Is there a work around for this or something i am missing?
To resolve the issue, enable the word wrap option when initializing the TextBrick in your code. Review the updated code snippet:
Private Sub Comments_CreateDetailArea(sender As Object, e As CreateAreaEventArgs) Dim tb As New TextBrick tb.Text = OverallComments tb.BackColor = Color.Transparent tb.HorzAlignment = HorzAlignment.Near tb.VertAlignment = VertAlignment.Top tb.StringFormat = BrickStringFormat.Create(TextAlignment.TopLeft, True) Dim sz As SizeF = e.Graph.MeasureString(OverallComments, CInt(Math.Ceiling(e.Graph.ClientPageSize.Width)), tb.StringFormat.Value) Dim rect As New RectangleF(0, 0, sz.Width, sz.Height) rect.Height = rect.Height + 1 e.Graph.DrawBrick(tb, rect) End Sub
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.