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!
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)
@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?
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);
@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)
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)
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.
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.
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.
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.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.