Export to Word: Text wrap doesn't increase height of corresponding label

Posted by: charlie.widdicombe on 30 June 2020, 6:24 am EST

  • Posted 30 June 2020, 6:24 am EST

    I have a report that I am exporting to word using the rtfexport class. One of the fields on the report can be long enough that it warrants wrapping. The issue I am having is that if the textbox wraps the text is placed on the line below but the corresponding label does not increase in height as it would with a normal report. This means that the wrapped text is now in line with the label of the field beneath it, and the field that should be in line with the second label is now pushed on to the line beneath that.

    I was hoping that you would have a solution to help make the label that is aligned with the wrapping text box expand to match it when it is exported.
  • Replied 30 June 2020, 8:47 pm EST


    I am not able to reproduce the issue with the attached report. Could you please check the issue with the same. If issue is not reproducible, could you please share the stripped-down report so that I can replicate the issue at my end.
    Also, share the exact version of AR i.e you are using at your end.

  • Replied 1 July 2020, 2:12 am EST

    I am using ActiveReports 13 in a vb.net environment. We are running a section report and exporting the document using the rtfexport.Export function with the attached report.

           Dim myCertificate As New PT55Certification

    myCertificate.DataSource = {certificationData}

    Dim wordExporter As New GrapeCity.ActiveReports.Export.Word.Section.RtfExport

    wordExporter.Export(myCertificate.Document, wordFilePath)
  • Replied 1 July 2020, 8:25 pm EST


    I am able to replicate the issue at my end. However, it is by design. If you set "Word wrap" to "No Wrap" in Wordpad, it shows the correct output. Also, "Word Wrap" is property of the WordPad, not the rtf document. So it by design to wrap the text if the text does not come under the range of the ruler.

    Hope it clarifies.

  • Replied 2 July 2020, 6:57 am EST

    The issue we are having is that the field in question gets moved down onto another line, but the label that would be on that line does not get moved down. In the attached document you can see that the contents of the county" field are on the same line as the "Date" label, while the contents of the Date field are being pushed onto an empty line. The desired behavior is to have the "Date" label be pushed down to a new line, which should be how the report would behave were it not being exported to a word document.
  • Replied 2 July 2020, 10:36 pm EST


    Please refer the attached image as I am not replicate the issue at my end. The Text Wrap occurs due to the ""Word wrap" property of Word pad set to "Wrap to Ruler". "WordWrap" property is always is constant for every RTF document. If you change the "WordWrap" property to "NO Wrap" then every document open in NO wrap state. Could you please share screenshot of the current behavior and expected behavior so that I can help you accordingly.

  • Replied 6 July 2020, 2:43 am EST

    You should be able to replicate the issue if you set the County field to contain a value with 50 characters, which is the max lengthfor that field.
  • Replied 6 July 2020, 4:02 am EST

    I have attached an image that should illustrate the issue better.
  • Marked as Answer

    Replied 6 July 2020, 8:27 pm EST


    I have modified the report as per your requirement. Could you please check with the attached report.
    I have increased the Height of the Textbox and set the "CanShrink" to true so that when the country's length is small then it will automatically reduce its height.

    New folder.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels