Hello,
I have a form with multiple controls on it. The text control is scrollable field which contains 10 or more lines of data . Currently when I print (WYSIWUG format) , I can only view 4 lines of 10 (since the other lines are not visible unless the user scrolls the text area ). I would like to extend the print functionality (to see more than WYSIWU) so that I can resize the control at runtime and accordingly resize all the other controls for printpreview.
I have attached a detailed image from our main project. If you notice the image, the description field does not contain all of the data.
I am looking for ways to extending the printing so that it would pull all the data from the controls without any overlap for print.
Any new approach for achieving this will also help.
Thanks
Hi,
I'm not sure I understand your question.
There are a couple of ways you could acheive what you want. One way would be to use the Infragistics.Documents engine to create a report that contains all of the data you want to print.
Another option is to handle the printing yourself by handling the PrintPage method on the UltraPrintDocument class.
But both of these methods require you to write some code. There's no way that any of the components in NetAdvantage can print the contents of all controls on a form for you, since there are too many unknowns.
Thanks Mike for the quick reply. I appreciate your help. I look forward to hear from you again.Let me rephrase my question.
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,
Any approach for printpage to handle the positioning of controls.
how will document engine help me in creating reports ? What about the layout , how will it mimick the GUI shown on the screen. Do I need to redesign entire form at runtime ? What about the position of the controls ?
Thank you so much for your help. I look forward to hear from you.