@John.He , Can you please have a look at this zip and let me know if the latest version has solved the issue.
TestFile-output-pdf.zip (587.3 KB)
@shreyap
By testing with the newly provided sample files and the following sample code in v25.3, we can still obtain the correct results. Please refer to the attachment. out_net.zip (397.6 KB)
Workbook wb = new Workbook(filePath + "Testfile.xlsx");
ShapeCollection shapes = wb.Worksheets[0].Shapes;
int shapeCount = shapes.Count;
for (int i = 0; i < shapeCount; i++)
{
Shape shape = shapes[i];
shape.Placement = PlacementType.MoveAndSize;
}
wb.Worksheets[0].Cells.DeleteBlankRows();
wb.Save(filePath + "out_net.xlsx");
wb.Save(filePath + "out_net.pdf");
@John.He , I updated my aspose cells version to 25.3 and still not able to fix it.
Please refer to the code, testFile I have used and the output files generated and my expected output.
It is a priority. It would be great if it gets fixed. Thank you.
New folder1.zip (1.4 MB)
Thanks for the template Excel file, sample app and output files.
Thank you for providing the template Excel file, sample application, and output files. I tested your scenario using the template Excel file and sample app, and I discovered the issue. I have recorded the resource files and my findings with your existing ticket “CELLSNET-57838” in our database. The issue remains “Open.” We will assess and investigate the issue soon.
@amjad.sahi ,
@John.He mentioned that with the testing on his/her machine he/she was able to fix the issue. Am I missing something?
I guess this is because he is using a different file and code snippet. However, when I tested your sample app along with the template file from the “New folder1.zip” attachment, I encountered the issue.
@shreyap
By testing on the latest version v25.3 using the following sample code, we found that there are still differences between the result file and the expected result file. Please refer to the attachment. out_net.zip (392.5 KB)
Sorry for any inconvenience caused to you. We will continue to fix the issue and notify you promptly once there are updates.
The sample code as follows:
Workbook wb = new Workbook(filePath + "Testfile.xlsx");
ShapeCollection shapes = wb.Worksheets[0].Shapes;
int shapeCount = shapes.Count;
for (int i = 0; i < shapeCount; i++)
{
Shape shape = shapes[i];
shape.Placement = PlacementType.MoveAndSize;
}
DeleteBlankOptions options = new DeleteBlankOptions();
options.DrawingsAsBlank = false;
wb.Worksheets[0].Cells.DeleteBlankRows(options);
wb.Save(filePath + "out_net.xlsx");
wb.Save(filePath + "out_net.pdf");
We are pleased to inform you that your issue (Ticket ID: “CELLSNET-57838”) has been resolved precisely. The fix/enhancement will be included in the next release (Aspose.Cells v25.4) scheduled for release in the first half of April 2025. You will be notified when the next version is released.
@amjad.sahi,
Glad to hear the update. It was a long pending task. Looking forward to integrate it. Please let me know the release timeline and any code changes that needs to be done in specific.
We plan to release 25.4 in two weeks and you will get notified here when it is published.
We changed the default behavor of shifting shapes when deleting blank rows above them. There is no need to change the code you used currently.
The issues you have found earlier (filed as CELLSNET-57838) have been fixed in this update. This message was posted using Bugs notification tool by leoluo
@johnson.shi , @amjad.sahi , @John.He , I installed the latest version, created a separate solution and processing logic. There the image does not seem to overlap with the content. But In my application it does not work.
Can you please help my why this inconsistency ?
Please provide us the code and template file to reproduce the issue so we can look into it. Thank you.
Please find attached the solution to replicate the issue. Can you please let us know if we are doing something wrong or is it a new issue?
deleteBlankRow.zip (377.4 KB)
We can obtain the correct results by testing on the latest version v25.5 using the following sample code. Please refer to the attachment. result.zip (585.9 KB)
Workbook wb = new Workbook(filePath + "input1.xlsx");
// Delete blank rows and columns, preserving shapes
DeleteBlankOptions options = new DeleteBlankOptions
{
DrawingsAsBlank = false
};
foreach (Worksheet sheet in wb.Worksheets)
{
sheet.Cells.DeleteBlankRows(options);
}
wb.Save(filePath + "out_net.xlsx");
However, when running the project you provided, Rows covered by images are deleted after copying range and calling Cells.DeleteBlankRows().
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-58425
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@nraj
Please copy default style, otherwise the row height is different when copying shapes, then the end row will be different too.
// Initialize converted workbook
Workbook converted = new Workbook(workBook.FileFormat);
//converted.FileFormat = ;
converted.CopyTheme(workBook);
converted.DefaultStyle = workBook.DefaultStyle;
As you want to copy all to another workbook, please simply use Workbook.Copy() method.
If you copy a chart to another workbook, the data source will be external reference as MS Excel.
If you want to remove all formulas, please use Cells.RemoveFormulas() method.
I have tested with different file and it did not work for the new file but it worked for the older file I have shared.
Please find the solution attached below
ExcelEmptyRow.zip (3.5 MB)
I tested your scenario/case using your sample app with Aspose.Cells for .NET v25.5 and the output Excel file seems OK to me. Please find attached the output Excel and PDF files for your reference.
out_net.zip (3.5 MB)
out_net.pdf (4.6 MB)
Please open the Excel/PDF file and highlight the problematic areas with notes for different sheets, so we could understand the problems and log appropriate ticket(s) for it. Also, it would be best if you could provide an Excel file with your expected results. We will check it soon.