fralx / LimeReport

Report generator for Qt Framework
http://limereport.ru/
Other
403 stars 154 forks source link

Pages of the report are printed in reverse order #275

Closed silverhawk89 closed 4 years ago

silverhawk89 commented 4 years ago

Hi. I have a report made entirely with my own variables in the form V{variable1}. The report has two pages with variables numbered from 1 to 25 on the first page and from 26 to 50 on the second page. When I set all the variables from 1 to 50 and try to print from my program, I get the pages in the reverse order, first the page from 26 to 50 in the report preview. how can i fix the problem?

fralx commented 4 years ago

Hi, could you send me a sample?

silverhawk89 commented 4 years ago

Here is an example example.zip

fralx commented 4 years ago

Hi! I have looked thought your report and found out that you marked the second page as TOC.

TOC

TOC is a Table Of Contents and it placed before other pages.
Can I ask you why you using variables instead of a datasource? As I can see the report data is rather homogeneous, why you don't use the report band to render the data? If you using the bands, it significantly reduces the report's loading time and memory usage.

silverhawk89 commented 4 years ago

Because much of the data is calculated in the moment and depends on each other. Which makes it very difficult for me to directly extract the information from the database and into the report band. Thanks for the help. It solved my problem.

fralx commented 4 years ago

I would like to suggest you watch at CallbackDatasource. Using CallbackDatasource you can prepare all data on the application side and render it via data bands.

silverhawk89 commented 4 years ago

Thanks i'll try to do what you say.

silverhawk89 commented 4 years ago

Hi @fralx here we are again :) I tried what you suggested to me about using CallbackDatasource, but I have some doubts. The example I sent you was a small sample of my report and I imagine that is why you couldn't see the biggest problem I have. Normally in the samples you show, the data has a fixed length of columns and the rows grow arbitrarily depending on the amount of data obtained from the data source, dividing it into several pages. In my report it is a list of materials with a number of rows that can vary but only between 1 and 50 elements, while the columns contain an unknown number of outputs of these materials that must be divided into several pages. In other words, my report grows horizontally keeping the first column as a vertical header. This type of report can be achieved using CallbackDatasource ?. In that case could you show me a little example to use as a guide? I attach an example with two pages more than the previous one so that you can get an idea of ​​how my report looks and works. I hope you have a little time to spend on helping me. Example.zip

fralx commented 4 years ago

Hi. Ooo I see. In your case, the crosstable would be the best solution, but the limereport doesn't support it yet.
CallbackDatasource can return varied columns count because only you deciding how many columns it should return. Horizontal splitting could be a problem but limereport can split pages horizontally if it prints pages on the printer.