@Vaidehi123,
Thanks for the files.
I compare your input Excel file Vs your output PDF and both are matched, see the screenshot attached for your reference. You can see long data is also cut in input Excel file and so it is cut in the output PDF.
sc_shot1.png (265.8 KB)
In MS Excel, there are only three ways to show all text data in different cells of the column (e.g. A column), there is no other way around. So, Aspose.Cells also have these three ways.
1). Use auto fit columns operation to show long data in different cells. If you do not want to auto-fit all the columns (AutFitColumns()), you may only auto-fit first column using AutoFitColumn() method (e.g., for the column which has long data/text) in worksheet.
2). Extend the column’s width (via Worksheet.Cells.SetColumnWidth()) to a value which should be equal to longest text width. For example, for your file, the column width of A column can be set to 102 which is little greater than the longest text/data in the column. If you opt to go with this option/approach, you will need to scan each cell in the column and check the width via Cell.GetWidthOfValue() and then set the column’s width to this value.
3). Wrap text/data in the cells of the specified column. Doing this, your long data might be pasted in two lines. So, if you accept this, you may try it. See the sample code segment for your reference:
e.g.
Sample code:
.......
// Adding a new Style to the styles
Style style = workbook.CreateStyle();
style.IsTextWrapped = true;
// Creating StyleFlag
StyleFlag styleFlag = new StyleFlag();
styleFlag,WrapText = true;
// Accessing a column (A column) from the Columns collection
Column column = worksheet.Cells.Columns[0];
// Applying the style to the column
column.ApplyStyle(style, styleFlag);
.......
Apart from above solutions, I do not find any other better way to show long data/text completely. So, you have to choose any one of the above approaches. If you still think there is any other better way to do it in MS Excel manually, kindly share details with sample Excel file, we can check it further.