473,382 Members | 1,480 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.

C# Printing: Is it possible to update on already printed page ?

Hi,

I need to print a report like document. So in report there are many articles
and what I need when I get to the end, is to update page numbers on the
second page where the Table of Content is .... or even update strings like
Page 1 or 10 ... Page 2 of 10 etc ....

When starting the report I don't know the total number of pages nor the page
number on which each and every article starts ....

Is it at all possible to make an update later on ? What I do now is to go
through the document twice ... .in first loop I collect the page numbers, so
I can update it later in the second run .....

If i could leave one page blank and update it later would also do the trick
if I can do this at all !?

Thanks.

Kris
May 17 '07 #1
3 2335
Kristijan,

Are you using the PrintDocument class to print your document? If so,
then you will have to use whatever calculations you would normally to
determine page size and whatnot, and predetermine the number of pages before
you do your printing. You can not go back and print on a page that has
already been printed, since most printers have no access to the printed page
once you have finished printing it (it's usually sitting in a tray).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Kristijan Marin" <kr*************@triera.netwrote in message
news:e2**************@TK2MSFTNGP04.phx.gbl...
Hi,

I need to print a report like document. So in report there are many
articles and what I need when I get to the end, is to update page
numbers on the second page where the Table of Content is .... or even
update strings like Page 1 or 10 ... Page 2 of 10 etc ....

When starting the report I don't know the total number of pages nor the
page number on which each and every article starts ....

Is it at all possible to make an update later on ? What I do now is to go
through the document twice ... .in first loop I collect the page numbers,
so I can update it later in the second run .....

If i could leave one page blank and update it later would also do the
trick if I can do this at all !?

Thanks.

Kris
May 17 '07 #2
Hi Nicholas,

Yes I'm using PrintDocument and yes I was affraid of that answer.....:)

Is there any other possible way to do this, cause the report can have from
5-50 or more pages and because pages contain images and text doing
calculation twice takes "time" .... no matter that I do my first calculation
offscreen and off printer, and skip all the drawing ....

Any idea how to do it not using PrintDocument ?

Thanks,
Kris
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:5E**********************************@microsof t.com...
Kristijan,

Are you using the PrintDocument class to print your document? If so,
then you will have to use whatever calculations you would normally to
determine page size and whatnot, and predetermine the number of pages
before you do your printing. You can not go back and print on a page that
has already been printed, since most printers have no access to the
printed page once you have finished printing it (it's usually sitting in a
tray).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Kristijan Marin" <kr*************@triera.netwrote in message
news:e2**************@TK2MSFTNGP04.phx.gbl...
>Hi,

I need to print a report like document. So in report there are many
articles and what I need when I get to the end, is to update page
numbers on the second page where the Table of Content is .... or even
update strings like Page 1 or 10 ... Page 2 of 10 etc ....

When starting the report I don't know the total number of pages nor the
page number on which each and every article starts ....

Is it at all possible to make an update later on ? What I do now is to go
through the document twice ... .in first loop I collect the page numbers,
so I can update it later in the second run .....

If i could leave one page blank and update it later would also do the
trick if I can do this at all !?

Thanks.

Kris

May 17 '07 #3
Kristijan,

I can't think of a way. However, I think that there is no reason you
can't do your calculations/layout for the first page, and then cache the
results for the other pages after you have cycled through once.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Kristijan Marin" <kr*************@triera.netwrote in message
news:Op**************@TK2MSFTNGP02.phx.gbl...
Hi Nicholas,

Yes I'm using PrintDocument and yes I was affraid of that answer.....:)

Is there any other possible way to do this, cause the report can have from
5-50 or more pages and because pages contain images and text doing
calculation twice takes "time" .... no matter that I do my first
calculation offscreen and off printer, and skip all the drawing ....

Any idea how to do it not using PrintDocument ?

Thanks,
Kris
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:5E**********************************@microsof t.com...
>Kristijan,

Are you using the PrintDocument class to print your document? If so,
then you will have to use whatever calculations you would normally to
determine page size and whatnot, and predetermine the number of pages
before you do your printing. You can not go back and print on a page
that has already been printed, since most printers have no access to the
printed page once you have finished printing it (it's usually sitting in
a tray).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Kristijan Marin" <kr*************@triera.netwrote in message
news:e2**************@TK2MSFTNGP04.phx.gbl...
>>Hi,

I need to print a report like document. So in report there are many
articles and what I need when I get to the end, is to update page
numbers on the second page where the Table of Content is .... or even
update strings like Page 1 or 10 ... Page 2 of 10 etc ....

When starting the report I don't know the total number of pages nor the
page number on which each and every article starts ....

Is it at all possible to make an update later on ? What I do now is to
go through the document twice ... .in first loop I collect the page
numbers, so I can update it later in the second run .....

If i could leave one page blank and update it later would also do the
trick if I can do this at all !?

Thanks.

Kris


May 17 '07 #4

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

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
2
by: DBQueen | last post by:
I have a database which will be printing out labels for SMALL test tubes (1/4" high). We have yet to find a reasonably-priced printer (labelwriter) which can effectively print this on ROLLS of...
5
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath =...
1
by: Earl Anderson | last post by:
Using WinXP & AccessXP, I'd like to automatically have the records that I've just printed in a report automatically updated to have the 'print date & time' immediately inserted into a 'Date/Time'...
2
by: Jurjen de Groot | last post by:
I'm about to start a new ASP.NET application, this application will generate several types of documents (PDF HTML XML-DOC) wich have to be printed at the client-side... (probably on different...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
4
by: Lucas Ponzo | last post by:
Hi All, I have an ASP.NET 2.0 app. The users access the pages, uniquely via pocket pc ... I need to print a page. But I need that the page print on a printer installed on the web server...
1
by: Kristijan Marin | last post by:
Hi, I need to print a report like document. So in report there are many articles and what I need when I get to the end, is to update page numbers on the second page where the Table of Content...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.