Hi guys
I created a small Blazor WebAssembly (ASP.NET Core hosted) application to test out your ReportViewer. I have a Razor page with the following code:
@page "/"
@using Telerik.ReportViewer.Blazor
<style>
.trv-report-viewer {
width: 1300px;
height: 880px;
}
</style>
<button type="button" @onclick="LoadReport">Load Report</button>
<ReportViewer @ref="reportViewer1"
ViewerId="rv1"
ServiceUrl="/api/reports/"
ScaleMode="@(ScaleMode.Specific)"
Scale="1.0"
ViewMode="@(ViewMode.Interactive)"
EnableAccessibility="true"/>
@code {
ReportViewer reportViewer1;
Dictionary<string, object> parameters;
private async void LoadReport()
{
parameters = new Dictionary<string, object>()
{
{ "TextboxValue", "My Testvalue" }
};
reportViewer1.ReportSource = new ReportSourceOptions()
{
Report = "TestReport.trdp",
Parameters = parameters
};
await reportViewer1.RefreshReportAsync();
}
}
In my project I added a folder "Reports" to the .Server project and created a sample Report called "TestReport.trdp" using the Telerik Report Designer application. For the report I created a parameter named "TextboxValue" which I'm setting in the code above.
I also added this code snippet to my Server's Program.cs:
builder.Services.TryAddSingleton<IReportServiceConfiguration>(sp => new ReportServiceConfiguration
{
ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
HostAppId = "ReportingTest.Server",
Storage = new FileStorage(),
ReportSourceResolver = new TypeReportSourceResolver().AddFallbackResolver(new UriReportSourceResolver(reportsPath))
});
The application runs ok, no errors. But when I hit the "Load Report" button, it simply shows "No report" in the ReportViewer. Can you guys see what I'm missing or what I'm doing wrong? I uploaded my sample application for you to better see behind my code. Since the file size is bigger than 20MB, I had to upload it to another website where you can download it. See this link: https://we.tl/t-9FKRVgpdmh (the link expires after seven days).
Best Regards,
Roman