473,382 Members | 1,447 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,382 software developers and data experts.

Print Preview 'Headers'

I have a datagrid with headers. I managed to 'freeze' the headers OK and
then one can scroll to see contents.

I would like to be able to print this list by re-prinitng the headers on
each page.
Evan Camilleri
Mar 24 '06 #1
7 1755
I'm not responding directly to your question because I always do it in a
diferent maner and in ASP 3.0...

I just print the Headers and then again everytime I want like

i = 0
do while not rs.eof
i = i + 1
if i = 10 then ' 10 is the number of rows that I print in the page
printheader()
i = 0
end if
printRow()

rs.movenext()
loop

and in the header I use a CSS in Header tag
style='page-break-after:always;'
but here is a link to something usefull:
http://www.alistapart.com/articles/goingtoprint/

Evan Camilleri wrote:
I have a datagrid with headers. I managed to 'freeze' the headers OK and
then one can scroll to see contents.

I would like to be able to print this list by re-prinitng the headers on
each page.
Evan Camilleri

Mar 24 '06 #2
hmmm.. quite a 'dirty' but 'efficient' work around.
The quest is now to find a way to 'insert' a header every now and then in
the datagrid!

Thanks.
"Bruno Alexandre" <br*******@filtrarte.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
I'm not responding directly to your question because I always do it in a
diferent maner and in ASP 3.0...

I just print the Headers and then again everytime I want like

i = 0
do while not rs.eof
i = i + 1
if i = 10 then ' 10 is the number of rows that I print in the page
printheader()
i = 0
end if
printRow()

rs.movenext()
loop

and in the header I use a CSS in Header tag
style='page-break-after:always;'
but here is a link to something usefull:
http://www.alistapart.com/articles/goingtoprint/

Evan Camilleri wrote:
I have a datagrid with headers. I managed to 'freeze' the headers OK and
then one can scroll to see contents.

I would like to be able to print this list by re-prinitng the headers on
each page.
Evan Camilleri

Mar 24 '06 #3
This looks interesting:

http://www.c-sharpcorner.com/Graphic...dPrinterMG.asp
"Evan Camilleri" <e7***@yahoo.co.uk.nospam> wrote in message
news:es**************@TK2MSFTNGP11.phx.gbl...
I have a datagrid with headers. I managed to 'freeze' the headers OK and
then one can scroll to see contents.

I would like to be able to print this list by re-prinitng the headers on
each page.
Evan Camilleri

Mar 24 '06 #4
:( nope! it is not ASP.NET but windows.
Mar 24 '06 #5
use Repeter (data read) instead datagrid :)

Evan Camilleri wrote:
hmmm.. quite a 'dirty' but 'efficient' work around.
The quest is now to find a way to 'insert' a header every now and then in
the datagrid!

Thanks.
"Bruno Alexandre" <br*******@filtrarte.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
I'm not responding directly to your question because I always do it in a
diferent maner and in ASP 3.0...

I just print the Headers and then again everytime I want like

i = 0
do while not rs.eof
i = i + 1
if i = 10 then ' 10 is the number of rows that I print in the page
printheader()
i = 0
end if
printRow()

rs.movenext()
loop

and in the header I use a CSS in Header tag
style='page-break-after:always;'
but here is a link to something usefull:
http://www.alistapart.com/articles/goingtoprint/

Evan Camilleri wrote:
I have a datagrid with headers. I managed to 'freeze' the headers OK and
then one can scroll to see contents.

I would like to be able to print this list by re-prinitng the headers on
each page.
Evan Camilleri


Mar 24 '06 #6
i had my program ready!

in any case..........i managed to make it with datagrid! something like:

dgHeaderCell is a global variable of type DataGridItem

If e.Item.ItemType = ListItemType.Footer Then
dgHeaderCell = e.Item
End If

