I'm trying to use Stimulsoft for Blazor:
-I've created an empty Blazor WebAssembly App (ASP.NET Core Hosted) .NET 5
-in Client project I've added Stimulsoft.Reports.Blazor package
- from https://github.com/stimulsoft/Samples-B ... n%20viewerI copy wwwroot/Reports/TwoSimpleLists.mrt and to my wwwroot project folder
also replaced my Index.razor page with that one from example
Code: Select all
@page "/"
@using Stimulsoft.Base
@using Stimulsoft.Report
@using Stimulsoft.Report.Blazor
@inject HttpClient Http
<!--Report viewer-->
<StiBlazorViewer Report="@report" />
@code
{
//Report object to use in viewer
private StiReport report;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
//Init base font
var fontBase64 = "...";
StiFontCollection.AddFontBase64(fontBase64, "Segoe UI");
//Create empty report object
report = new StiReport();
//Load report template
var reportBytes = await Http.GetByteArrayAsync("Reports/TwoSimpleLists.mrt");
report.Load(reportBytes);
}
}
seems that report file(TwoSimpleLists.mrt) is not found,but the file exists in wwwroot\ReportsFailed to load resource: the server responded with a status of 404 () :44396/Reports/TwoSimpleLists.mrt:1
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Response status code does not indicate success: 404 (Not Found).
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at System.Net.Http.HttpClient.GetByteArrayAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
at WebApplication2.Client.Pages.Index.OnInitializedAsync() in C:\Users\user\source\repos\WebApplication2\WebApplication2\Client\Pages\Index.razor:line 32
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
d.printErr @ blazor.webassembly.js:1
what have I done wrong
thanks