Printing Automatically Growing Fields

0
Hello! I am using an automatically growing text area as a field on a form.  It displays perfectly on the screen. However, when the form is printed, the automatically growing text area is cutting off the last few rows of text.  Does anybody know of a solution to this issue? I have attached screenshots of the view from the screen and the printing output. The above image is the how the textbox appears on the screen.  Automatically grow is already checked.  On the right hand side, the scroll bar is grayed out.   The below image is how the textbox appears when printing.  The same text box is shown, however the scroll bar is not grayed out and information is cut out of view.  I believe the issue occurs when the width of the automatically growing textbox is wider than the width of the page it is printing on.  The height of the automatically growing textbox does not adjust to account for the change in display width.
asked
2 answers
2

Based on my research, HTML TextAreas just generally don’t play nicely with printing. This is not Mendix-specific but rather an observation about web apps in general. The most common suggestion is to create a read only version of the text on the page as well. Then, set a few CSS classes on the elements so the editable TextArea is visible in a browser, but hidden when printing. The Text element is the inverse: visible when printing but hidden in the browser.

So I’d recommend doing something similar:

  • Create a Text widget, formatted as a Paragraph
  • Set the value of the text to {1}, and use the same attribute from the Text Area to populate it
  • Add the class “print-only” to the Text widget, and “no-print” to the Text Area
  • Then add these classes to your app’s CSS:

 

.print-only{
    display: none;
}

@media print {
    .no-print {
        display: none;
    }
    .print-only{
        display: block;
    }
}
answered
0

If you go into the properties of the text area there is an option to “grow automatically” with the text which is being displayed. 

answered