Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a form that a user has entered data. I also have the same page with no control buttons on it. What I want is to click on the print button and the print the page with not control buttons but the data will be in the textboxes on that web form. Is there a way of doing this?
Posted
Comments
JoCodes 13-Jan-14 22:46pm    
Can you explain it more clearly?

You do not need a blank page for printing at all. You could create a local RDLC report with the text boxes and then fill them using the data entered by the user in the web form. You can display the report using ReportViewer control on the same page where the form is, maybe you can hide the form and display the report through the viewer which has a print button.
Or you can just use CSS to format the web form and javascript window.print()
 
Share this answer
 
Comments
Computer Wiz99 14-Jan-14 8:10am    
Thanks Marc Gabrie!! Can you give me an example of using Css to format the web form and javascript window.print()?
Marc Gabrie 14-Jan-14 9:22am    
I do not have a specific sample but you can get many hints by googling "css for print". And for javascript printing, just add a button or link with the window.print(); code in the onclick event.
refer below link for
Print in ASP.NET 2.0:-
http://www.dotnetcurry.com/showarticle.aspx?ID=92[^]

and pass only those controls or data that you want to print in print method.
 
Share this answer
 
C#
protected void printButton_Click(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(this.GetType(),"PrintOperation","printing()",true);
    }


Refer:http://forums.asp.net/t/1561011.aspx[^]
This may help.
 
Share this answer
 
v3
Comments
TrushnaK 14-Jan-14 0:19am    
hi gitanjali he not asking about windows forms..
see the tag and read question again.
improve your answer to keep away for downvoting.
Gitanjali Singh 14-Jan-14 0:24am    
Thanks TrushnaK for pointing.
Gitanjali Singh 14-Jan-14 0:25am    
@Computer Wiz99-Please check the updated solution.

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