1. Ramón San Félix Ramón
  2. SnapDevelop
  3. Monday, 3 August 2020 11:58 AM UTC
My reports usually are datawindow that has a header with a report (Company Name and Logo).
 
When migrating to Snapdevelop, it doesn't retrieve the header.
 
It also doesn't work well if I use a datawindow parameter in a compute field.
 
How do you have to implement all this in SnapDevelop for it to work properly?
 
 
Attachments (1)
Accepted Answer
Ramón San Félix Ramón Accepted Answer Pending Moderation
  1. Thursday, 24 February 2022 17:08 PM UTC
  2. SnapDevelop
  3. # Permalink
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....
Comment
There are no comments made yet.
Ramón San Félix Ramón Accepted Answer Pending Moderation
  1. Tuesday, 15 February 2022 15:58 PM UTC
  2. SnapDevelop
  3. # 1

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.

 

Comment
  1. Logan Liu @Appeon
  2. Friday, 18 February 2022 09:49 AM UTC
Hi Ramón,

We don't have an easier way to do this in the latest version. If you only want to use .NET DataStore, I think changing your datawindow to a composite datawindow is the best workaround.

Regards, Logan
  1. Helpful 1
  1. Ramón San Félix Ramón
  2. Friday, 18 February 2022 15:49 PM UTC
I cannot understand that PowerServer can automatically retrieve the datawindows with nested reports without any problem and there is no method to do it in the Sanpdevelop web API...
  1. Helpful
  1. mike S
  2. Friday, 18 February 2022 15:51 PM UTC
this is an option for you - will allow you to run reports as an api and send them back in any format (pdf, excel, psr).... you do have to write code to run the report as an api.



https://topwizprogramming.com/topwizweb.html
  1. Helpful
There are no comments made yet.
Ramón San Félix Ramón Accepted Answer Pending Moderation
  1. Saturday, 8 August 2020 10:32 AM UTC
  2. SnapDevelop
  3. # 2

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.

 

Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Saturday, 19 February 2022 06:37 AM UTC
I think the GetChild() will work using a little trick: If you (temporarily) modify the report to be of type 'grid' (processing=1) using the Modify() function, it might work. I should have some code somewhere but can't access my PB code right now, let me know if you want to try that.

regards.
  1. Helpful
  1. Ramón San Félix Ramón
  2. Monday, 21 February 2022 07:39 AM UTC
If you have any code examples it would be great, thank you.
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 24 February 2022 17:20 PM UTC
I'm sorry, but I've lost all of the code that I had using that specific feature.

regards
  1. Helpful
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 7 August 2020 17:03 PM UTC
  2. SnapDevelop
  3. # 3

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

 

Comment
There are no comments made yet.
Ramón San Félix Ramón Accepted Answer Pending Moderation
  1. Wednesday, 5 August 2020 15:48 PM UTC
  2. SnapDevelop
  3. # 4
Here you have it.
 
See if it works for you now.
Regards.
Attachments (1)
Comment
There are no comments made yet.
Ramón San Félix Ramón Accepted Answer Pending Moderation
  1. Wednesday, 5 August 2020 09:05 AM UTC
  2. SnapDevelop
  3. # 5

Attached example where you can see the two cases...

If you can correct me to make the header work it would be great.

The exmaple can be run with Api or natively to see the difference ...

Regards, 

Ramón

Attachments (1)
Comment
  1. Logan Liu @Appeon
  2. Wednesday, 5 August 2020 15:09 PM UTC
Hi Ramón,

I failed to restore your database. Please provide the correct .bak file.

Regards,

Logan
  1. Helpful
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 4 August 2020 17:08 PM UTC
  2. SnapDevelop
  3. # 6

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

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.