Combine pre-defined and auto-generated columns from nested array property in crosstab.

1 Answer 67 Views
Binding CrossTab DataSource WebService Grouping Report Designer - Web
Lennert
Top achievements
Rank 2
Iron
Iron
Lennert asked on 12 Feb 2024, 09:22 AM

Hi,
We are looking for a way to display the following data in a crosstab. The data comes from a webservice datasource.
Each row represents an object of the following JobDto class with some pre-defined properties and an array of metadata.

public class JobDto

{
    public string Id { get; set; }
    public string Name { get; set; }
    public int Number { get; set; }
    public string Type { get; set; }
    public string Status { get; set; }            
    public MetadataDto[] Metadata { get; set; } = Array.Empty<MetadataDto>();
}

public class MetadataDto
{
    public string Name { get; set; }
    public string Value { get; set; }
}

How can we display first the fixed properties as pre-defined columns, followed by each metadata item from the array as auto-generated columns? We are primarily using the Web report designer.

Kind regards,

Lennert

1 Answer, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 15 Feb 2024, 06:35 AM

Hi Lennert,

You need to use nested data items.

For example, you may use Table as the main data item that would have JobDto as DataSource. You may display the fixed properties as static columns. See Table Cells, Rows, and Columns for more details.

The Metadata is a list of business objects and may be assigned as DataSource to a Crosstab nested in the main Table with Bindings. The Crosstab may generate automatically columns based on the column grouping - see Overview of the Crosstab Areas for additional information.

Regards,
Todor
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
Binding CrossTab DataSource WebService Grouping Report Designer - Web
Asked by
Lennert
Top achievements
Rank 2
Iron
Iron
Answers by
Todor
Telerik team
Share this question
or