New archive format issues
Hello, it was a bit surprising that ReportBuilder 20 has silently started to use a new format for its reports' archives. It broke my page merging code, but it wasn't so difficult to correct it. But I have an advice for record new type TppPageEntryRec64. The unit ppFilDev relies on quad word alignment. I would rather change the declaration to make sure it will be always compiled as expected:
TppPageEntryRec64 = record Position: Int64; AbsolutePageNo: Int32; Reserved: Int32; end;
Comments
- Below I pasted the Archiving section from the RB 20 New Feature list.
- I think its too late to change the record format, would break archives created with RB 20.
Archiving
---------
- new RAF file support > 4GB
- ArchiveDevice, write 64-bit page entries (new archives)
- ArchiveReader, check file signature and read 32 or 64 page entries
- ArchiveReader.ArchivePageCount
- return ArchivePageCount without calling Print (prop getter)
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
my changes won't change the format, it just ensures the record's size to be 16 bytes regardless settings of the compiler. The size of the current implementation of TppPageEntryRec64 is 12 bytes (= SizeOf(Int64)+SizeOf(Integer)) and is rounded to 16 bytes (last 4 bytes contain random values) just because the default record field alignment is Quad word {$A8}. But imagine the situation when someone will change the alignment to other value and will recompile Report Builder units from the source code. It will easily break the format of the archive. The "Reserved" field will ensure the size of the record will be always 16 bytes.
It's also a good practise to set the unnecessary bytes to zeros. It can avoid saving password fragments previously stored in the same memory location and also allows a slightly better compression ratio in case that the archive will be compressed.
Best regards, Igor
Your recommendations will be implemented and included in the next maintenance release.
Thanks for the excellent information.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com