|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Print WebForm DataGridIs it possible to print a webfor datagrid and if so how?
Thanks, Dave Dave,
There are 2 ways how to print: either from the browser menu or with javascript window.print() call. Both will result in producing standard browser's Print dialog. If you selected the grid prior to printing, you can choose print selection. You can select grid programmatically in javascript. There is no other way of printing a single control. Eliyahu Show quoteHide quote "Dave Bailey via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message news:b17520332caa4c7188867c953e80fdb5@DotNetMonster.com... > Is it possible to print a webfor datagrid and if so how? > > Thanks, > > Dave > > -- > Message posted via http://www.dotnetmonster.com Do you have a sample of the javascript code used for printing?
Many thanks for the response, Dave window.print() is the only call used for printing. To operate with selection
use document.selection object. Eliyahu Show quoteHide quote "Dave Bailey via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message news:b2a19373e7bb4c6bbc1d537c0229f6cf@DotNetMonster.com... > Do you have a sample of the javascript code used for printing? > > Many thanks for the response, > > Dave > > -- > Message posted via http://www.dotnetmonster.com > There are 2 ways how to print: either from the browser menu or with There are usually more than 2 ways to skin the cat, if you'll forgive> javascript window.print() call. Both will result in producing standard the metaphor... If you are creative with your CssStyle attributes and stylesheets, you can probably create a print stylesheet that will do the job: http://www.meyerweb.com/eric/articles/webrev/200001.html http://www.ericmeyeroncss.com/projects/06/ http://www.pmob.co.uk/faqcss/tutorial03/ http://www.yourhtmlsource.com/stylesheets/cssmediatypes.html For example, build your page such that you can attach styles of "display:none" to everything but the control you want to print. For a datagrid, you can even programmatically or declaratively style the table, columns, rows, cells, etc such that you can selectively style each separate element differently for print than for screen. This way, when the user selects file->print, the browser uses the print stylesheet and all they get on paper is your grid. Of course, in ASP.NET, this kind of technique essentially makes it easy to automate generating a more print-friendly page, or even attaching different stylesheets on postback depending on what the user wants to print... (incidentally, check out eric meyer's various web sites for beautiful examples of the power of adding creative CSS to sparse, clean, and well-structured HTML: - http://www.complexspiral.com/ - http://www.meyerweb.com/eric/css/ )
UserControl inside of datagrid - loses its viewstate when datagrid is re-bound on postback
Compact code Add text from listbox into datagrid column To Eliyahu Access individual item in a datagrid Dynamically Add Validation to Datagrid Add row to datagrid? Datagrid sorting does not work Can't get text value of hidden (visible = false) column.. Help |
|||||||||||||||||||||||