AutoFitColumn issue

Hi,

I am using Aspose.Cells.dll for .NET version 7.0.4.3 to convert excel documnets to tiff format.

If i apply AutoFitColumns option to excel sheets the hidden column property is getting changed to false. Please guide me to handle this issue.

Thanks,

Dhivya

Hi,

Please use the latest version:
Aspose.Cells
for .NET v7.1.0.4


If the problem persists, then provide us a sample code replicating the problem and the source and output xls/xlsx files.

Hi,

I am getting same issue in latest version of aspose.cells.dll for .net version 7.1.0.4. please find the below sample code to reproduce the issue. The output tiff file contains the hidden column also, but i don't want to print the hidden column. I have attached the source file and output tiff file. The column "B" is hidden, but in output tiff file the B column is visible.

private void button1_Click(object sender, EventArgs e)

{

string fileName = @"C:\Documents and Settings\RangarDX\Desktop\Test data.xlsx";

Workbook wb = new Workbook(fileName);

// Create and add cell wrap style

Style style = wb.Styles[wb.Styles.Add()];

style.IsTextWrapped = true;

// Create and set style flag

StyleFlag styleFlag = new StyleFlag();

styleFlag.WrapText = true;

foreach (Worksheet ws in wb.Worksheets)

{

ws.AutoFitColumns();

if (ws.Cells.Count == 0)

continue;}

ImageOrPrintOptions _printOptions = CreateSaveOptions();

WorkbookRender bookRender = new WorkbookRender(wb, _printOptions);

bookRender.ToImage(@"C:\testOutput.tif");}

private new ImageOrPrintOptions CreateSaveOptions()

{

ImageOrPrintOptions tiffOptions = new ImageOrPrintOptions();

tiffOptions.HorizontalResolution = 300;

tiffOptions.VerticalResolution = 300;

tiffOptions.PrintingPage = PrintingPageType.Default;

tiffOptions.PrintWithStatusDialog = false;

tiffOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;

tiffOptions.TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionNone;

tiffOptions.IsCellAutoFit = true;

tiffOptions.IsImageFitToPage = true;

return tiffOptions;

}

Hi,

Thanks for testing it with the latest version and providing us the sample code.

We have logged this issue in our database. The development team will look into it and fix the problem.

Once, we have a fix or some update relating to it, we will let you know asap.

This issue has been logged as CELLSNET-40351.

Hi,

Please download and try this fix: Aspose.Cells for .NET v7.1.0.6

Please see the following sample code.

C#


AutoFitterOptions options = new AutoFitterOptions();

options.IgnoreHidden = true;

Worksheet sheet = workbook.Worksheets[0];

sheet.AutoFitColumns(options);


Thank you very much. It is working.

The issues you have found earlier (filed as CELLSNET-40351) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.