Infinite report and beyond

by Luca Baldini on 09/19/2014

One of the functionalities of Instant Developer 13.1 we haven’t talked about yet is that now you can create reports of infinite length. I’d like to dedicate this post to describing it to you.

It’s not the first time I’ve talked to you about the InDe reporting system. As many of you know, this module allows you to print PDF and to display data on screen in any form. You can create invoices, catalogs with images, or simple video games like I told you about at the beginning of the year.

Recently, some of you have been asking me the same question: “I have about 100,000 lines in my database and I’d like to make a report that can show all of them. How can I do that?”. It was a very interesting question because it implies that there is a limitation in the reporting system. The report module worked like this: first, the system loaded all the data, and then it prepared the pages as the user requested them, differentially. The fact that the data had to be loaded when opening the report was a limitation, because it could take too long or use too much memory, but thinking of the solution I realized that it could be achieved if I’d had a way to use delayed loading of collections in reports as well.

This is precisely the change that I implemented in version 13.1. The idea is simple: all you have to do is create a collection and indicate that it can contain, for example, 100,000 lines. At this point, if the collection is provided to the report and a preview is displayed, the system will ask the programmer to provide the missing documents progressively as it needs them. With this system, you can make applications like Twitter and Facebook, where the page grows infinitely and the data are loaded when the user wants to see them.

This system also makes it possible to jump forward a bunch of pages without having to load all the documents in between. For example, if the user jumps from page 10 to page 100, the system knows that pages 11 through 99 aren’t needed yet, so it doesn’t request all the intervening documents. Instead, it “leaves gaps”. That way, the amount of memory occupied is reduced to the minimum. Then, if the user goes to page 50, the system requests the missing documents it needs to display that page.

And now it’s time to show you what you can do with this new functionality. Click here, open the file Movies.idp with Instant Developer 13.1, and have a look at what you can do. What do you think?

Are you already planning applications with an infinite interface?

  •    These day, an infinite interface is a must! We'll use this feature soon.
  •    Interesting technique, but the opportunity hasn't presented itself yet.
  •    I'm not interested in “Facebook style” interfaces; more consolidated UIs are better.
  •    I don't know, I've never thought about it.
Loading ... Loading ...

Image: sffoutpost

Leave a Comment

Previous post:

Next post: