Send unknown number of images to a report

Good afternoon everyone!


I was hoping someone would be able to help me with something I can't quite figure out in a report I'm trying to create.


I send a predefined number of images to reports now (logos, etc.), but I want to create a report that displays a list of pictures selected by the user along with a short description of each.


So, with this report, I have no way of knowing or predefining how many pictures will be sent to or included in the report. How can I send a List of pictures to a report?


Thank you very much for your help!

Comments

  • I am also creating a report that needs to include a variable number of images, so I am wondering if you were able to solve this question.

  • image is binary data, datatype = byte[]

  • stgstg
    edited 1:20PM

    Hello!

    There’s no need to create Image1 through ImageN parameters in the report! To display an arbitrary (unknown in advance) number of user-selected images with descriptions, pass them to the report as a data source (a list or DataTable) and place just one PictureObject + TextObject inside the DataBand:

    public record SelectedPhoto(string Description, byte[] ImageBytes);
    
    // ...
    
    report.RegisterData(selectedPhotos, «Images»);
    
    report.GetDataSource(«Images»).Enabled = true;
    
    // DataBand1.DataSource = Images;
    
    // Picture1.DataColumn = «Images.ImageBytes»; (или ImageLocation = путь)
    
    // Text1.Text = «[Images.Description]»;
    
This discussion has been closed.