Request Win UI3 Example with Binding ObjectDataSource

1 Answer 24 Views
Miscellaneous Telerik Trainer
Krishna Prasad
Top achievements
Rank 1
Krishna Prasad asked on 05 Jan 2024, 01:57 PM

Hi ,

We are evaluating Telerik Reporting for our .NET 8 ERP application.

Could you please provide Win UI3 Example with Binding ObjectDataSource where Report is embedded in to the winui3 sample and bind local dto object and render also locally .

We tried from our end but  unable to use  binding ObjectDataSource.

We have attached sample for your reference.

 

 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 10 Jan 2024, 12:40 PM

Hi Krishna,

Thank you for your interest in our products.

I appreciate the attached project. It demonstrates the approach and I was able to modify it so that it can respect an ObjectDataSoure with the following minimal changes. Note that since I don't have your data source assembly locally, I created a custom data source class in the project.

  • In the Report definition 'SalesOrder.trdx': Add report items that display the fields of the ObjectDataSource.
  • In the 'appsettings.json', the "telerikReporting" section is currently in the "ConnectionStrings" section and you need to take it out of there and put it as a main section to be respected.
  • The code should be working as it is, provided your DataMember 'GetCompany' is parameterless and returns the proper collection of fields or business objects.

Here is a link to a muted video on how this worked locally. Note that I used an ObjectDataSource with a parameter to demonstrate how you may use such an approach. In the general case, you may bind the value of the data source parameter to a Report Parameter - see Using Parameters with the ObjectDataSource Component.

I have attached also the modified project with my changes.

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/.
Krishna Prasad
Top achievements
Rank 1
commented on 19 Jan 2024, 03:30 PM

Dear Todor,

We appreciate the changes you made to facilitate the binding of the list object to the report, and now we are looking to extend this functionality for Master and Details scenarios (SalesOrder as Bind the data).


Here's an example of our SalesOrder business object structure:

public class SalesOrder
{
    public int SalesOrderNo { get; set; }
    public DateTime SODate { get; set; }
    public decimal DecimalAmt { get; set; }
    public List<SalesOrderItem> SalesOrderItems { get; set; }
}

public class SalesOrderItem
{
    public int ItemID { get; set; }
    public string SKU { get; set; }
    public decimal Price { get; set; }
}

We would greatly appreciate it if you could guide us on how to effectively bind the SalesOrder model with its associated SalesOrderItems to a Telerik Report in same sample.

Thank you in advance for your assistance. We look forward to your guidance on this matter.

Best Regards,
Todor
Telerik team
commented on 24 Jan 2024, 08:13 AM

Thank you for elaborating on your scenario.

I confirm that it is relatively easy to bind the complex object 'List<SalesOrderItem> SalesOrderItems' to another data item, where the detailed inner data may be displayed.

For more details, I suggest the following articles:

Tags
Miscellaneous Telerik Trainer
Asked by
Krishna Prasad
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or