If e.Item.ItemType = ListItemType.Footer Then
Dim dgItem As DataGridItem
Dim dgCell As TableCell
Dim iHeaderCtr As Integer = (m_RowsPerPage) + 1
Do While iHeaderCtr < dg.Items.Count
dgItem = New DataGridItem(iHeaderCtr, iHeaderCtr,
ListItemType.Header)
dgItem.Attributes.Add("style", "page-break-before:always")
For Each dgHeaderCell As TableCell In m_dgiHeader.Cells
dgCell = New TableCell
dgItem.Cells.Add(dgCell)
dgCell.Text = dgHeaderCell.Text
dgCell.Visible = dgHeaderCell.Visible
dg.Controls(0).Controls.AddAt(iHeaderCtr, dgItem)
Next
iHeaderCtr = iHeaderCtr + m_RowsPerPage + 1
Loop
End If
So i am happy for the weekend!!!!!
Evan
"Bruno Alexandre" <br*******@filtrarte.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
use Repeter (data read) instead datagrid :)

Evan Camilleri wrote:
hmmm.. quite a 'dirty' but 'efficient' work around.
The quest is now to find a way to 'insert' a header every now and then in
the datagrid!

Thanks.
"Bruno Alexandre" <br*******@filtrarte.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
I'm not responding directly to your question because I always do it in a
diferent maner and in ASP 3.0...

I just print the Headers and then again everytime I want like

i = 0
do while not rs.eof
i = i + 1
if i = 10 then ' 10 is the number of rows that I print in the page
printheader()
i = 0
end if
printRow()

rs.movenext()
loop

and in the header I use a CSS in Header tag
style='page-break-after:always;'
but here is a link to something usefull:
http://www.alistapart.com/articles/goingtoprint/

Evan Camilleri wrote:
I have a datagrid with headers. I managed to 'freeze' the headers OK
and then one can scroll to see contents.

I would like to be able to print this list by re-prinitng the headers
on each page.
Evan Camilleri


Mar 24 '06 #7
updating just a small mistake i did in previous post........

m_dgiHeader is a global variable of type DataGridItem

If e.Item.ItemType = ListItemType.Footer Then
m_dgiHeader = e.Item
End If

If e.Item.ItemType = ListItemType.Footer Then
Dim dgItem As DataGridItem
Dim dgCell As TableCell
Dim iHeaderCtr As Integer = (m_RowsPerPage) + 1
Do While iHeaderCtr < dg.Items.Count
dgItem = New DataGridItem(iHeaderCtr, iHeaderCtr, ListItemType.Header)
dgItem.Attributes.Add("style", "page-break-before:always")
For Each dgHeaderCell As TableCell In m_dgiHeader.Cells
dgCell = New TableCell
dgItem.Cells.Add(dgCell)
dgCell.Text = dgHeaderCell.Text
dgCell.Visible = dgHeaderCell.Visible
dg.Controls(0).Controls.AddAt(iHeaderCtr, dgItem)
Next
iHeaderCtr = iHeaderCtr + m_RowsPerPage + 1
Loop
End If



Mar 24 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Neo Geshel | last post by:
I'm helping on a web site, and it's got our knickers in a knot. We're using the same basic CSS files (with mods) and same headers as from our other sites, but the "print preview" won't work...
7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
1
by: Kenneth | last post by:
Hi, In IE6 you can configure output to the printer getting a clean printout only with content, but without headers and footers. You remove the Header and Footer content from the Page Setup. But...
2
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002...
1
by: Hector M Banda | last post by:
Hi all, Need i simple example on how print/preview data from a database. I already have some code but I am lost because the preview does not create multiple pages and only shows the first page and...
0
by: hector | last post by:
Hi all, Need i simple example on how print/preview data from a database. I already have some code but I am lost because the preview does not create multiple pages and only shows the first page...
9
by: igotyourdotnet | last post by:
I need to create a print preview page BUT my page I need to print has a grid and in the grid I have 2 or 3 columns that have links I want to hide the columns with the links on my print preview page...
0
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the...
11
by: Gord | last post by:
When I open a certain report, it runs some code that generates the records that will be displayed in that report. This works fine. When I go to print preview the report it appears that the code...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.