By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,112 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,112 IT Pros & Developers. It's quick & easy.

Printing a Datagrid on Multiple Pages

P: n/a
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.
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
"Jay" wrote:
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.

Nov 19 '05 #2

P: n/a
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.

"Eustice Scrubb" <Eu***********@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
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
"Jay" wrote:
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.

Nov 19 '05 #3

P: n/a
Jay
It doesn't appear that Scott's example illustrate printing the datagrid
header on the multipple pages.

"Eustice Scrubb" <Eu***********@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
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
"Jay" wrote:
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.

Nov 19 '05 #4

P: n/a
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.
"Eustice Scrubb" <Eu***********@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
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
"Jay" wrote:
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.

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.