ASP.NET: Print functionality
I've a big form with below mentioned fields/controls:
- SharePoint Peoplepicker
- SharePoint DateTime control
- TextBox Single/Multiline
I'm looking for a solution to print this form. Output print should be clean to ensure everything looks like labels while printing. If I change CSS e.g. for textbox, there are limitations viz. not all data of textbox would be visible. Is there a way to achieve this without having to do following:
- Have Labels and show them while printing for each control
- Convert gridviews with itemtemplate and have labels in template while printing.
Another requirement is to ensure that form fits in A4 paper.
I had similar assignment & I completed using below approach:
- Create a 'Print preview' button which on click opens a dialog
- Extra controls like row numbers in grid, warning messages, buttons or similar can be removed
- Remove extra padding, margins & font size can further be reduced to fit A4 e.g. 8pt
- Finally provide a 'Print' button which takes parent container & prints- You can use printThis.js for this