Loading images from a stream

I have asked this of tech support but not had a reply yet.

I need to load a graphic file into a picture object on each row/band of a report (there will be thousands of different pictures) I suspect that this might be doable using a stream, but as I havent got the pro version (yet) I can't experiment and as this is essential to my use of FR I need this answering before I purchase.

Will Fast Reports dfo this or do I need to look at Quick Reports/Crystal reports (or something else)?

Comments

  • edited 7:44AM
    ...
    I need to load a graphic file into a picture object on each row/band of a report (there will be thousands of different pictures) I suspect that this might be doable using a stream...
    IMO both Gordk and me gave you a complete answer.
    YES you can load a different file into a picture object for each row/band of your report.
    And you do not need to use a stream.
    You say I need to load a graphic file into a picture object and you can do it easily for each band in FR.

    If you are interested in how to do that exactly and what options are available - then read the whole topic with our answer >
  • gpigpi
    edited 7:44AM
    wrote:
    but as I havent got the pro version
    What edition of FR do you use?
  • Thanks for the answers - I had email notification turned on on the last thread and I never received notification of your last post until after I started this thread.

    I had looked at the manual pages and they were quite sparse and didnt help. I do not have the demo on my machine for some reaso, cant remember of there was an option to not install demos during the install process TBH.

    I am using the version bundled with Builder XE3 Pro

    I understand that this can be done by saving to a file, but in hindsight this is not ideal (although not a show stopper) so I'll have a think as to whether I purchase the full version.

    BTW I got a automatic reply from fast report at 0600 this morning (after asking my question yesterday early afternoon) they say they will get back to me within 2 days. Is their support usually this poor? I would have thought a question that was clearly labelled as pre sales would elicit a faster response.
  • edited 7:44AM
    Users of this forum say ticket service for FR customers is good - I think the same. My questions took them 2-3 days to answer.
    But decision (and its consequents) about to purchase or not belongs to you only.

    If you plan to use only FastReport script to fill Picture object with new contents then you must use LoadFromFile method.

    But as a programmer you may try Pascal (C++ or other) posibilites: TPicture is (probably) represented as a continous memory area. So you may write to that area using standard pointer operation from your Delphi code. Here you can find some advice from Delphi gurus, and maybe some of them had such an experience.

    If you don't install demo or don't try to test our suggestion then it may be difficult to make sure FR will satisfy your needs.

    PS.
    Read what technisoft said about XE version of FastReport in other topic.
  • gpigpi
    edited 7:44AM
    wrote:
    I am using the version bundled with Builder XE3 Pro
    FR Embarcadero edition doesn't support script
    So, you should use TfrxPictureView.FileLink property. Set it to [FileName] and use TfrxReport.OnGet Value event:
    procedure TForm1.frxReport1GetValue(const VarName: String;
      var Value: Variant);
    begin
         if VarName = 'FileName' then Value := 'C:\Test.bmp';
    end;
    
    or use TfrxReport.OnBefiorePrint event:
    procedure TForm1.frxReport1BeforePrint(Sender: TfrxReportComponent);
    begin
         if Sender.Name = 'Picture1' then
           TfrxPictureView(Sender).Picture.LoadFromFile('C:\Test.bmp');
    end;
    
  • thanks again all.

    I am still a little uncertain as to how this will work.

    I have looked at the example suggested and the manual at the pages suggested and it doesn't seem to show anything to do with scripting or at least there is nothing in the events tab for the picture or for the band.

    gpi - thank You for your example.

    I am assuming that for your example to work I would first need to save all of the different pictures to file (literally thousands in a lot of cases) each with a unique name. I also assume that within the event I can pick up on a field within the database that identifies what picture I need to specify in the beforeprint event?
    wrote:
    FR Embarcadero edition doesn't support script

    I was intending to purchase the Standard edition - but the purchasing wizard/order assistant is a little vague as if I select no to "end user design" (which I dont think I need) it directs me to the basic edition. I asssume from the feature dialog that I need standard?

    That said the feature matrix says that the standard edition does support script - getting confused.


    I couldnt find anything technisoft said regarding xe (used search by user name)



  • edited 7:44AM
    ...
    I couldnt find anything technisoft said regarding xe (used search by user name)
    Sorry, phrase "XE" wasn't used there.
    Have a look at this topic [post="27555"]Embarcadero FR[/post]
  • Thanks for the link Mick.

    I am just holding off upgrading until I am happy that the standard/pro version can do what I want. I might just need to bite the bullet and buy/code and see if the solution works well enough.

  • edited 7:44AM
    I am just holding off upgrading until I am happy that the standard/pro version can do what I want.
    You may download a demo version (not compiled one) - and probably you'll be able to compile some examples of your own.
    Ask someone about such a way of getting the knowlegde you need.
  • OK slightly different slant on my question.

    Once I have achieved the above, i.e. for each band a differnet picture is dynamically craeted, saved to disk and then loaded and displayed in the report.

    I then need to allow my users to create their own reports but to include my picture element with the above functionality but the complexity is hidden from them.

    Will Fast Reports allow me to do this?
  • edited February 2013
    Thanks for the link Mick.

    I am just holding off upgrading until I am happy that the standard/pro version can do what I want. I might just need to bite the bullet and buy/code and see if the solution works well enough.
    I don't think there is anything which one can do in another reporting tool and not in FR, albeit in a different way.
    I am astonished when I see what some people produce with FR, report layouts of a sophistication far beyond what I ever produced.

    However, IMO one must have access to scripts, that is where the real power of FR lies. Evaluating FR with a version without scripts will give a completely distorted idea about its capability. While we moan sometimes about FR support forever there are many users who changed from Rave or Quick reports and are glad they did so.

    You can probably get away with the standard version. On rare occasions I look at the source for which one needs Pro. If that is necessary then one can upgrade with little additional cost, I think (it used to be that way but I haven't checked now and the order page seems to be out of order ATM).
  • edited February 2013
    OK slightly different slant on my question.

    Once I have achieved the above, i.e. for each band a differnet picture is dynamically craeted, saved to disk and then loaded and displayed in the report.

    I then need to allow my users to create their own reports but to include my picture element with the above functionality but the complexity is hidden from them.

    Will Fast Reports allow me to do this?

    Hi,

    maybe the best option is custom components.
    I have 7 custom components and 9 custom functions defined.
    Components are especially to draw images (on components canvas) from some fields (ID-s) for each row.
    I have attached some examples. Only profile sections are images but from custom component linked to a field with profile code and drawn with Canvas.StretchDraw(). Windows and optimized vertical bars are drawn directly on component canvas too. In Capture3.png you can see automatically band resizing to adapt window dimensions. And I have many properties to draw something or not on window image, the drawing scale and maximum width or height on page.
    On last image you can see labels for optimized profiles cutting with marked profile on window image. And profile sections for rest. This is only for customers without label printer attached to cutting machine.
    Same reports I have made in Rave (custom components too) but FR is more flexible especially scripts.

    I created my custom functions especially to filter, sort, locate, set master-detail for my datasets from script. And other string and numeric functions like ReplaceStr() or IntToHex().

    Best Regards,
    Cristian Peta
  • gpigpi
    edited 7:44AM
    wrote:
    I am assuming that for your example to work I would first need to save all of the different pictures to file (literally thousands in a lot of cases) each with a unique name. I also assume that within the event I can pick up on a field within the database that identifies what picture I need to specify in the beforeprint event?
    You can use TfrxPictureView(Sender).Picture.Bitmap.LoadFromStream for stream usage
    For record identify you may use for example TfrxReport.Calc('<YourDatasetName."YourFieldName">')
  • edited 7:44AM
    wrote:
    You can use TfrxPictureView(Sender).Picture.Bitmap.LoadFromStream for stream usage
    Gpi,

    Is that TPicture.Bitmap property available only in compiler (Delphi, C++, otthers)?
    I can't find such a possibilty in FastReport script >
  • gpigpi
    edited 7:44AM
    wrote:
    Is that TPicture.Bitmap property available only in compiler (Delphi, C++, otthers)?
    Delphi and C++ only, no others
  • edited 7:44AM
    gpi wrote: »
    Delphi and C++ only, no others
    Thank you Gpi.
This discussion has been closed.