Printing a Datagrid on Multiple Pages

J

Jay

Still can't seem to find a solution to printing a lengthy datagrid on
multiple pages including datagrid headeron each page. I am not using
Crystal Reports or Reporting Services or VStudio. Any idea how this can be
done? Any links, examples

Thanks a lot.
 
G

Guest

http://aspnet.4guysfromrolla.com/articles/070903-1.aspx

Scott Mitchell has an excellent solution for this.

<code>
<asp:datagrid>...
....<PagerStyle NextPageText="Next Page >>" PrevPageText="<< Prev.
Page"></PagerStyle> </asp:datagrid>

....<asp:label id="lblMessage" Font-Name="Verdana" Font-Size="Smaller"
runat="server" Font-Italic="True"></asp:label></form>
</code>

This is builtin. I also like including the page number.

<code>
Sub myDataGrid_Paged(ByVal sender As Object, ByVal e As
DataGridPageChangedEventArgs)
myDataGrid.CurrentPageIndex = e.NewPageIndex
lblMessage.Text = "Viewing Page " & myDataGrid.CurrentPageIndex + 1
& _
" of " & myDataGrid.PageCount
myDataGrid.DataBind()
End Sub
</code>

Read up and if all else fails, Google around and you'll find dozens of
examples.

-Eustice
 
J

Jay

Thanks a lot. I'll give Scott's exampe a try. I have been searching Google
a ton lately but haven't found any other examples. Any ideas where I might
find other examples as well?

Thanks.
 
J

Jay

It doesn't appear that Scott's example illustrate printing the datagrid
header on the multipple pages.
 
J

Jay

The problem I have is a very long datagrid that when printed spans several
pages (length wise). When each page is printed it often cuts a row half way
through (then you can't obviously read that row). I also want to have the
header printed on all non-cropped pages.
 
Joined
Jul 14, 2006
Messages
1
Reaction score
0
Did you (or anyone) figure out how to do this? I have been doing research online as well and haven't found any good examples of printing a multiple page datagrid from asp.net. (not from a windows forms - I have seen a few examples of those.)

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top