TfrxPictureView memory usage
Hi,
If I place a TfrxPictureView object with a static picture on a data band and the band repeats many times, generating the report uses a huge amount of memory.
It appears that FR is duplicating the entire image object, instead of just reusing the same image and duplicating the reference to it. Is there some way I can force it to reuse the same image data instead of making copies of it for every band?
Thanks,
Pierre
If I place a TfrxPictureView object with a static picture on a data band and the band repeats many times, generating the report uses a huge amount of memory.
It appears that FR is duplicating the entire image object, instead of just reusing the same image and duplicating the reference to it. Is there some way I can force it to reuse the same image data instead of making copies of it for every band?
Thanks,
Pierre
Comments
- create an empty report;
- put a TfrxPictureView on the databand;
- load a picture into it;
- set databand.RowCount to 1000 to repeat it 1000 times;
- run the report.
You will see the report generates immediately and takes a little amount of memory.
Thanks for looking into this. You have to preview the report and step through the pages. I did the same thing as you - image on a band repeated 1000 times. I then stepped through the preview one page at a time and got this error on page 11:
Debugger Exception Notification
Project Project1.exe raised exception class EOSError with message 'System Error. Code: 8.
Not enough storage is available to process this command'.
Break Continue Help
It was a large image (4MB), but it happens with smaller images as well - it just takes more pages. I tried the UseFileCache option but it didn't help.
I assume it is caching preview pages or something like that. Is there a way I can force it to cache less pages to prevent this kind of problem?
Thanks,
Pierre
+ added TfrxReport.PreviewOptions.PagesInCache property
Yes, I agree - that will be a very useful option to have.
Thanks,
Pierre