I'm testing Syncfusion components and I'm loving it! But i'm getting the following error when trying to display a report using OData data source:
I came to the conclusion that maybe i need to add the OData datasource as an extension, but how do i do that in WPF? In Blazor i can do this:
ReportConfig.DefaultSettings = new ReportSettings().RegisterExtensions(new List<string> { "BoldReports.Data.WebData" });
But how do I do this in WPF?
My code in WPF:
MainWindow.xaml
<Window
...
Loaded="Window_Loaded">
<Grid>
<syncfusion:ReportViewer xmlns:syncfusion="clr-namespace:BoldReports.UI.Xaml;assembly=BoldReports.Wpf" Name="reportViewer" />
</Grid>
</Window>
MainWindow.xaml.cs
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.reportViewer.ReportPath = @"MyReport.rdl";
this.reportViewer.RefreshReport();
}
Hi Mateus,
Thanks for contacting Bold Reports support.
Yes, you are correct. You have to add the extension for using the ODATA report in the WPF viewer. We don't have nuget for WPF applications. We will provide the extension project to meet your requirements. Meanwhile, could you please confirm whether you are using WPF ASP.NET or the.NET CORE framework?
Regards,
Manoranjan R
I'm using WPF .NET Core Framework (WPF .NET 6).
Thank you for your attention!
Hi Mateus,
Thanks for the update.
We will prepare and share the sample for this on or before July 27, 2022.
Regards,
Manoranjan R
Hi Mateus,
We prepared and attached the sample for loading the ODATA report in the WPF NET Core application. Please check and share the details.
Sample Details:
Add the ODATA extension project to your application.
Add the below code in your app.confiq file.
<configuration> <configSections> <section name="ReportingExtensions" type="BoldReports.Configuration.Extensions, BoldReports.WPF" allowLocation="true" allowDefinition="Everywhere" /> </configSections> <ReportingExtensions> <DataExtension> <Extension Name="OData" Assembly="BoldReports.Data.WebData" Type="BoldReports.Data.WebData.ODataExtension" /> <Extension Name="WebAPI" Assembly="BoldReports.Data.WebData" Type="BoldReports.Data.WebData.WebAPIExtension" /> <Extension Name="JSON" Assembly="BoldReports.Data.WebData" Type="BoldReports.Data.WebData.JSONExtension" /> </DataExtension> </ReportingExtensions> </configuration> |
Regards,
Manoranjan R
Hi Mateus,
Thanks for the update.
We are glad to hear that the reported issue has been resolved on your end. If you face any other issues, we suggest you open a new ticket using your account.
https://support.boldreports.com/create
Regards,
Manoranjan R