print gridview

Last post 06-23-2009 7:45 AM by Sonu. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-19-2009 1:00 AM

    • trimp
    • Top 500 Contributor
    • Joined on 06-19-2009
    • Wannabe Slacker
    • Points 24

    print gridview

    hi , i want to print the gridview . it is printed using javascript even if i the layout is in landscape, but always in portrain. Now i want to automaticallay print the gridview in landscape when user click the print button. thanks in advance.

    Filed under:
  •  Advertisement

    Featured Advertisement

     
  • 06-19-2009 8:13 AM In reply to

    • Sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,081
    • MVP

    Re: print gridview

     Can you show me the code you are using right now to print?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 06-19-2009 10:06 AM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 17,720

    Re: print gridview

     I am sure if this is something doable. From all that I have read, the answswer is no.

  • 06-21-2009 11:44 PM In reply to

    • trimp
    • Top 500 Contributor
    • Joined on 06-19-2009
    • Wannabe Slacker
    • Points 24

    Re: print gridview

     

     

     

     

    i am using following javascript to print

     function print() {

                //open new window set the height and width =0,set windows position at bottom

                var a = window.open('', '', 'left =' + screen.width + ',top=' + screen.height + ',width=0,height=0,toolbar=0,scrollbars=0,status=0');

                //write gridview data into newly open window

                // a.document.write(document.getElementById('<%= grdBacteriology.ClientID %>').innerHTML);

                a.document.write(document.getElementById('Gridview-container').innerHTML);

                a.document.close();

                a.focus();

     

                //call print

                a.print();

                a.close();

                return false;

            }

    Filed under:
  • 06-22-2009 7:59 AM In reply to

    • Sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,081
    • MVP

    Re: print gridview

    I dont think that it will be possible. You may try to use some css styles:

    http://www.w3.org/TR/2004/CR-css-print-20040225/#section-properties

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 06-23-2009 12:53 AM In reply to

    • trimp
    • Top 500 Contributor
    • Joined on 06-19-2009
    • Wannabe Slacker
    • Points 24

    Re: print gridview

     how to use the css

  • 06-23-2009 7:45 AM In reply to

    • Sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,081
    • MVP

    Re: print gridview

    There are various pages that describe how to do that. It all depends on your requirements. I suggest that you google for "css print" to find more information.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
Page 1 of 1 (7 items)