HTML reports shows only first 30 records of a relationship

A place for users and developers of the Xataface to discuss and receive support.

HTML reports shows only first 30 records of a relationship

Postby patrei » Sat Mar 02, 2013 3:49 am

Hi all.
I'am using the new htmlreports module and noticed that when I map a relationship to an html table, only the first 30 records are fetched and shown in the table.
This happens both in preview and in record_action.
Setting default_limit=500 in conf.ini does not solve the problem.
Is there some implicit limit to the number of related records retrieved by htmlreports? How can this limit be changed?
Thanks
(Xataface 1.9 3856)
patrei
 
Posts: 2
Joined: Sat Mar 02, 2013 1:45 am

Re: HTML reports shows only first 30 records of a relationsh

Postby shannah » Sat Mar 02, 2013 1:29 pm

Yes.. This is a bit of a shortcoming right now. The related lists in reports calls getRelatedRecordObjects() which only loads the first "page" of related record results - which is default 30 per page.

You can use the Dataface_Table::setRelationshipRange() method to adjust this default value. A good place to do this would be in the table's init() method of its delegate class as it is called once per request just when the table is first loaded.

e.g.
Code: Select all
function init(Dataface_Table $table){
    $table->setRelationshipRange('myrelationship', 0, 100);
}


Alternatively, you could modify the classes/XfHtmlReportBuilder.class.php class and look for all invocations of getRelatedRecordObjects() (there are 3), and add a 2nd parameter 'all' to them. E.g.

Code: Select all
$record->getRelatedRecordObjects($relname, 'all');


That will force it to load all related records instead of just the first 30.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: HTML reports shows only first 30 records of a relationsh

Postby patrei » Sun Mar 03, 2013 8:09 am

Thank you Steve for your quick reply.
I modified XfHtmlReportBuilder.class.php as you suggested and everything is ok now.
By the way, Xataface is great!
Patrick
patrei
 
Posts: 2
Joined: Sat Mar 02, 2013 1:45 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved