Loading of content into odt after it was generated

161 views
Skip to first unread message

unlex

unread,
Aug 4, 2011, 7:40:33 AM8/4/11
to jodreports-users
JODReports 2.4.0
OS Linux Mint 9

I generate odt with JODReports. After the generation it should have 95
pages. But, when I open the generated document it has only 87 pages.
After a couple of seconds the document starts growing, content and
page numbers are increasing until it has 95 of pages. This process
takes about 5 seconds to complete. It's very strange and this cause
the next problem: when I try to convert the generated odt into PDF
with JODConverter the PDF also has only 87 pages instead of 95. It
seems JODConverter starts conversion before all content is loaded into
odt when it's opened.
Could you help anyway? Thanks

Ansgar Konermann

unread,
Aug 4, 2011, 3:27:55 PM8/4/11
to jodrepor...@googlegroups.com
Hi unlex,

sorry JODReports isn't working as expected for you.

I'd like to reproduce the problem and look into it. Can you provide me
with a test case which demonstrates the erroneous behaviour, like a
stripped-down Java unit test generating the 95 pages document?

Best regards

Ansgar

unlex

unread,
Aug 5, 2011, 8:36:35 AM8/5/11
to jodreports-users
> Hi unlex,
>
> sorry JODReports isn't working as expected for you.
>
> I'd like to reproduce the problem and look into it. Can you provide me
> with a test case which demonstrates the erroneous behaviour, like a
> stripped-down Java unit test generating the 95 pages document?
>
> Best regards
>
> Ansgar

You can try with the very simple example:
1. Create empty odt document which will serve as the template for
JODReports
2. Fill the document with 15 pages of sample text, just something like
'text text text...'
3. Insert the following JOOScript at the very beginning of the
document: [#if false]
4. Insert the following JOOScript at the very end of the page 2: [/
#if]
5. Clear all formatting not to have any unclosed tags (that point in
fact is the separate topic of discussion)
6. Use JODReports to generate new document basing on this template.
7. Open the generated document.

You should see 11 pages. After a number of seconds the number will
increase to 15.

8. Add a space or something in this document and save it.
9. Open document again.

You will see all 15 pages at once.

Any workaround I was able to find is to open the generated document
using OpenOffice API having OpenOffice run as a service NOT in -
headless and save it.

Am I doing anything wrong with JODReports?
Message has been deleted

unlex

unread,
Aug 5, 2011, 8:43:24 AM8/5/11
to jodreports-users
> 2. Fill the document with 15 pages of sample text, just something like
> 'text text text...'

Sorry, the initial document should have 17 pages and not 15 to repeat
everything that was described in the example.

Ansgar Konermann

unread,
Aug 5, 2011, 12:13:16 PM8/5/11
to jodrepor...@googlegroups.com
Am 05.08.2011 14:36, schrieb unlex:
> You can try with the very simple example:
> [...]
Okay, will try tonight.

l8r.

Ansgar

Ansgar Konermann

unread,
Aug 5, 2011, 5:34:27 PM8/5/11
to jodrepor...@googlegroups.com
Am 04.08.2011 13:40, schrieb unlex:
Hi unlex,

I tried to reproduce this behaviour using your receipe.

I created a document template with as much as 264 pages, all containing
"abc abc ...". I created a number of quite lengthy paragraphs (12 lines
each) and copy/pasted them until I got 264 pages.

I put [#if false] at the very beginning of page 1 and [/#if] somewhere
at the beginning of page 15.

After generating the document instance, I get a document with 251 (!)
pages. The whole process of opening the document takes around 3 seconds.
No main window is updated during this time, I can see a grey rectangle
during this time. There is no increasing number of pages. After the
first full drawing of the main window, I can see the "251 pages" figure
in the status bar at the bottom. I use OpenOffice 3.1.1 on Linux
(Core2Duo T9300 2,5 GHz, 4 GB RAM).

If I press CTRL+END, the cursor jumps to the end of the document and the
number of pages is corrected to 250 (!).

So I suspect the whole issue might have to do with re-pagination after
the generated document is opened. This might take a few seconds on
slower hardware.

I also converted the 250 pages ODT file into PDF using JODConvert. This
really took a while to finish, like 30 seconds or so with nearly 100%
CPU. But the result is all good: exactly 250 pages.

Can you give some more details on:
- the hardware (CPU, RAM) you are using to open the 95 pages document
and to convert this to pdf.
- the version of OpenOffice / LibreOffice you are using?

Thanks in advance

Ansgar


Dmitry Burlea

unread,
Aug 8, 2011, 8:45:38 AM8/8/11
to jodrepor...@googlegroups.com
> Hi unlex,
> I tried to reproduce this behaviour using your receipe.
> ...
> Can you give some more details on:
> - the hardware (CPU, RAM) you are using to open the 95 pages document
> and to convert this to pdf.
> - the version of OpenOffice / LibreOffice you are using?
> Thanks in advance
> Ansgar


Dual-Core E5200 @ 2.5 GHz
3.2 Gb RAM

I found that it depends on the document format. I attach the archive with the document template I used the last time and the code used for generation.
Document has 60 pages, should show 49 with the [if] statement, but shows only 30 and starts to increase till 49 after a while.

Thanks for your replies!
jodreports_test.zip

Ansgar Konermann

unread,
Aug 8, 2011, 3:41:16 PM8/8/11
to jodreports-users
Hi unlex,

thanks for your test code. I tried it and could in fact reproduce the
behaviour you describe. I got exactly the same numbers (30 pages at
initial opening of generated document, increasing to 49 pages after a
while).

I'm quite sure it is related to re-pagination. What I did in addition
was to switch from print layout to online/web layout. guess what
happens: the number of pages starts to *decrease* until it reaches *1*
after a while.

After switching back to print layout, it takes a few moments and the
page number goes up to 49 again. It seems to be normal behaviour for a
word processing application to do re-pagination in the background.

I also tried to convert the test_missing_pages_output.odt file to PDF.
The output contained 49 pages, as it should be. Regarding PDF
conversion I'm not able to reproduce the behaviour you describe.

Hope this helps a bit.

Best regards

Ansgar
>  jodreports_test.zip
> 72KAnzeigenHerunterladen
Reply all
Reply to author
Forward
0 new messages