Passing a Record List to a Popup

Passing a Record List to a Popup

  
Hi,

I would like to pass a record list into a popup screen, does anybody knows how can I do this?

Thanks in advance,
Gonçalo.

Hi,

Create a record list session variable and you can use it on the popup, however record list can consume a large amount of resources and this is kind of situation is to avoid.
It's better to pass the id of the record to popup and with a query on preparation screen you can get the record, this is better way to do that.

Nelson Inácio.
Hallo,

I did not quite understand how I can achieve what Nelson wrote.

I manage passing the record list by passing my list as an input. However I have a message saying that is not recommended to do it that way.

So If I just want to have my table record list displayed in a new page ready to print how can I pass the list correctly?

Thanks in advance.
Hi Bonfait,

The way we recommend doing it is to get the data in the screen preparation, because passing it using a parameter means that the entire list is transferred from one screen to another, which may lead to less than desirable performance.

That being said, if you just want to print a table that you already have on the screen, why not use a print-only CSS for that specific page that hides everything else when being printed, so that it only prints the table?

Regards,

Paulo Tavares

Hi Paulo,

just to be clear you're saying that for printing I just have to change the style properties of the containers with a .css with display:none, right?
Than use the HTTPRequestHandler.AddPostProcessingFilter() in the Preparation to have a link with media=print?

If it's like this I would not have a new window with the same RecordList.
What if I want to have the same RecordList but in a new window with some fancy styling and wording (just for printing)? The problem is that in the View page, I have a few different fields that the user can choose to have different outputs in the RecordList (different queries). Could I pass the search fields and have a new query in a new page ready to print? or is there any easier way?

I hope I've made myself clear.

Thanks for all your help as always.

 

Hi Bonfait,

No, I'm sorry I wasn't clear.

Regarding the print-only CSS, you don't have to go that far. It's just a matter of, in your CSS, adding the print styles inside a specific construct. For instance:
@media print {
    body { font-size: 10pt }
  }

You just place this in your CSS, as usual, and only when printing will it be used. You can read more about it in the CSS specification.

Regarding your alternative suggestions, passing the search fields and have a new query in a new page ready to print would be a good way to do it, yes.

Let us know how that goes!

Regards,

Paulo Tavares
Hello,

I believe that actually, the best way to achieve what Gonçalo needs is using the CSS print method.

However, I wondered about the best method to pass a record list from one screen to another and I reached the following conclusions/questions:
  • Session Variable - Not a good choice, as long as the session "lives" there will be a large record list consuming resources on the server and that could cause performance issues.
  • Passing an ID - Ok, I get the idea, but running the Query twice on the SQL Server isn't an overkill? I guess that this would work fine and wouldn't consume as much resources on the FrontEnd server as the previous method, but if you ask the SQL Server, he will tell you that you are doing it wrong! =)
  • Record List Input Variable - This is where it gets complicated for me. Ok, page one gets the record list from the server from a query. If you pass that record list to a page two, won't it just pass the reference for the record list that page one got from SQL? If thats so, why is the warning displayed? And how does an input record list variable affect performance? I'm having trouble understanding this part.
Thank you,
Pedro Magalhães
Hi Pedro,

You did a great job drilling into the 3 alternatives. Let me add two comments on your words.

- Passing an ID - Ok, I get the idea, but running the Query twice on the SQL Server isn't an overkill? I guess that this would work fine and wouldn't consume as much resources on the FrontEnd server as the previous method, but if you ask the SQL Server, he will tell you that you are doing it wrong! =)

Actually, yes, you're right that you're executing the query twice. However, I would also say that the SQL Server will have that same query in cache, so the performance hit is minimal.

- Record List Input Variable - This is where it gets complicated for me. Ok, page one gets the record list from the server from a query. If you pass that record list to a page two, won't it just pass the reference for the record list that page one got from SQL? If thats so, why is the warning displayed? And how does an input record list variable affect performance? I'm having trouble understanding this part.

The Record List variable per se does not affect performance, nor is it certain that its usage will - that's why it's a warning, and not an error. However, there are some considerations to have when using the Record Lists as parameters.

The main one is that input parameters are included in the page's viewstate, and sent in requests back and forth between the server and the browser. Using a Record List input parameter tends to dramatically increase the viewstate, and as a consequence, the page's size.

It's not a matter of the server handling the data, but a matter of the web application's data flows.

That's why repeating the query is a better solution, since the time that it takes to trasmit the data back and forth is almost always larger than the time it takes for SQL server to execute the query.

If you want to learn more about the Viestate, I recommend you read this article on MSDN.

I hope this makes it clearer.

Regards,

Paulo Tavares
Hello, Paulo

Thank you for such a detailed explanation. You're right! I didn't take into account the viewstate issue! And it makes all the difference.

Best regards,
Pedro Magalhães