We're using Blazor Reports Viewer and trying to view the records come from the backend using odata. I'm retrieving the Database and Odatasource but the dataTable is null even though theres record on it.
The report is showing a data when i'm testing on the designer but just on the viewer it shows empty. This is my current implementation:
<StiBlazorViewer Report="@Report" />
@code {
StiReport? Report;
bool isLoaded = false;
protected override async Task OnInitializedAsync()
{
// Load the report
var report = StiReport.CreateNewReport();
var bytes = await Http.GetByteArrayAsync("..../reports/TestReport.mrt");
report.Load(bytes);
// Configure the data source
var odataConnection = report.Dictionary.Databases["OData2"] as StiODataDatabase;
if (odataConnection != null)
{
var t = odataConnection.CanEditConnectionString;
odataConnection.ConnectionString = $"..../odata;Token={SessionState.Authentication.AccessToken}";
odataConnection.Synchronize(report);
}
Report = report;
StateHasChanged();
await base.OnInitializedAsync();
}
}
here is my testing .mrt file:
Any help / suggestions would be greatly appreciated!
Blazor WASM / Odata connection string
-
- Posts: 7332
- Joined: Tue Mar 20, 2018 5:34 am
Re: Blazor WASM / Odata connection string
Hello,
We couldn't reproduce the issue. Please check samples:
https://github.com/stimulsoft/Samples-R ... zor-Server
Thank you.
We couldn't reproduce the issue. Please check samples:
https://github.com/stimulsoft/Samples-R ... zor-Server
Thank you.
- Attachments
-
- Screenshot 2024-10-11 175257.png (179.33 KiB) Viewed 13642 times
Re: Blazor WASM / Odata connection string
Hi lech, We're using blazor WASM not blazor server, can you try it on Blazor Server if it'll return the same results?
-
- Posts: 7332
- Joined: Tue Mar 20, 2018 5:34 am
Re: Blazor WASM / Odata connection string
Hello,
Unfortunately, at the current moment, it is supported in the server version.
In your case, you need to retrieve all data in your code and then provide it to the report as DataSet with RegData() method.
Thank you.
Unfortunately, at the current moment, it is supported in the server version.
In your case, you need to retrieve all data in your code and then provide it to the report as DataSet with RegData() method.
Thank you.