Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

TppReportExplorer (Delphi Rio) and templates created in Delphi 5

Hi,

The problem is related to TppReportExplorer
We using ReportBuilder Enterprise 20.02 (Build 67) + Delphi 10.3 (Update 3)

The templates created in this version work fine.
But templates created in the old version cannot be opened (encoding and stream errors).
Old version is "ReportBuilder Enterprise 6 for Delphi 5"

It looks like the problem is related to changes in Delphi own classes TReader\TWriter

Comments

  • Hi Maxim,

    What data access components are you using - BDE, ADO, other?

    What database engine?

    What is the rbItem template field data type as defined in the database table?

    For the TDataSet descendant accessing the template field, what is the TField class type defined in the Delphi TFieldsEditor for the dataset?




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi Nard,

    1) Data access implemented by TADOQuery
    2) DB is MSSQL (few versions, now testing on 13.0.1601.5)
    3) Template field is defined as "[Template] [ntext] NULL"
    4) There are no predefined fields for the DataSet, but in runtime automatically created TWideMemoField for modern version (Rio) and TMemoField for Delphi 5.

    Hope it helps.
  • Hi Maximum,

    Try a test in Delphi 5 and Delphi 10.3. Connect a DBMemo to the rbItem table. Does the Template field contain text or binary. (RB can store templates as binary or text).

    SQL Server docs specify NText is Unicode String

    Delphi 5 TMemoField is AnsiString

    Delphi 10.3 TWideMemoField is UnicodeString. For Delphi 10.3 you could try manually adding the TField objects at design-time and define the field as TMemoField.



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi again, Nard.

    Yes, Delphi 5 templates saved as binary.
    I already tried to create TMemoField manually. But I afraid, it works totally same.

    While TReader load properties of template, one by one, it works fine until PrinterSetup.mmMarginBottom. And next property PrinterSetup.mmMarginLeft it read with shift -1.

    Part of template:
    PrinterSetup.mmMarginBottom#$03#$CE#$98#$19PrinterSetup.mmMarginLeft
  • Hi Maximum,

    Next test :smile:

    Use Delphi 5 to save the report to file. Save to file as binary and to a second file as text.

    Use Delphi 10.3 to open each file.

    Does that work?




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • 1) I saved Delphi 5 template as RTM (binary and text) and I can open it in Delphi Rio version without errors (both formats)
    2) I double-checked case with TMemoField instead of TWideMemoField. This does not solve the problem, as I said earlier.
    3) Then I tried with TBlobField. And in this case I can open Delphi 5 templates in Delphi Rio Version.
    But. If I try to save the template, then later it cannot be opened in both versions ("Invalid template format" error).
  • Hi Maxim,

    - RB 20 saves properties introduced to support features that are not present in RB 6. RB 6 cannot open templates because it does not recognize the properties. (Delphi works the same way)

    - The issue here is that binary templates should be stored to blob field. RB installs example SQL scripts for each database. For SQL Server, the script defines rbItem table with 'image' data type for the template field.


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
Sign In or Register to comment.