List records with variable number of images

9 posts, 0 answers
  1. Sergey
    Sergey avatar
    6 posts
    Member since:
    Mar 2014

    Posted 17 Mar 2014 Link to this post

    Hi guys,

    I have the following datatable where question/answer records grouped by group name and might have the optional multiple photos.

    Group    Question   Answer   Photo           PhotoIndex
    G1          Q1             A1           photo1.jpg  1
    G1          Q1             A1           photo2.jpg  2
    G1          Q1             A1           photo3.jpg  3
    G1          Q2             A2       
    G2          Q3             A3           photo4.jpg  1

    I would like to display the report where each question/answer record also shows the corresponding images just below it using cross-down approach (let's say 2 images per line):

    G1
    -----------------------------------
    Q1        A1
    -----------------------------------
    photo1.jpg   photo2.jpg
    photo3.jpg
    -----------------------------------
    Q2        A2
    -----------------------------------

    G2
    -----------------------------------
    Q3        A3
    -----------------------------------
    photo4.jpg
    -----------------------------------

    My approach was to use the List with two textboxes for question/answer and then placing the second List with the picturebox just below the question/answer textboxes. The first list was grouped by Fields.Group while for the picturebox list I was creating the row group with expression "Fields.PhotoIndex/2" and the column group "Fields.PhotoIndex%2" (following this post ).
    But the photos always displayed vertically.

    Any suggestions on how to achieve this layout, especially related to the images. There might be several images per question / answer record in my report, while some questions might have none.

    Thanks,
    Sergey. 
  2. Peter
    Admin
    Peter avatar
    1665 posts

    Posted 18 Mar 2014 Link to this post

    Hi,

    The approach you have used seems correct. The same approach is suggested in the How to: Create Multi-Column Report - Across the Page and Then Down KB article. Additionally you can review the ReportCatalog demo that came with your Telerik Reporting installation. Still we are not sure what is wrong on your side. Thus if you need additional assistance we will need a report that illustrates the unexpected behavior to review on our end.

    Regards,
    Peter
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. Sergey
    Sergey avatar
    6 posts
    Member since:
    Mar 2014

    Posted 18 Mar 2014 in reply to Peter Link to this post

    Hi Peter,

    Thanks for the link to the article, which helped me correctly set the static column groupings.
    My images are displaying ok now.
    But I have another problem.
    The question / answer grouping doesn't display all records for the group (see the attached screenshot).
    I have created the row grouping with expression "Fields.Group". What am I doing wrong?
    I will try to attach the source code as jpg (rename to SampleReport.zip).

    Thanks for your help,

    Sergey
  4. Peter
    Admin
    Peter avatar
    1665 posts

    Posted 19 Mar 2014 Link to this post

    Hello Sergey,

    For the required report layout our recommendation is to use report groups as shown in the attached sample. Give it a try and let us know if you have any additional questions.

    Regards,
    Peter
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  5. Sergey
    Sergey avatar
    6 posts
    Member since:
    Mar 2014

    Posted 19 Mar 2014 in reply to Peter Link to this post

    Hi Peter,

    That's what I need. Cool! Thanks for correction.

    One more thing to accomplish.
    In case the Question/Answer record has no images there is a white space gap left in place of the picturebox.
    How can I remove it?
    I guess I need to set the picturebox's height to 0 (or it's parent container?) if there is no image.
    What's the right way?

    Thanks,
    Sergey. 
  6. Peter
    Admin
    Peter avatar
    1665 posts

    Posted 20 Mar 2014 Link to this post

    Hi Sergey,

    In order to handle to collapse the container you have to add two Bindings. First to the List item:
    Property path   Expression
     Visible  =Fields.Photo is not null

    and another to the List item container - groupHeaderSection1
    Property path    Expression
    Height   ="0cm"

    For more information see: Collapse the container when hiding child report items KB article.

    Regards,
    Peter
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  7. Sergey
    Sergey avatar
    6 posts
    Member since:
    Mar 2014

    Posted 20 Mar 2014 in reply to Peter Link to this post

    Hi Peter,

    That works perfectly!

    Thanks for your help,

    Sergey.
  8. Software
    Software avatar
    11 posts
    Member since:
    Mar 2017

    Posted 20 Dec 2017 Link to this post

    Following the same Post, is it necessary to have MyDataIndex field in Serial.? Because I have data that is not coming in serially.. 
  9. Katia
    Admin
    Katia avatar
    693 posts

    Posted 02 Jan 2018 Link to this post

    Hi,

    The approach for creating multi column layout where the data flows horizontally requires a data field that holds the index of the row to be present in the data source. This index needs to be used in grouping expressions for the List item so the required number of columns could be generated.


    Regards,
    Katia
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top