Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2006, 10:48 AM
Registered User
 
Join Date: Sep 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid printing

Guys, i am using the below code to export my output as a word document

Private Sub btnexport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexport.Click
        BindGrid()
        Response.Clear()
        Response.AddHeader("content-disposition", "attachment;filename=blah.doc")
        Response.Charset = ""
        Response.Cache.SetCacheability(HttpCacheability.No Cache)
        Response.ContentType = "application/vnd.word"
        Dim stringWrite As New System.IO.StringWriter
        Dim htmlwrite As New HtmlTextWriter(stringWrite)
        mygrid.RenderControl(htmlwrite)
        Response.Write(stringWrite.ToString)
        Response.End()
    End Sub

export works fine...but when i print the page, i dont get all the columns of the datagrid...i mean datagrid doesnt fit in a page...how and where should i make changes inorder to fit the grid in a page for printing purposes...

thanks in advance...

 
Old April 6th, 2006, 12:25 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

either limit the # of columns or the user can change the page layout to landscape.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing in ASP.NET through DataGrid agro_menon Pro VB Databases 0 July 16th, 2007 01:02 AM
Printing DataGrid Data koneruvijay VS.NET 2002/2003 4 April 10th, 2007 05:58 AM
DataGrid printing - CSS settings jernej CSS Cascading Style Sheets 1 October 27th, 2005 05:31 AM
C# DataGrid Printing adwatts C# 2 September 30th, 2004 09:34 AM
printing from datagrid in VB.NET emilyjeany VB Databases Basics 0 September 22nd, 2004 09:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.