Adding images to a multi column band from code

edited 12:58AM in FastReport 3.0
Hi

I have a report that has its data added only through code, I have a list of images and need to add them to the last page of the report.

The images will be displayed in 3 columns and as many rows as required. I have set up a band with 3 columns and now need to programaticaly add the images. I have an image component on the first column, so how do I add the images sequentally?

TIA

Phil

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 12:58AM
    Use the loadfromfile or assignfromfile methods, either take a string in the form of 'path&filename'.
    decide wether to use an frxuserdatset to control the band movement, or to just set
    the rowcount property of the band,(number of times it needs to repeat).
    either way the rowcount prop will be the count of your list.
    decide if you want to work entirely at delphi level using obp event or ongetvalue event of the report component or internal or both.
    either way you will need to track where you are in your list.

    working in delphi
    code to load report
    use find object method to find the band and set its rowcount property
    code to call or show report
    using the obp event
    begin
    var myindex:
    if sender.name ='Picture1' then
    begin
    myindex := int(tfrxpictureview(sender).tagstr);
    tfrxpictureview(sender).picture.loadfromfile((mylist(myindex).text));
    end;
    end;
    in the obp of the band in the report
    set the tagstring value of the pictureview to the line variable value
    this is just one of many ways depending upon what you decide.

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.