WebSite X5Help Center

 
Marcus Vinicius Rocha Da Silva
Marcus Vinicius Rocha Da Silva
User

How to link a mht file created by Excel?  en

Autor: Marcus Vinicius Rocha Da Silva
Visitado 2671, Seguidores 1, Compartilhado 0  

I need to use a complex spreadsheet in a project, so I created it using Excel. Excel gives two alternatives to save the spreadsheet to be visualized in web: a single MHTML file - extension .MHT - or a web page with a folder containing various files.

The single file is the option I want to use because it retains the layout perfectly, but I would like to know if there is a way to display this file as the content of a page created in X5; more exactly, in the section page content of a web page.

I'm using the latest X5 version, and every tips or sugestions will be welcome, as I don't know how to code!

Thanks in advance!

Marcus

Publicado em
11 RESPOSTAS - 3 ÚTEIS
Aleksej H.
Aleksej H.
Moderator

Hello. I would try to use "HTML code" object.

"or a web page with a folder containing various files." - In this video there is information about how you can add an external file to the site page.

Ler mais
Publicado em de Aleksej H.
Paul M.
Paul M.
Moderator

Hello Marcus,

I don't work with MHTML files generally, but can't see any reason why you couldn't embed your file in an iframe.  It's what I would try first anyway.  It would give a starting point, and if you experience problems we could go from there.

What follows takes into account that you want to try and keep coding to a minimum.  Unfortunately there has to be a small amount of code, as WebSite X5 doesn't support MHT files natively.

Drag an HTML Code Object onto the page where you want to display your MHT file.  Double-click on the HTML Code Object to enter its properties and type the following code:

<iframe src="files/your_MHT_filename.mht" width=100% height="800">
<p> Your browser does not support iframes</p>
</iframe>

You will obviously need to edit 'your_MHT_filename.mht' to the actual name of the MHT file you are using.

The width and height specified are just default values which you can change later if the file doesn't display to your liking on the page.

Now go to the 'Expert' tab of the HTML Code Object.  In the section titled 'Files linked to HTML code' click on the 'Add' button to the right, and browse to the location of your MHT file on your computer.  This will associate it with your WebSite X5 project, and ensure that WebSite X5 uploads it to your server along with all the other project files.  By default, WebSite X5 will place your file in a folder named 'files' on your server, unless you edit the 'Path on server' on the Upload linked file screen.  If you do change the path then you will also need to change the 'src' path in the iframe code above, else your file will not be found.

If your MHT file is already on the web somewhere, then you can skip adding the file completely and simply change the 'src' to the address of the file on the internet: e.g. https://domainname/address_of_mht_file.mht

Upload your WebSite X5 project to the server in Step 5, and test.

If something's not right, you can revert to us.

If you wish you can send me your MHT file securely using the contact form on my website (address below), and I will attempt to sort the coding issues for you.

Kind regards,

Paul

https://webx5.pro

Ler mais
Publicado em de Paul M.
John S.
John S.
User

Hello marcus

There is also the Google Docs. Here you could use the Google-spreadsheet. Import your Excel spreadsheet into the Google Doc spreadsheet.

Then you can in Google Doc generate the code needed to integrate it into your webpage.

The advantage with this method is, that it is still a spreadsheet. You can have it shown with different sheets/tabs and you can edit the document in Google Doc and then the spreadsheet on your website is instantly updated.

You could make a special account where you give some other users access to edit the file - or you can have access for only you to edit.

Ler mais
Publicado em de John S.
Marcus Vinicius Rocha Da Silva
Marcus Vinicius Rocha Da Silva
User
Autor

Hi Alexsej! I followed the instructions, but didn't work: nothing appears in my page!

Paul, the same happened with the iframe instruction...

John, your solution works, but I really need to use the specific file, once Google Spreadsheet changes the table layout...

I  decided to use the link file to open the .mht file in another tab, I thought that this could be a workaround, but when I do it a dialogue box is opened asking to save the file, instead of simply open it. The file itself is ok, when I click it opens normally in a browser.

I would attach the MHT, but its size reach 1,3 Mb when zipped!

Ler mais
Publicado em de Marcus Vinicius Rocha Da Silva
Marcus Vinicius Rocha Da Silva
Marcus Vinicius Rocha Da Silva
User
Autor

Sorry, I found the answer: neither Google Chrome nor Microsoft Edge or Firefox open .MHT files, just the old Internet Explorer... 

This leads me to another question: I may save the spreadsheet as a HTML file, but when I tried to link it its connected files aren't found, once X5 saves only the main page on the site structure Files folder.

Ler mais
Publicado em de Marcus Vinicius Rocha Da Silva
Aleksej H.
Aleksej H.
Moderator

Maybe you just give a link to download XLS.

Ler mais
Publicado em de Aleksej H.
John S.
John S.
User

What about printing the Excel sheet to a PDF file, and then show the PDF in the PDF object in X5 or as an iframe, in a html-object in X5.

This way it will retain its layout, if there are links in the spreadsheet they will still be clickable, and in case of more sheets, the PDF can hold more pages. When you print you can choose the orientation.

In the PDF there can be zoomed in and/or out.

Ler mais
Publicado em de John S.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Usuário do mês ESUsuário do mês PT
Marcus Vinicius Rocha Da Silva
... ...  This leads me to another question: I may save the spreadsheet as a HTML file, but when I tried to link it its connected files aren't found, once X5 saves only the main page on the site structure Files folder.

(It > De)

1) - Exportieren Sie Ihre Tabelle nach MHT in einen Site-Ordner mit dem Namen "sheet1".
2) - Exportieren Sie Ihre Tabelle nach .HTML in einen Site-Ordner mit dem Namen "sheet2".
3) - Exportieren Sie Ihre PURO-Tabelle nach .XLS in einen Site-Ordner mit dem Namen "sheet3".
... dann poste die drei LINKS hier:
www.ihr_site/sheet1/seitenname.mht    x(!)
www.ihr_site/sheet2/seitennamee.html   x(iframe)
www.ihr_site/sheet3/seitenname.xls    x(GoogleDocsViever)

ciao

.

Ler mais
Publicado em de  ‪ KolAsim ‪ ‪
Marcus Vinicius Rocha Da Silva
Marcus Vinicius Rocha Da Silva
User
Autor

KolAsim, thanks! Your suggestion isn't the most perfect technically, but it is perfect: it guarantees an adequate visualization of the content. Thank you very much!

Ler mais
Publicado em de Marcus Vinicius Rocha Da Silva