PNG image is not printed when converting from RB14 to RB19

Hi,

Strange thing. Reports are created in RB14.08. Application is compiled with Delphi 2007. Reports are stored in the database.
As addon an application is created using RB19.04 and Delphi 10.1 Berlin.
When a report that contains a PNG image is printed using the RB19 app (and created with the RB14,D2007 app), this image is not shown.

In D2007 I use the PNG classes from DevExpress. In D10.1 I don't have DevExpress installed and thought the default TPNGImage would handle this but it doensn't.

Printing an report with png created in RB19 and printed with the same version is working fine.

How can this be solved?
Kind regards,

Jeroen Röttink
JR-soft software solutions

Comments

  • Hi Jeroen,

    You'll need to edit the old templates as text and replace the DevEx PNG class name with the Delphi PNG class name.




    Best regards,

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

    But the Picture.Data property seems encoded. It starts with

    object ppImage1: TppImage
    UserName = 'Image1'
    AlignHorizontal = ahCenter
    AlignVertical = avCenter
    MaintainAspectRatio = True
    Stretch = True
    Transparent = True
    Picture.Data = {
    0B546478504E47496D61676589504E470D0A1A0A0000000D494844520000041E
    0000019108020000004D1AE7CE000000017352474200AECE1CE9000000046741
    4D410000B18F0BFC6105000000206348524D00007A26000080840000FA000000
    80E8000075300000EA6000003A98000017709CBA513C00000009704859730000
    0EC000000EC0016AD6890900006EEF49444154785EEDBD3BB227B7D1A7CDF1C6
    EB25F4127A0974C6EF25F4127A095C424FBC16BD33963C453BF46830E8D1EBEF
    73E829DA91C531188C97122F12A5C9A362944AFFAA4A24804C5CAA9E13C7204F
    A370791240E5AF9000FEC73FFFF9CF4FF88100042000010840000210B83A817F
    FCDFFFEFD7FFFF7FFFCFFFF57FAEDE50DAD78F80480B7E200001084000021080
    00042E4FE0A72FDFFCF77F7DF2DB0F1F2FDF521AD88BC027BD0AA65C08400002
    108000042000816604445188AE90DF5FBEF9AC59A114743702488BBB599CF642
    00021080000420704702A2281669F1E3E72FFEF1F3F77744409BE309202DE219
    5302042000010840000210E84A40B484288A455AB070D1D514172F1C69717103
    D33C084000021080000420F0EB8777ABAE785EB8787A0913084410405A445025
    4F084000021080000420301001D1125B6921FFFDEBB74F03D58FAA5C8500D2E2
    2A96A41D108000042000010840E08880A888075DC1C2053D258800D222082CD9
    420002108000042000812108FCF58F9FEEA585FCE5EF7FFE6A88FA51890B1140
    5A5CC8983405021080000420000108FC2701D10F87BA42FE2892035A10F02580
    B4F0E5496E108000042000010840602002CB357967BF2C5C0C64AA4B54056971
    0933D208084000021080000420B023B05E9377262D4478800D028E0490168E30
    I send an example to support@
    Kind regards,

    Jeroen Röttink
    JR-soft software solutions
  • edited August 2019
    Hi Jeroen,

    RB relies upon Delphi TPicture.

    I reviewed the Delphi TPicture source code. It contains logic to write Picture.Data as an internal binary property. The logic writes the graphic ClassName followed by image stream. So not a flexible solution. They should have written the file extension followed by image stream.

    Here's a work around...


    // Define class alias

    type
    TdxPNGImage = class(TPngImage);

    // And in the unit initialization section register it like this

    initialization
    TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics', TdxPNGImage);

    Update: I found the sample .rtm you emailed to support@ and the above code works.

    Best regards,

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

    Thanks for the nice work around. It works perfect!
    Kind regards,

    Jeroen Röttink
    JR-soft software solutions
Sign In or Register to comment.