Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Jul 26, 2021 10:24 am

Hi Team,

Content like Excel Table, Image, Chart, Pivot Table can be copied as Table, Image, Chart, Pivot Table to PPT

Excel to PPT

[list=]Excel Chart to PPT Chart
Excel Table to PPT Table
Excel Pivot Table to Pivot Table
Excel Image to PPT Image[/list]

PPT to Excel

[list=]PPT Slide Table to Excel Table
PPT Slide Chart to Excel Chart
PPT Slide Image to Excel Image
PPT Slide Pivot Table to Excel Pivot Table[/list]

lijgeorge
 
Posts: 15
Joined: Fri Sep 04, 2020 9:53 am

Tue Jul 27, 2021 12:10 pm

Hello,

Thanks for your inquiry.
In fact, PPT document does not contain the pivot table object. Regarding the PPT Slide Pivot Table you mentioned, could you please provide a sample PPT file for our reference? As for your other requirements, please refer to the attached code.
If there are any problems during the test, please provide your input files for further investigation. You can send them to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Brian
E-iceblue support team
Attachments
ppt_excel.zip
(2.13 KiB) Downloaded 417 times
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Jul 28, 2021 7:09 am

Hi Brian,

Thank you for sharing the code.

While implementing the code, we have got an error.

Code: Select all
for (int j = 0; j < chart.DataRange.Rows[i].CellList.Count; j++)


Error

Error CS1061 'CellRange' does not contain a definition for 'CellList' and no accessible extension method 'CellList' accepting a first argument of type 'CellRange' could be found (are you missing a using directive or an assembly reference?) ExcelToPPT POC C:\Users\lijgeorge\source\repos\ExcelToPPT POC\ExcelToPPT POC\Program.cs 218 IntelliSense Active Compiler

Current Spire Office Version:

.nuget\packages\freespire.office\4.3.1

lijgeorge
 
Posts: 15
Joined: Fri Sep 04, 2020 9:53 am

Wed Jul 28, 2021 10:19 am

Hello,

Thanks for your inquiry.
I am sorry that the free version does not define this property. Please use the code below instead.
Code: Select all
CellList -> Cells
CellList.Count -> CellsCount

At the same time, the free version does not support getting pictures in Excel files. And we only update the free version irregularly. If you need to use this feature, please directly use our commercial version (the latest version is Spire.Office Platinum(Hotfix) Version:6.7.0).

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Thu Jul 29, 2021 10:37 am

Hi Brian,

Code :

Code: Select all
 IChart pptChart = slide.Shapes.AppendChart(ChartType.BarClustered, rect1, false);
                for (int i = 0; i < chart.DataRange.Rows.Length; i++)


Issue

chart.DataRange is null

Files Attached
Source Excel
Error Screen

Question :

Is there any option to copy the Charts and Tables as is without remapping the properties, like copy paste feature using Clipboard in Windows.
Attachments
Basic.zip
Source Excel File
(231.18 KiB) Downloaded 317 times
Error Spire Chart Data Range.png
Error Screenshot
Error Spire Chart Data Range.png (163.58 KiB) Viewed 3566 times

lijgeorge
 
Posts: 15
Joined: Fri Sep 04, 2020 9:53 am

Fri Jul 30, 2021 9:20 am

Hello

Thanks for your feedback.
Regarding the issue “chart.DataRange is null”, I tested your case and did reproduce your issue. I have logged it in our bug tracking system with the ticket SPIREXLS-3378. We will let you know as there is any update.
As for using the clipboard to copy and paste charts and tables in Windows, I am sorry that our Spire.Office does support similar features. Apologize for the inconvenience caused.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Aug 04, 2021 4:28 am

Hi Brian,

I hope you are doing well.

Kindly let me know the update on above request ?

Thank You
Lijo George

lijgeorge
 
Posts: 15
Joined: Fri Sep 04, 2020 9:53 am

Wed Aug 04, 2021 10:13 am

Hello Lijo,

Thanks for your follow up.
I just communicated with our developers and learned that this issue is caused by that the chart in your worksheet is a composite chart, and the data source is not continuous, it is actually not possible to get the data range. You can use Microsoft Excel to view the data range of the chart (Right click the chart -> Select Data), you will find that the data range is empty. Our Spire.XLS is based on Microsoft Excel. I'm sorry that there is no way to solve this issue. Hope you can understand and apologize for the inconvenience caused.
screenshot.png
screenshot.png (49.98 KiB) Viewed 3363 times

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Aug 11, 2021 5:23 am

Hi Brian,

Could you confirm if grouped objects like Charts, Images can be converted in Image using Spire.

I am able to convert individual chart or image to image, but not able to find grouped images or charts.

Thank You
Lijo George

lijgeorge
 
Posts: 15
Joined: Fri Sep 04, 2020 9:53 am

Wed Aug 11, 2021 9:48 am

Hello Lijo,

Thanks for your inquiry.
I am sorry that our Spire.XLS does not yet support the feature you mentioned. But I have added it as a new feature into our upgrade list with the ticket SPIREXLS-3392. Once it is achieved, we will let you know. Apologize for the inconvenience caused.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Thu Aug 12, 2021 10:03 am

Hi Brian,

I am looking to get Table data using Table name from an Excel Sheet to Image and Copy Table content to another sheet .

Kindly help me out .

Thank You
Lijo George

lijgeorge
 
Posts: 15
Joined: Fri Sep 04, 2020 9:53 am

Fri Aug 13, 2021 7:54 am

Hello Lijo,

Thanks for your inquiry.
Please refer to the following code to meet your needs.
Code: Select all
            Workbook workbook = new Workbook();
            workbook.LoadFromFile("test.xlsx");

            INamedRange namedRange = workbook.NameRanges.GetByName("Your table name");
            CellRange range = namedRange.RefersToRange as CellRange;
            IWorksheet srcWorksheet = range.Worksheet;

            srcWorksheet.SaveToImage(range.Row, range.Column, range.LastRow, range.LastColumn).Save("image.png", ImageFormat.Png);

            Worksheet targetWorksheet = workbook.Worksheets.Add("target");
            range.Copy(targetWorksheet.Range[range.Row, range.Column, range.LastRow, range.LastColumn]);

            workbook.SaveToFile("result.xlsx",ExcelVersion.Version2016);

If this cannot help you, please provide your input file and your desired output for further investigation. You can send them to us (support@e-iceblue.com) via email, thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Tue Sep 14, 2021 11:34 am

Hello Lijo,

Greetings from E-iceblue!
Glad to inform you that we just released Spire.XLS Pack(Hotfix) Version:11.9.2 which supports converting grouped Charts and grouped Images to an Image, please download it from the following links to test on your side. Looking forward to your test result.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.XLS/11.9.2

The sample code as below.
Code: Select all
List<Bitmap> images = sheet.SaveShapesToImage(new SaveShapeTypeOption());
for (int i = 0; i < images.Count; i++)
{
    images[i].Save(string.Format(outputFile + "Bug_3392_1-{0}.png", i), ImageFormat.Png);
}


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.XLS