Transferring Table to Another Page

I have to make a small bit of funcitonality for an Outsystems site at work. The requirement is to take different elements from various aspects of the website and output them as a PDF (via the excellent 'Ultimate PDF Reactive Blocks' module). The challenge is to essentially just lift/recreate the elements on the print page without changing anything in the transfer process. The elements are a table, a chart, some text and an image.

I've got everything sorted except for the table. The chart, image and text can be easily enough generated with standard components. The table however is tough to recreate, it is part of another bulky page and the developers of that page would rather I not alter the current table in any way, i.e. no making it into a block. The table takes 3 inputs so it is variable in its output depending on the options chosen.

Is there a way of quickly transferring the table data to a new page and recreating it. Maybe just lift the HTML as a text string and recreate it on the print page. I've tried using 'HTML 2 Image' but the processing is rather slow and the output does not print well over several pages, I feel that having an actual table rather than an image is the best approach.

https://personal-nig4qz1g.outsystemscloud.com/testtesttest/

Here is my site, 'Home' page is where the elements come from, 'Reporting' page is the one I will print as a PDF.

Any help is appreciated :)

Solution

Hello @Cathal McGuinness,

Please review the attached oml. It's just one way I could think of.

Basically, as long as the Table has a unique name you can use it to capture it's 'innerHTML'.
Save the innerHTML in a client variable (yup that's a lot of text in but it gets the job done and better than passing it all as an input parameter to the Report Screen)
Populate the Report Screen with the innerHTML using the text in the client variable. Thats it.

Hope it helps you a bit or gives you a few ideas,

Regards,

AJ

RecreateTableFromInnerHtml.oml

Amazing, works perfectly exactly what I was looking for. Thank you for your help I appreciate it.

You are very welcome Cathal!

Once you have tested things out completely you may close this thread out as Solved or you could keep the thread open for a little longer to see if any alternative solutions are suggested by the community.

Regards

AJ

Please do close the thread out by tagging the post that resolved the problem, as the 'Solution'.

Thanks,

AJ 

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