[Ultimate PDF] Unable to get filtered data into PDF
Forge component by Leonardo Fernandes
Application Type
Reactive
Service Studio Version
11.10.18 (Build 40944)

Hi,

I am using https://www.outsystems.com/forge/Component_Reviews.aspx?ProjectId=5641 component in my reactive web application.

Let's suppose I have listing screen with 10 records and then I search to filter out data and got 5 records then I clicked on download to pdf. In pdf it is always 10 records but not the filtered one records.

How to fix this?

Hi Rohan, as mentioned the specific filter will depend on the actual filter you are applying to your data as here the solutions can vary greatly, so if you can share more details or share an OML yourself I can probably give you a better answer.

For example, let's suppose your data source is an Aggregate, and that you are simply filtering based on a keyword (SearchKeyword), such that you have a structure like the following: 

What you want to do is make "SearchKeyword" a non-mandatory Input Parameter, and then add it to the URL in the PrintToPDF Actions, for example:


That way, when the PrintToPDF action navigates to that screen itself, it will include that filter automatically when loading the data. 

Now, you will have to adapt this if your filtering is more complicated. First example would be several filters, which you can still handle just by separating with "&" (e.g. "Accounts?Keyword1=" + Keyword1 + "&Keyword2=" + Keyword2). From here you would follow the same logic even if you have to define a separate helper entity or a separate screen just to handle that download portion of your application.

When you use the action to download the PDF, it does not necessarily download the screen in the exact state you are seeing it at that point (e.g. after applying a filter), but rather in its "initial" state as it would be seen when a user first navigates to that screen. 

Therefore, you need to add a mechanism to have the results filtered out right from the beginning, such as an input parameter to represent that filter (e.g. an Id that you can use in your Preparation/Aggregates, which could be made non-mandatory to not interfere with your existing flows), or persisting the filter in some way, such as a helper Entity to address this use case specifically. Here the specific fix will depend on the nature of the data you are filtering, and the filter you are looking to apply.

Let me know if that does the trick or if you can share more details to try to help you with something more specific.


Hi Reancisco,

Thanks for your comments. I am using the Reactive web application. You are suggesting to pass the input parameter to represent the filter. How exactly will it work in my case. If you could attach .oml that will help me.

Thanks.... 

Hi Rohan, as mentioned the specific filter will depend on the actual filter you are applying to your data as here the solutions can vary greatly, so if you can share more details or share an OML yourself I can probably give you a better answer.

For example, let's suppose your data source is an Aggregate, and that you are simply filtering based on a keyword (SearchKeyword), such that you have a structure like the following: 

What you want to do is make "SearchKeyword" a non-mandatory Input Parameter, and then add it to the URL in the PrintToPDF Actions, for example:


That way, when the PrintToPDF action navigates to that screen itself, it will include that filter automatically when loading the data. 

Now, you will have to adapt this if your filtering is more complicated. First example would be several filters, which you can still handle just by separating with "&" (e.g. "Accounts?Keyword1=" + Keyword1 + "&Keyword2=" + Keyword2). From here you would follow the same logic even if you have to define a separate helper entity or a separate screen just to handle that download portion of your application.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.