i wanted to know how to convert a excel sheet into single html page ,wherein all the css are in one html,rather than generating seperatley.
You may export one worksheet (in the workbook) to single HTML. You may set active your desired sheet and then render separate HTML file (based on the worksheet) via Aspose.Cells APIs. Please note, when exporting a worksheet to separate HTML, you would need to export image as base64 format (you will use HtmlSaveOptions class here) otherwise it will create folders. See the sample code for your reference:
//Load your sample workbook Workbook wb = new Workbook(“e:\test2\Book1.xlsx”); //Specify HtmlSaveOptions //Export image as bytes (base 64) as inline images //Export active worksheet only HtmlSaveOptions opts = new HtmlSaveOptions(); opts.ExportImagesAsBase64 = true; opts.ExportActiveWorksheetOnly = true;//You may activate your desired sheet at a time for your needs. //Save the workbook in HTML format with above HtmlSaveOptions wb.Save(“e:\test2\out1.html”, opts);
Hope, this helps a bit.
ya i did this code ,but i m not able to figure out how to convert into html when in excel there are 1 or more sheet and that all sheet should be in 1 html .please help me out.
Please note, there is no direct way in MS Excel (manually) or in Aspose.Cells APIs to accomplish the task. But you may workaround it, see the following details:
Try to export every worksheet (in the workbook) to individual HTML file and then group all these individual HTMLs to one (final) HTML by yourselves via e.g. some tag control or using your own code. In a loop, you may set each sheet active one by one and then render separate HTML file (based on every worksheet) via Aspose.Cells APIs. Please note, when exporting every worksheet to separate HTML, you would need to export image as base64 format (see the sample code in previous post for your reference).