How do I pull data from a web query using other data returned from SQL?
-
- Posts: 11
- Joined: Wed Jul 03, 2024 12:52 am
How do I pull data from a web query using other data returned from SQL?
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?
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?
-
- Posts: 7333
- Joined: Tue Mar 20, 2018 5:34 am
Re: How do I pull data from a web query using other data returned from SQL?
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.
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.
-
- Posts: 11
- Joined: Wed Jul 03, 2024 12:52 am
Re: How do I pull data from a web query using other data returned from SQL?
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.
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.
Last edited by DavidLee82 on Thu Jul 04, 2024 7:09 am, edited 1 time in total.
-
- Posts: 7333
- Joined: Tue Mar 20, 2018 5:34 am
Re: How do I pull data from a web query using other data returned from SQL?
Hello,
Could you send your report template for analysis?
Thank you.
Could you send your report template for analysis?
Thank you.
-
- Posts: 11
- Joined: Wed Jul 03, 2024 12:52 am
Re: How do I pull data from a web query using other data returned from SQL?
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.
Thanks.
-
- Posts: 7333
- Joined: Tue Mar 20, 2018 5:34 am
Re: How do I pull data from a web query using other data returned from SQL?
Hello,
Thank you for the information.
Thank you for the information.