The image Aspose.Cell captures does not look like the original excel chart

Hi @JThomas98
Aspose.Cells 24.4 is released.

In this release, we have made some improvements to the problem, we have fixed some display errors first, and some newline issues will be optimized in the future. Please use this version and then let us know your feedback, thanks!

This great news. Thank you for the update. Will let you know if this has fixed my issue.

@JThomas98,

You are welcome. Please take your time to evaluate the new version and let us know your feedback.

Hi Aspose Team,
Here’s a detailed study of what I’ve found after using aspose cells v24.4. I’ve added some pictures in this file comparing the outputs that aspose has created vs what it looks like in excel. I’ve also attached the files I’ve used for testing.
Test.zip (8.8 MB)

@JThomas98
Thank you for your feedback. We will further investigate the issues you mentioned and notify you immediately once there are any updates.

1 Like

@John.He,
Is there a way to copy a range in excel and paste it in a word document as if you were to copy using ctrl + c and paste using ctrl + v? Or even paste as picture under paste options?

@JThomas98,

There are two available options for your task. You may choose one according to your needs.

1). Aspose.Cells provides support for converting Excel file to DOCX format. To export the workbook to MS Word document (DOCX), pass SaveFormat.Docx as the second parameter of Workbook.Save method. You may also use DocxSaveOptions class to specify some additional settings (if you want) for exporting worksheet to DOCX. See the following sample code for your reference.

// Open the template file
Workbook workbook = new Workbook("Book1.xlsx");
// Save as DOCX
workbook.Save("Book1.docx", SaveFormat.Docx);

If you need to render a range of cells from an Excel file sheet, you can create the Range based on the source cells area. Create a new Workbook and define your destination Range in the worksheet. Then copy the source range to the destination range. Finally, save your new workbook as a DOCX file. Please note that you cannot open or load an existing document via Aspose.Cells, as the component is a spreadsheet management API rather than an MS Word management library (Aspose.Words is the MS Word management API). See the document on copying ranges.

2). You can create a Range based on your desired dataset in the worksheet and render it to an image or picture using Aspose.Cells APIs. Then, you can use the Aspose.Words API to insert that output picture into the Word document for your task. Please refer to the following sample code for guidance.

string filePath = "g:\\test2\\Book1.xlsx";
//Load the Excel file
Workbook workbook = new Workbook(filePath);
// Access the first worksheet
Worksheet worksheet = workbook.Worksheets["Sheet1"];
// Set the print area with your desired range in the worksheet
worksheet.PageSetup.PrintArea = "H5:M30";
//Or if you want multiple ranges from some other sheet
//worksheet.PageSetup.PrintArea = "A2:D10, H1:J40, A50:J60";

// Set all margins as 0 (if you want) to remove extra white space around your range
worksheet.PageSetup.LeftMargin = 0;
worksheet.PageSetup.RightMargin = 0;
worksheet.PageSetup.TopMargin = 0;
worksheet.PageSetup.BottomMargin = 0;
// Set OnePagePerSheet option as true
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.OnePagePerSheet = true;
options.ImageType = ImageType.Jpeg;
// Take the image of your worksheet
SheetRender sr = new SheetRender(worksheet, options);
string dataDir = "e:\\test2\\out1.jpg";
sr.ToImage(0, dataDir);

Hope, this helps a bit.

@JThomas98
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-55504

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.

Hi @JThomas98
1, For the problem of asterisks being covered by numbers, we have built a new issue processing.(CELLSNET-55504)
2, We will continue to address the remaining location issues, line wrap issue in the chart.(CELLSNET-55343)
3, On the bottom of the chart, you mentioned a line of text wrap problem, please confirm the Excel print preview effect, we refer to the print preview. Because in the Excel interface, the scaling ratio can affect line wrapping. Please refer to the two pictures below, thank you.
check1.png (34.2 KB)

check2.png (62.1 KB)

@alexey.noskov ,

Regarding the issue that the icon set and cell text are overlapped. If you don’t want to display the cell text, please check “Show Icon Only” option in “Edit Formatting Rule” as shown in the screenshot
Screenshot_icon_only.png (241.6 KB)

Thank you, @amjad.sahi. I’ll try implementing this in my code and I’ll let you know if it helps.

Thanks, @leoluo. Looking forward to it.

@JThomas98,

You’re welcome. And, sure, please try to implement the suggested option(s) for your scenario/case. Let us know if you encounter any issues.

We will keep you posted with any updates on the issues once available.

Thank you for this suggestion. I tried this out and it worked. I’d still prefer not doing this but for the time being this works.

@JThomas98,

You are welcome, and it’s good to know that the suggested approach works for your needs.

Hi Aspose team. Any updates the pending issues?

@JThomas98,

Regarding the logged issues:

  1. CELLSNET-55343 - This issue is “In Progress”. We are working on reoptimizing the modules to meet your needs. Once we implement it and figure it out, we will let you know here.
  2. CELLSNET-55504 - This issue is “Open”. Due to other important tasks at hand, we could not find time to evaluate and figure it out. We will schedule the issue soon.
1 Like

Hi @JThomas98
For CELLSNET-55343, Our current chart optimizations are as follows, which will take effect in the next release (24.5) .
240425.png (34.0 KB)

Hi @leoluo, thank you for the heads up. This is looking great!
I see one thing that’s different in the image you sent me.
In the chart, the star labels all have an outline applied to it. But some how it’s not coming through.
The stars all look different from what it is in excel.
I’ve attached an image with comparison between the picture you posted and what it is in excel
ChartComparison042524.zip (112.6 KB)

Let me know if you need more information on this. Thanks.

@JThomas98,

Thank you for providing the screenshot to highlight the issue in the provided output image that we shared above. We have noticed the issue you mentioned and have logged it with your existing ticket in our database. We will be looking into it soon.

1 Like