Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a "parents Feedback" webForm in asp.net whose controls are polulated by data fetched from database and i want to print it in decorated Word format(A4 size)with header, feedback messages and suggestions of parent on print button click.

i have googled about it but not getting the proper solution.

need help to do it.
Thanks!
Posted
Comments
thatraja 11-Dec-13 5:13am    
Sample screenshot?
Marc Gabrie 11-Dec-13 18:33pm    
By "print it in decorated Word format"... do you mean to "export" that webform in Word format? please clarify a bit.
[no name] 12-Dec-13 1:39am    
its a parent feedback form of a school website. after completing the form there is a print button, on click of which i want all data of filled form in a word file in client side PC.

1. Whatever you want to print, just show that on a Web Page.
2. On that Web Page, add a Button saying "Print".
3. OnClick of that Button, write JavaScript code window.print();[^].
 
Share this answer
 
So you want to create a Word document of that form. A possible solution is you create a RDLC (local report) in your website with the same layout as your form. Then when the user ends filling the form and click on the Print button, you can pass the info entered by the user to the RDLC report as a data set, so you can bind the report at runtime and finally export it to DOC format using ReportViewer too. So the steps would be:

1. Create a class in your website (under App_Data folder) and add as many properties as fields the user must fill in the web form. E.g. if user provides Name, Age, etc... then create them as Properties in your class

2. Create a RDLC report and select the class you created at #1 as the data source of your report. Then recreate your web form layout in the RDLC report binding each field accord

3. In your aspx webform, in the print button click, create a new instance of the class created at #1, set the properties with the values entered by the user, create a reportviewer instance to load the RDLC report + binding it to the data object you just created. Export to doc using ReportViewer and send it back to the user (refer to Exporting to Word/PDF using Microsoft Report (RDLC) without using Report Viewer.[^])
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900