No, the printdocument control is used to print DOCUMENTS. The form is not a document. In order to print the form, you need to find some way to capture the screen, then print it.
I am designing a form for clients to fill out and print
I was doing research and was thinking of using crystal reports but not sure how to set it up on vs.net do I need to buy a seperate program for it or does it come with vs.net already.
Why does the form need to be represented as controls on the screen? Can't you just make a PrintDocument and use PrintPreview if they want to view it before actually printing it out? Or draw the graphics onto your form which you would use to construct the PrintDocument.
But from what I have experienced with PrintDocument and PrintPreview I am not able to print what is on my form.
I am able to set it up so that I could print the contents of what ever is in the textboxes but I need to have it print up the same way the form is viewed on the screen.
Well, thats your preference. There are some tutorials out there on how to do the screen capture thing. Just do a search on google for it.
As far as Crystal Reports, that will basically do what I was suggesting--not printing out a picture of a computer screen, but printing out an easily readable document of what has been entered by the user.
I have tried the screen shot code it works fine but the problem is if the users screen setting is too big and cuts the form off then the form will be printed with the form being cut off. I need it so if the whole form can not be visible with out scrolling and the user prints the form I would need the whole printed and not just the part that is viewable.
Well that's why it won't work. You can't, AFAIK, capture something that does not exist.
That is exactly the reasoning behind "drawing" your own "form" with a PrintDocument.
Again, I don't see why it matters that you draw the text from your TextBoxes and Labels onto a PrintDocument rather than printing out a picture of the TextBoxes and Labels. You can even draw borders around them that make them look like controls if you want. Really, when you think about it, when you buy something at Best Buy, the receipt doesn't look like a picture of their computer screen.
Once a form is completed are you saving the data to a file or database? If so, then in crystal reports, add the fields from the database and print.
You might want to find a copy of 'Crystal Reports for Visual Studio .Net', 2nd edition from Wrox. It will take you thru the steps of how to create your report and print it.
Even if you aren't using adatabase to hold customer info, you can capture the info to a file and use that file as a data source in crystal reports.
Or does your client want to see a "form" as part of the printed document. If this is the case, I'd try to talk them out of it, as it isn't neccessary, doesn't look professional and can be a waste of toner or ink to print all those buttons, frames, etc.
BTW Crystal Reports .net is included with VS .net 2003.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.