Embedded images in reports saved in DFM

LurkingKiwiLurkingKiwi Wellington, New Zealand
edited 6:58AM in FastReport VCL
I'm using FR5 VCL in Delphi XE, and have a number of reports saved in the DFMs which have embedded images for backgrounds, logos in MemoViews, borders etc.
I save my DFMs as text because in version control I can see the changes to the components.
However, it's disconcerting to see large numbers of changed bytes in the embedded image data in the report objects when the report has only been opened to change an unrelated field, or possibly only to look.

Is anybody using FR6 VCL in the same way? Can you confirm whether the same unexpected changes occur?

I can't remember if something similar has been posted before, but the forum won't let me search for DFM as it's too short!

Comments

  • edited 6:58AM
    I think it's better to put the report as file in project resources and load with TResourceStream into the FastReport.
    Add the report file into resources from IDE menu Project->Resources and Images.
    Then:
      strm := TResourceStream.Create(HInstance, 'Report.fr3', RT_RCDATA);
      try
        frxReport1.LoadFromStream(strm);
      finally
        strm.Free;
      end;
    
  • PolomintPolomint Australia
    edited February 2019
    Is anybody using FR6 VCL in the same way? Can you confirm whether the same unexpected changes occur?
    G'day K1w1,

    We are not doing exactly what I understand you require, but...

    We have a number of FRv6.2.16 Reports that indirectly display TeeChart graphics through the device of a "Picture" Component that is populated in code. They all follow the same Template: the FR3 includes a graphic element called Icon.Data, and the FR3 is saved in the DFM file.

    And that graphic element in multiple Reports does inexplicably change when the Form is saved, for any reason, even though the Icon "placeholder", for the Chart Picture, itself should not have changed. A BCompare of a number of Form DFM and their earlier versions shows considerable difference although "eyeballing" the Icons suggests they are identical.

    I hadn't noticed this behaviour before. Thanks for bringing it to my attention(!)

    Cheers, Paul
  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited 6:58AM
    Peta wrote: »
    I think it's better to put the report as file in project resources and load with TResourceStream into the FastReport.
    Add the report file into resources from IDE menu Project->Resources and Images.

    Thanks Peta, I had been considering doing that, but hoped the behaviour was fixed in V6!
    I use UserDataSets, so I can't preview the reports in the IDE anyway therefore an external editor isn't a big hit.
    It's just inertia :-)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.