Page 1 of 1

Get report from dotnet API

Posted: Wed Sep 25, 2024 6:39 am
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 14244 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 14244 times
What's the object and the method I'd have to use instead of StiAngularView.GetReportResult?

Thank you in advance

Re: Get report from dotnet API

Posted: Wed Sep 25, 2024 11:29 am
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.

Re: Get report from dotnet API

Posted: Thu Sep 26, 2024 7:47 am
by Lech Kulikowski
Hello,

Thank you for the information.