463
Views
8
Comments
Solved
Converting Data from web screen to html file.
Question

Hi everyone, I am a bit new to Outsystems.  My issue is this, I have a rest API in which I am receiving data from and I am displaying the data to a web screen.  My question is, I would like to get the data being displayed in the web screen and convert it to an html file.  How can I go about accomplishing this?

2020-02-28 09-46-54
Eduardo Jauch
Solution

Jerry Sylveus wrote:



The idea is that I would like to do something like this.  See the link below.  I would like to save that html into a file and allow the use to download that file.

https://www.w3schools.com/js/tryit.asp?filename=tryjson_html_table


Thanks for any help.

Hi Jerry.

If you want to save as HTML, you can do as I said before.

But if the idea is to provide the user with a list (one or more columns), with the data from the database, the better would be to use the very known pattern Aggregate/TableList+listToExcel+Download.

This way, the user will have the data in an excel file.

Cheers,

Eduardo Jauch


2020-02-28 09-46-54
Eduardo Jauch

Hum...

I'm not sure I got the idea...

The page you see in the browser, with your information, IS an html file (even if the extension is aspx).

What exactly are you trying to accomplish?

Cheers, 

Eduardo Jauch

2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Jerry ,

Do you want to get the html from the Body ?



Regards

-PJ-

2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Jerry,

I have not seen but there may be something in Os to get this .

In Asp.net we can get it from this code

using (System.Net.WebClient client = new WebClient())
            {
               
                // Or you can get the file content without saving it:
                string htmlCode = client.DownloadString(your url goes here);
               
            }


Regards

-PJ-


2020-02-28 09-46-54
Eduardo Jauch

Hi,

If the objective is to download the HTML, the easiest way is to simply add the tag "download" in the extended properties of a link that points to the page itself.

When the user clicks the link, it will open the Save As window to the user to chose the place to save the file (the html).

If the link itself is not desired, you can pass an input parameter to say to hide the link when coming from the link, and put an IF in the screen to take care of this for you.

P.S. I don't know if the tag download works on all browsers or very old versions. It is important to test on the browsers your application will support.

UserImage.jpg
Jerry Sylveus

Eduardo Jauch wrote:

Hi,

If the objective is to download the HTML, the easiest way is to simply add the tag "download" in the extended properties of a link that points to the page itself.

When the user clicks the link, it will open the Save As window to the user to chose the place to save the file (the html).

If the link itself is not desired, you can pass an input parameter to say to hide the link when coming from the link, and put an IF in the screen to take care of this for you.

P.S. I don't know if the tag download works on all browsers or very old versions. It is important to test on the browsers your application will support.


The idea is that I would like to do something like this.  See the link below.  I would like to save that html into a file and allow the use to download that file.

https://www.w3schools.com/js/tryit.asp?filename=tryjson_html_table


UserImage.jpg
Jerry Sylveus



The idea is that I would like to do something like this.  See the link below.  I would like to save that html into a file and allow the use to download that file.

https://www.w3schools.com/js/tryit.asp?filename=tryjson_html_table


Thanks for any help.

2020-02-28 09-46-54
Eduardo Jauch
Solution

Jerry Sylveus wrote:



The idea is that I would like to do something like this.  See the link below.  I would like to save that html into a file and allow the use to download that file.

https://www.w3schools.com/js/tryit.asp?filename=tryjson_html_table


Thanks for any help.

Hi Jerry.

If you want to save as HTML, you can do as I said before.

But if the idea is to provide the user with a list (one or more columns), with the data from the database, the better would be to use the very known pattern Aggregate/TableList+listToExcel+Download.

This way, the user will have the data in an excel file.

Cheers,

Eduardo Jauch


UserImage.jpg
Jerry Sylveus

Thanks everyone

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