How to Preview Excel file in .Net angular JS web page/application

Hi,

I want to display list of excel file names in left panel of web page and on click of any file want to view/preview/display selected file in right pane of web page.
If anyone has idea on this, please suggest, what is the best way to achieve this type of functionality in .Net angular JS or MVC page.

I have downloaded .net cells API but can’t find any method for preview of excel in web page.

Thanks in advance

Hi,

Thanks for your posting and considering Aspose.Cells.

Aspose.Cells can only generate HTML of your Excel files. It cannot arrange your HTML workbooks as you have described. Probably, you can use TreeView ASP.NET control (or like this) for your needs. Please research on the internet and take the help of other developers to know what control(s) you need to arrange your generated HTML as per your screenshot.

Hi,

have a look at the aspose GridWeb Control. It it designed to display and edit Excel-files.

Best regards,
Birgit

Hi Thanks for your reply,

my question is not “how to display tree control” my main question is how to display excel file in browser using aspose API in angular JS page under .net framework (MVC).
Thanks
Viks

Hi Viks,

Thanks for your posting and considering Aspose.Cells.

Could you please share a simplest Angular JS project like “Hello World” type so that we could dig into it deeper? Also, if we provide you a code that export excel to html on Web, will it be helpful for you? We also need to find out that if direct rendering of excel to html on web page/website is possible.

Please also take a look at another control namely Aspose.Cells for GridWeb and see if it is of any help for you. I have attached a sample gridweb project, when you will run it, it will load the sample excel file and display it in web browser as shown in this screenshot.

Hello,

**** Update - Attachment attached now, please have a look****

Thanks for reply, yes i tried that gridweb but it works with ASPX page, but as per my requirement my project dont have aspx or cshtml page. I have simple HTML angular page.
Please find attached example of angular JS code under .net framework and please suggest.

Please open attached code in Visual Studio (my version is 2013) and open index.html page and press F5 to run the code and in run mode click on any file name in left menu (List, EmployeeSales, PDF_1 or PDF_2).

Probable Trick: Not sure if some how if we can get html from aspose (by using Aspose DLL or API) by Angular Call and then my html page can simply display that irrespective of excel or PDF or else.

*** NOTE: Not able to attach attachment, will try later or will send you by email. ***

Thanks in advance.

Regards
Viks

Hi,

Thanks for useful information and using Aspose.Cells.

You can attach your sample project on dropbox or on google drive and provide a link to it in this thread. We will start investigating this issue and update you asap.

Please find attached attachment. Have a look and suggest.

Hi,

Thanks for considering Aspose.Cells.

We have executed your AsposeWithAngularJS.zip project successfully and attached the screenshots for a reference.

We have logged this issue in our database for product team investigation along with your sample project. We will look into it and see how you can employ Aspose.Cells in AngularJS application for your needs. Once, there is some news for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-44585 - How to Preview Excel file in .Net angular JS web page/application

Please note, you can also take screenshots of your excel file for previewing. Here is an article that explains how to take the worksheet image. Please check its feasibility for your project.

( Image|Documentation )

Thanks for your response.

On your suggestion of converting excel into images and then show in webpage. I have already tried this feature but that is not optimized solution for HTML and angularJs page.

More Details on our requirement: We want to display list, names of excel and PDF files under left menu (as per my attached project) and on click of any file (excel or PDF) it should be displayed in right pane. Excel and PDF can contain charts, images etc. The basic idea is any user on our website should be able to open/see excel and PDF without having excel or PDF acrobat reader on his/her PC/Laptop and user should be able to print as well.

If possible please try to revert ASAP, as we want to deliver this to client and if client could not get solution very soon, they may choose not to use Aspose.
Thanks in advance for your efforts.

Hi,

Thanks for your posting and using Aspose.Cells.

Aspose.Cells can convert your excel file into pdf but in order to view it, you need some other component like GroupDocs. Some browsers like FireFox can display the pdf files using their built-in Pdf viewer.

As mentioned previously, Aspose.Cells can convert your excel file into html but the question is how to show the generated html in your AngularJS application for which we have logged the ticket.

Since your requirement is a special requirement and a one user requirement, therefore it is possible that product team will not look into it because of other important and priority tasks. Besides, Aspose collects data about how many users need a particular feature before they start investigating and implementing it.

So, we suggest, you keep looking for your solution with other components and also keep an eye on this thread. Once, we will have any update for you, we will share it with you asap. Have a good day.

Thank you for your reply, as suggested by you we are drilling group docs to see if it can help us to achieve our goal.


Next question: As we know Aspose.cells allow us to manipulate(create/modify/delete) excel files in code. But is there a possibility that if my excel file has macros (more than 1) then in code i can get list of all macros of given excel file and execute any specific macro and that macro may modify some data in excel file ?
For example: if i have a excel file having 3 macros (M1, M2,M3), is it possible in aspose.cells that i can list macros like (M1, M2,M3) and then i can execute all or any specific macro ?

If answer is yes to above question, can you please share any example or code snippt for same?

Thanks.

Hi,

Thanks for your posting and considering Aspose.Cells.

We are afraid, you cannot execute VBA/Macros in your Excel files using Aspose.Cells. However, you can add or modify macros in your workbook object via Aspose.Cells.

Please see the following documentation article that explains this feature.

(Modifying VBA or Macro Code using Aspose.Cells)

Hi,


I want to view Pivot table & Chart in web. Is there any control for that?

Hi,

Thanks for your posting and considering Aspose.Cells.

Please take the images of your worksheets and charts for your needs. Please see the following documentation articles that explain the usage of these features.

Converting Worksheet to Image
Export Range of Cells in a Worksheet to Image
Convert charts to images

Thanks for ur reply Shakeel. I need a full excel viewer like Google Spreadsheet with pivot chart option.



Hi,

Thanks for your posting and considering Aspose.Cells.

Aspose.Cells.GridWeb does support excel charts. However, for pivot tables, I will look into it and then update you with some sample project for your testing.

Hi,

Thanks for considering Aspose.Cells.

We are afraid, pivot tables are not supported in gridweb. Please see the attached screenshots (i.e. sc-excel.png, sc-gridweb.png) that show how the excel file looks like in gridweb.

If you need this feature, then we can log a New Feature request in our database to support it. Please let us know your decision.

I have also attached the sample gridweb project that I used for testing, for your reference.