-1

Good day,

I have the following situation:

I need to display an area from an Excel file in a webpage. The Excel file has some graphics and conditional formatting I would keep as much as possible.

As a matter a fact, i am going to include the Excel file view into an IFRAME so that the Excel appears part of a Reports Dashboard.

Can you recommend me a solution how to do it? I have to refresh the report once every 4 hours in the dashboard (but I can do this in html). Thus, the solution of printing the Excel file in .pdf and embedding the pdf does not do it .

So far,

  • I tried unsuccessfully to embed it with the tag
  • I tried to read the file via ASP.net unsuccessfully , probably due to an outdated code source

Please help me find a solution.

My areas of knowledge: MS Excel (advanced), HTML+CSS (advanced), ASP.net (beginner), T-SQL (medium to advanced).

I have got a Microsoft IIS 7.0 webserver with ASP.net 4.0 running.

I can learn anything else if necessary.

thank you.

George
  • 653
  • 6
  • 18

1 Answers1

0

I had to do this a while ago and this is what i ended up doing

Saved the excel file (or part of the sheet) as a static webpage

https://support.office.com/en-au/article/Save-all-or-part-of-a-workbook-to-a-static-Web-page-5ad26dee-8739-4d80-b9d9-cf0530ab1968

I had a background job that updated the sheet and saved which in turn triggered the autopublish as the link above explains.

I had the link to this static page into an iframe.

The added advantage with this was that if a user opened and updated the file, the changes are reflected as soon as they save and doesnt wait on the background job

EDIT: style the iframe to squeze its contents within itself without scrollbars. This style goes into parent page where iframe is used (not in the published excel)

iframe {
  -moz-transform: scale(0.25, 0.25); 
  -webkit-transform: scale(0.25, 0.25); 
  -o-transform: scale(0.25, 0.25);
  -ms-transform: scale(0.25, 0.25);
  transform: scale(0.25, 0.25); 
  -moz-transform-origin: top left;
  -webkit-transform-origin: top left;
  -o-transform-origin: top left;
  -ms-transform-origin: top left;
  transform-origin: top left;
}

Source for the style from here

Community
  • 1
  • 1
Krishna
  • 2,451
  • 1
  • 26
  • 31
  • Thank you for your answer. I tried this solution ("Publish as Webpage"), but the drawback is that the Webpage is not scaled into the iframe. I mean the webpage that displays the Excel published content needs horizontal scrolling to show entirely. At least I do not know how to scale it so that it appear fully in the iframe without need for scrolling horizontally. Things is, while being part of a dashboard it does not make sense to have scrolling. Do you suggestions how to make the webpage fluid? – George Jul 03 '15 at 20:30
  • Thank you very much, Krishna – George Jul 04 '15 at 22:24