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

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


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

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.