473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Printing a Datagrid on Multiple Pages

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
4 3707
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Veronika | last post by:
Hi all, I need to print all the data in my datagrid to a printer, and the user must be able to choose whether with the grid lines or without. I am a beginner in .net and I would appreciate any...
0
by: Chris Gardner | last post by:
I have a datagrid that prints a large number of records from a SQL database. Because it is a large table, when printed the table "bleeds" from one page to the next. Ideally, I would like to have...
1
by: Dave Bartlett | last post by:
Hello, When we print a page containing a datagrid, the first page prints fine, but all subsequent pages are printed without table / cell borders i.e. the data is just floating on the page. Is...
7
by: Amirallia | last post by:
Hello! I have a wecontrol table in a page, this table has a number of variable rows depending of the choice of the user. But when the table has a large number of rows, the printing of the page...
5
by: Jay | last post by:
I have been searching and searching and searching for a way to print a lengthy datagrid on multiple pages and persist the header. I also do not want the last datagrid row on the page to be cut off...
3
by: Jay | last post by:
Hi, I have this problem with DataGrid printing. I have a page which contains only DataGrid. When i try to print the page, only 1st page contains the verticle and horizontal lines of the...
0
by: Jay | last post by:
Hi, I have this problem with DataGrid printing. I have a page which contains only DataGrid. When i try to print the page, only 1st page contains the verticle and horizontal lines of the grid....
0
by: Jay | last post by:
Hi, I have this problem with DataGrid printing. I have a page which contains only DataGrid. When i try to print the page, only 1st page contains the verticle and horizontal lines of the grid....
2
by: ruca | last post by:
I have this problem with DataGrid printing. I have a page which contains only DataGrid. When i try to print the page, only 1st page contains the verticle and horizontal lines of the grid. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.