Filter the Report's Data like in a master-detail way


Paolo Lops

Hi David,

how i can implemet multiple query in a report control?

i have a json like this

and i want filter both to categoria and testo.

regards Paolo


DecSoft

Hello Paolo,

In principle, the "automatic" query of the Report controls taken in count all the fields, so, when you filter by "Tutti", you get that category records, or, if you filter by "Pooorcelli", then the appropriate records must be shown (only who contains that "testo" text). For example, you can see the "Report" app sample, and search for names and sports, and you can see that certainly the filter works in both fields: searching for names and sports.

I am not sure if you wanted other thing, because, the above most be enough in principle. Anyway, maybe you must deal with the Report's Data variable by hand, that is, not by using the "automatic" query, but, filter the variable by yourself.

You can do it in the server side or in the client side. The point is that you can iterate the Data variable and look for the query that you wanted, in the fields that you wanted, so, you can prepare a new "Data" variable which only contains the records that you wanted, and then assign that "Data" variable to the Report.

Said that, please, Paolo, post here if you have any further question or doubt.



Paolo Lops

david so there is no way to use some like this to have a better result....? Also wotking on Data variable?

if we store the report result in an object?


DecSoft

Hello Paolo,

I am not sure if can understand. The point is that if we use the Query of the Report, then we are searching in all the Data's fields. This "automatic" query cannot be enough in some cases, but not in others. But what you need to consider is that we can filter the Data variable of a Report by hand, in the server and also in the client.

So, supose we want to shown only records of certain category. We may cannot use the "Query" here, because if the same text/filter appear in some other field of some other record, even if this record is not of the category that we wanted, anyway this record be visible in the Report.

So, supose we want to shown only records of a certain category. What we must to do is to prepare a Data variable which only includes records of that category. After we do that, we can continue using the "automatic" "Query", but now filtering only the records of the wanted category.

I am not sure if can understand or if can explain what I wanted, Paolo, so please, go ahead if you have any further question.



Paolo Lops
Yes David i understand your first and second answers. I was thinking if it was possible to use a variable with the contents of the filtered report variable the first time and apply the second filter on that without having to do cycles ... in other way a possibility to filter the json file the first time without send it to the report and the second time after sent to the report with the automatic filter. doing this we have some like master-details relation..

DecSoft

Hello Paolo,

Anything is possible, since we have the control of the Data variable. For example, supose you put a Select control up to the Report control. The Select control can allows the user to select a category. When the Select control change, you can prepare the Report's Data variable to shown only records of the selected category. Then the user can continue using the Query, to filter records already of certain category. This is a kind of "master-detail", in the sense that we can choose a category in order to show only records of that specific category.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.