In Appeon they tell me that there is no way to retrieve a nested report with .Net Datastore.
In my example saved in the Reports_API_composite folder I have created a solution:
1 - Dynamically generate a Datawindow Composite and add the header and the main report.
2- Bring the data with a JsonPackage and import them taking reference to each report as DatawindowChild.
3- The arguments used in computed fields must be regenerated or they don't work.
Here is the result in case you want to check it:
https://drive.google.com/file/d/1zpZeXnyQqaAm6MX1f7dm-2LDv8TicF2g/view?usp=sharing
In the compressed file there are three projects and a demo database. Reports_API --- > Which shows the problem. Reports_PowerServer --> Which shows that in PowerServer everything is automatic... Report_API_compisite --> My solution to the problem. It remains to be seen what happens with the arguments of the datawindows that are arrays....
Hi Logan,
I have tried the same thing with PowerServer and it works perfectly, I would like to know if it is possible to do it easily with .Net Datastore to make my own API.
By dynamically creating a composite datawindow I have been able to solve problem Nº 1, so you can get a reference with GetChild to each of the reports and import the Json from the backend.
On the other hand, I have solve problem Nº2 by scanning all the objects in the DatawindowChild and changing those expressions of the computed fields where the arguments that have not been loaded appear, I have succeeded in replacing the argument with its value.
It's incomprehensible why the GetChild function cannot be used in nested reports, it would save me a lot of laps.
Regards.
I attach an example.
Hi Ramón,
Sorry, although I can duplicate your issue with your case, I cannot make its header work.
DataWindow control doesn't support setting data to retrieve arguments without calling the Retrieve method. You can add some dummy columns to work around it.
BTW: you can modify your DataWindow to a composite style to work around the report issue.
Regards,
Logan
Hi Ramón,
1) "My reports usually are datawindow that has a header with a report (Company Name and Logo)."
This feature hasn't been supported in .NET DataStore for performance consideration. You can call the IDataStore.GetReport method to work around it. If you really need it in your server-side, please submit an enhancement requirement in the Appeon Standard Support at https://www.appeon.com/standardsupport/.
2) "It also doesn't work well if I use a datawindow parameter in a compute field."
It seems that this issue happened on your PB client. Could you provide more details about your codes?
Regards,
Logan