Get report from dotnet API

Stimulsoft Reports.WPF discussion
Post Reply
mgomez
Posts: 10
Joined: Wed Jun 05, 2024 11:24 am

Get report from dotnet API

Post by mgomez »

Hello everyone,

I have a very simple WPF application which uses a StiWpfViewerControl to load a report in a xaml screen:
Sc2.jpg
Sc2.jpg (51.85 KiB) Viewed 14102 times
I want to be able to get the report file from an API like it's made for an Angular application:
Sc1.jpg
Sc1.jpg (190.38 KiB) Viewed 14102 times
What's the object and the method I'd have to use instead of StiAngularView.GetReportResult?

Thank you in advance
mgomez
Posts: 10
Joined: Wed Jun 05, 2024 11:24 am

Re: Get report from dotnet API

Post by mgomez »

Hello again,

Finally, I have found a solution for the question in this thread. In the API you have to return the report like this:

Code: Select all

return report.SaveToString();
in the WPF application you have to retrieve the report like this:

Code: Select all

report.LoadFromString(await result.ReadAsStringAsync());
"result" is the Content value from the httpClient call response (HttpContent type)

Thanks anywhere.
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: Get report from dotnet API

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply