Blazor WASM / Odata connection string

Stimulsoft Reports.BLAZOR discussion
Post Reply
mtabbu
Posts: 2
Joined: Fri Oct 11, 2024 8:26 am

Blazor WASM / Odata connection string

Post by mtabbu »

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:
TestReport.mrt
(10.55 KiB) Downloaded 192 times
Any help / suggestions would be greatly appreciated!
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: Blazor WASM / Odata connection string

Post by Lech Kulikowski »

Hello,

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
Screenshot 2024-10-11 175257.png (179.33 KiB) Viewed 13640 times
mtabbu
Posts: 2
Joined: Fri Oct 11, 2024 8:26 am

Re: Blazor WASM / Odata connection string

Post by mtabbu »

Hi lech, We're using blazor WASM not blazor server, can you try it on Blazor Server if it'll return the same results?
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: Blazor WASM / Odata connection string

Post by Lech Kulikowski »

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.
Post Reply