qrtReports_GetCurrentPage

Whether you're using the Standard or Professional Edition of Quartam Reports, this is the place to ask general questions about using this industry-level reporting tool for LiveCode.
Locked
NingImport
Posts: 87
Joined: Sun Jul 18, 2010 5:23 pm

qrtReports_GetCurrentPage

Post by NingImport » Sun Jul 18, 2010 7:26 pm

qrtReports_GetCurrentPage

Posted by Mike Kerner on July 28, 2008 at 12:56am

Is the only way to print the current page number to use a data broker and a callback? It appears that I can't embed anything in the report to print page numbers, for example.

=====

Reply by Jan Schenkel on July 28, 2008 at 10:31pm

In theory, you should be able to print the current page number in two ways:

1. Just use as expression 'qrtReports_GetCurrentPage()' in any data field (though preferably in the page header or footer)

2. Or use an expression '1' with Aggregate function 'Count' and Reset 'End of report' in a data field (only in the page header or footer) - this is the original trick as demonstrated in the example 'Table form' with layout 'sample2.qrl'

Hope this helped,

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com

=====

Reply by Mike Kerner on July 28, 2008 at 11:03pm

mm. I tried
"Page" && qrtReports_GetCurrentPage() but it doesn't work. Field is in the header.

The count trick worked, though. Unfortunately I had to make two fields - one for the word "Page" and the other for the number, but at least it works.

=====

Reply by Till Bandi on April 28, 2009 at 5:51am

Jan

the expression 'qrtReports_GetCurrentPage()' doesen't work for me neither.

expression '1' with Aggregate function 'Count' and Reset 'End of report' in a data field counts the number of records and not the pages.

Can you give me a hint where I am making a mistake?

Till

=====

Reply by Jan Schenkel on May 10, 2009 at 11:27am

Just verified this and 'qrtReport_GetCurrentPage()' is indeed broken - will be fixed in version 1.1.2

The count trick will only work if you place the field inside a page header or page footer band. The reason is simple:
- all elements in the detail band are evaluated once per detail line (so counting "1" that many times means that the count will be the same as the number of records)
- all elements in the page header (or footer) are evaluated and printed only once per page (so the count will be the same as the number of pages

Count can be used to print sequence numbers in the detail lines (for the entire report, the page, or a data group subset), or to print the total number of records in a data group or the entire report, etc.

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com

=====

Reply by Pete Whittet on May 23, 2009 at 11:23pm

I've only just started looking at the evaluation version, so it's quite likely I'm doing something daft. However ... I've tried the "count trick", and it works when the field is inside the page header, but when in the page footer, it seems to be counting the number of records. Any ideas ?

Pete

=====

Reply by Jan Schenkel on May 27, 2009 at 6:47am

Hi Pete - in theory this should "just work" so could you send your test layout file to support@quartam.com ? Then I will be able to determine why it's not reacting as you expect.

Jan Schenkel
--
Quartam Reports & PDF Library fo Revolution
www.quartam.com

=====

Reply by Pete Whittet on May 27, 2009 at 4:54pm

Thanks Jan - files will be on their way shortly.

Pete

=====

Reply by Pete Whittet on June 4, 2009 at 1:30am

I just ran a quick test of 1.1.2. The "white space" issue looks as though it's been sorted nicely, but the "count trick" page number in the page footer still appears to be showing the number of records read so far, rather than the current page (unless I'm doing something daft, which is always a possibility). Any thoughts ? (I really want to use this !)
Thanks,
Pete

=====

Reply by Jan Schenkel on June 4, 2009 at 6:47am

The 'count' trick is no longer necessary; add a data field with an expression that uses the 'qrtReports_GetCurrentPage()' function, which I've fixed. This is now the preferred method to place a page number on your reports, and works in any band.

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
http://www.quartam.com

=====

Reply by Till Bandi on June 4, 2009 at 9:07am

Great - it works!

Till

PS: In the Mac-Version the icon for the program is still the generic icon.

=====

Reply by Pete Whittet on June 4, 2009 at 6:45pm

Sounds good. Just to check before I buy, is the 'qrtReports_GetCurrentPage()' function available in both editions (Standard and Professional), or is it just in Professional ? The manual has it down as a new data broker function, under the "Professional edition only" section, and later on says that it is also available ... without the use of a custom data broker, but it isn't obvious whether it is also available in the Standard edition.

Thanks,

Pete

=====

Reply by Jan Schenkel on June 4, 2009 at 8:13pm

Ah, hmm, I should have moved that when I modified the entry in the manual. Come to think of it, I didn't update the manual for the new item selection popup either. Oh well, in version 1.1.3 or 1.2 then...
Anyway, I can confirm that the 'qrtReports_GetCurrentPage()' function is available in both the Standard and Professional editions.

Jan Schenkel
--
Quartam Reports & PDF Library for Revolution
www.quartam.com
===== The above post was imported from the old forum hosted at quartam.ning.com =====

Locked