ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Grid - How can print it
Title:
B
I
{code}
?
I'm thinking how I can print or export a grid to pdf
Save Changes
Cancel
Meccanica Rossi
asked at 19 Jan 2018
Answers
B
I
{code}
?
you could export it to excel as shown here (using NPOI library) https://demo.aspnetawesome.com/GridExportToExcelDemo and after print it, or maybe use a different library that exports to a different format (like pdf) the important bit in that demo is the code that gives you the data model, and you can use that model with the library of your choice to export in different formats
Save Changes
Cancel
Omu
answered at 19 Jan 2018
I'm trying your suggestions, but unlike Excel with the pdf format I would need the width of each columns ... How can I get this information? PS: the user can change the width of the column, and I would like to recreate the printing of the grid as it is displayed
at 04 Jun 2018
Meccanica Rossi
you can get it with jquery `header.width()`, the internal width is `$('#Grid1').data('o').columns[1].W` but it can be zero, for columns that have no width set and haven't been resized, so they expand automatically to take all the remaining space
at 04 Jun 2018
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK