Which rows are printed on a specific page

General TRichView support forum. Please post your questions here
Post Reply
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Which rows are printed on a specific page

Post by infrax »

I'm using RichViewXML and TRVReportHelper generate and print RV documents.

Now let's say that we have a XML with a big table (printed on multiple pages). I want to know which rows are printed on a specific page.

I tried with TRVReportHelper.GetFirstItemOnPage, but with this I just get the item number of the table -> I want to know specific row.

Any way to do this?

Thanks
Sergey Tkachenko
Site Admin
Posts: 17560
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The answer is not simple, because a row can be printed on multiple pages (and cells of some row may be printed on next pages, with next rows, because of a vertical cell merging).
Can you explain why do you need it? May be I will be able to find an alternative solution.
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

Well the problem is that we want to print a very big RV (xml generated) file into PDF. Usually it is just one very big table. We are talking 10000 PDF pages and more ...

For 'small' dataset it is working OK (up to 100000 rows), but after that it goes out of memory.

So I was thinking to generate and format pages one by one ....
Sergey Tkachenko
Site Admin
Posts: 17560
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Where does it goes out of memory? While formatting (RVReportHelper.Init + FormatNextPage) or when generating PDF?
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

It goes while I'm building XML document (with RichViewXML).

I haven't tried building that big document directly in RV ...
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

What would you recommend?

What is the best/right way to generate large reports, using RV?

Generating PDF (the component for this) is not a problem. I tired to create 1GB dummy file and it was OK.

In any case, if we're building report in parts, the problems are page numbers. You don't know the total page count, until you finish.

Thanks
Sergey Tkachenko
Site Admin
Posts: 17560
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I think generating the report in parts is the only solution.
Do you need to display a page count on each page?
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

Usually yes, but maybe in this case we could leave it out.

I think the only solution for this is to go over the whole PDF file again and print header/footer with page count (if the header/footer height is the same). Any other way?

OK in parts then. And back to my first question. Usually in this bit reports we have just one big table. Now you should somehow know when did you stop printing one part to start with the next one. I was thinking, if you know which row was printed on the last-1 page, you could generate & print the next part starting on a new page like it was one print (one iteration).

Thanks
Sergey Tkachenko
Site Admin
Posts: 17560
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you generate a report in parts, I think the real questions is how to start printing the next part at the same place where the previous part is ended?
If you separate a large document in parts, you already knows which parts consists of which rows.

When you finish printing a part N, you can get its height as HeightN = RVReportHelper.GetLastPageHeight, so you can start printing a part N+1 at YN+HeightN.
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

True, but I want to do this with tables.

So the requirements are:
- have the table header row at every page (can be more than 1 row)
- user shouldn't notice when one part ended and the other started (could be a problem if a table/cell has a border)
- have the table footer row only at the last page (this shouldn't be a problem)

Procedure:
- printing 1 part (without footer row)
- at the end of 1 part (page N), I know where it ended (Height1: height as you showed)
- now I must generate a new xml with a table
- it should start the next part (at page N) at Height1, but without header row
- page N+1 starts normally with header row
- ...

Is there an option not to print header rows at the first page?

Thanks
Sergey Tkachenko
Site Admin
Posts: 17560
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This option will be added in the next update
(rvtoContinue in table.PrintOptions)
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

OK, great.

When can we expect this next update, approximately?
Sergey Tkachenko
Site Admin
Posts: 17560
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Later in this week
Sergey Tkachenko
Site Admin
Posts: 17560
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Implemented in version 13.10 (uploaded for registered users)
infrax
Posts: 31
Joined: Wed Aug 10, 2011 10:57 am

Post by infrax »

It's working :D .

Thanks
Post Reply