PS : Including the image , in which the description text is truncated, I would like the print preview to get the entire content for description and resize the other text box controls according to their size.
Consider a form consisting of horizontal split control.
The top panel contains information like Name, ROll no, Description etc.
The bottom panel contains tab controls.The first tab contains a grid , clicking on second tab diplays other information ( having text box, labels etc) , third tab and so on.
When I print the form , the user is given the option to print the entire form along with tab controls or just print the top panel alone.If the user opts for printpreview ( and later print) for top panel alone, then the print preview should pull the information from the top panel only.
Normally the print option generally displays the content that is currently visible to the user. If the user sees only some part of the description ,then only that is available in printing as well.
But what I would like to do is , extend the printing so that the entire contents of all the controls are seen (even though they are not visible on screen by that I mean that information is seen only when the user scrolls the text box). Similarly if there is a combo box and the width is set to 80px , certain items in the combo box may be cut off on the screen and not visible unless the user clicks that icon and sees the tool tip to see the content of the text box.
But during print preview, the width of the combo box needs to increase , so that it accomodates the full content of the selected item of the combo box.
Right now for trial purpose, I had overriden the print page event and resized the controls width and height for drawing. In my test application , I can take the controls shown on the screen , capture its screen width and height and then recreate a rectangular control with the same width and height, entire content and pass it to graphics for drawing that image.
Thus I would have to write generic code to achieve resizing of the control depending on the content. Similary I would also need to find out if the control needs to grow width wise or height wise. Since for the combo box , it would need to grow horizontally. And if it needs to grow horizontally,will it fit the page size ?. Another consideration is if the controls are arranged in certain order and if I resize a particular control , what about the control that was aligned along side it ? That needs to move too ..
Listed above are some of the considerations that I need to make before I print the form and its tab layout(s).
Is the approach of overriding print page and code it good ? . Are there any more parameters I need to be aware of before I develop the generic code for resizing the controls depending the contents.
How would UltraPrintDocument be useful , currently we have created our own printDocument control. If our printDOcument control inherits from UltraPrintDocument are there immediate benefits (apart from setting header , footer etc ) for the above problem.
Also how will Document engine help me . Can I create a report on the fly from the form and use for display purpose. How will I design the form for reporting engine since it needs to mimick the GUI form. Since the position of the layout needs to remain the same.
I need some examples , becuase I dont see much of documentation for this.
To summarize,
Thank you so much for your help. I look forward to hear from you.