Page 1 of 1

How do I pull data from a web query using other data returned from SQL?

Posted: Wed Jul 03, 2024 1:08 am
by DavidLee82
I'm new to using Stimulsoft reports and I need help with finding out how to go about with a project.

So I have this report that I need to create that involves a table of six columns. Five of the columns come from a direct Azure SQL query, that I have no problem with. However, for one specific field, I have to go through a convoluted process to get data from two specific columns from the row in the query, pass it to a webAPI service, and put the result in the sixth column.

For example, I have a SQL query that takes a file name for it's perimeter and returns a carton code, update date, location, job number and status for the report. These five columns in the report goes into a 6 column table. For the last column however, I need to pass the carton code and file name to a web API and display the result.

Is it possible to do this? If yes, how do I achieve that?

Re: How do I pull data from a web query using other data returned from SQL?

Posted: Wed Jul 03, 2024 9:20 pm
by Lech Kulikowski
Hello,

You can retrieve your data in the code and then provide it to the report, or try to implement your own data adapter with all necessary requests.

Thank you.

Re: How do I pull data from a web query using other data returned from SQL?

Posted: Thu Jul 04, 2024 1:00 am
by DavidLee82
Ok, noted.

I actually figured out a method later in the day. Since the web query returned JSON results, I used a subreport that used a JSON data adapter and included the subreport in the main report with the main report passing the two columns as parameters to the subreport.

Now I have a different question: Is there any way I can combine the subreport into the main report without breaking it? I tried combining the two reports and found that the json data source became broken and kept pulling the first line of the data over and over. It looks as if the subreport executed just once and then just copy-pasted the first result into all the pages.

Re: How do I pull data from a web query using other data returned from SQL?

Posted: Fri Jul 05, 2024 12:39 pm
by Lech Kulikowski
Hello,

Could you send your report template for analysis?

Thank you.

Re: How do I pull data from a web query using other data returned from SQL?

Posted: Mon Jul 22, 2024 1:03 am
by DavidLee82
Never mind, In the end I rewrote the entire JSON API so it does all the heavy lifting before sending everything to the report. Eventually realized that it's the smartest thing to do since the backend has access to everything already. So that eliminated the need of the subreport and the requirement for two different API calls with a rewrite.

Thanks.

Re: How do I pull data from a web query using other data returned from SQL?

Posted: Mon Jul 22, 2024 2:17 pm
by Lech Kulikowski
Hello,

Thank you for the information.