Read an Excel file and convert into word Document

Hi,

Can u give me a sample code or can u tell me how to read and excel file and convert that document into an word document.

Thanks Lokesh K


This message was posted using Aspose.Live 2 Forum

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Well, I am afraid this feature is not supported by Aspose.Cells (converting Excel file to Word document). Also, I don’t think this feature is provided by MS Excel, so we cannot support this feature either as we provide the features which are supported by MS Excel.

Thank You & Best Regards,

Thanks for your response,

Atleast can u tell me how to do it worksheet by worksheet, or cell by cell, that coding hint can u give me with some sample code…

Hi,

Well, you may try exporting Worksheet data to a DataTable and then use it to create word document if it fits your need. Please see the following documentation link for reference.

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/exporting-data-from-worksheets.html

Thank You & Best Regards,

This mail is for Alexey,

This is regarding the xls to word converter, for some of the border color is excel is not getting copied in word properly, when i debug, the value after read from excel for RGB is coming as 0.

Kindly help me out in solving this problem.

Lokesh.k

private void ImportBorders(com.aspose.words.Cell wordsCell, com.aspose.cells.Cell excelCell) throws Exception {
BorderCollection wordBorders = wordsCell.getCellFormat().getBorders();
com.aspose.cells.Style excelStyle = excelCell.getStyle();
//Set line style
wordBorders.get(com.aspose.words.BorderType.BOTTOM).setLineStyle(ConvertLineStyle(excelStyle.getBorderLine(com.aspose.cells.BorderType.BOTTOM)));

//Set line color
wordBorders.get(com.aspose.words.BorderType.BOTTOM).setColor(ConvertColor(excelStyle.getBorderColor(com.aspose.cells.BorderType.BOTTOM)));
wordBorders.get(com.aspose.words.BorderType.LEFT).setLineStyle(ConvertLineStyle(excelStyle.getBorderLine(com.aspose.cells.BorderType.LEFT)));
wordBorders.get(com.aspose.words.BorderType.LEFT).setColor(ConvertColor(excelStyle.getBorderColor(com.aspose.cells.BorderType.LEFT)));
wordBorders.get(com.aspose.words.BorderType.RIGHT).setLineStyle(ConvertLineStyle(excelStyle.getBorderLine(com.aspose.cells.BorderType.RIGHT)));
wordBorders.get(com.aspose.words.BorderType.RIGHT).setColor(ConvertColor(excelStyle.getBorderColor(com.aspose.cells.BorderType.RIGHT)));
wordBorders.get(com.aspose.words.BorderType.TOP).setLineStyle(ConvertLineStyle(excelStyle.getBorderLine(com.aspose.cells.BorderType.TOP)));
wordBorders.get(com.aspose.words.BorderType.TOP).setColor(ConvertColor(excelStyle.getBorderColor(com.aspose.cells.BorderType.TOP)));
// wordBorders.setLineWidth(1);
}