We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Copying charts

Hi

If i have an excelworkbook (.xlsx) containg a chart formatted with a theme, and i copy the chart to another workbook using Copy function on the Worksheet. If i then save the workbook and look at the result in Excel the chart copied has the correct theme, however if i use the ToImage function on the copied chart, it shows the default colors (blue/purple), if i do the same (ToImage) on the original chart it shows the themed chart.

I am presuming i am missing some settings or something else that needs to be copied, but can't find what, can someone please help?

Many thanks,

DJ

Hi,


Could you try our latest version/fix: v7.0.3.2. If you still find the issue, kindly do paste your runnable sample code with your template files, we will check your issue soon. Also, attach your output image generated by Aspose.Cells API.

Thank you.

Hi Amjad,

Thanks for replying, i have downloaded the latest version using the link provided, but it does not make a difference, below the code used and attached are the files:

1. Book1.xlsx template file
2. Book2.xlsx output file with chart that looks like the chart in book1
3. image.png the output image file.

            Workbook wb1 = new Workbook("Book1.xlsx");
            Workbook wb2 = new Workbook();
            Worksheet sh = wb1.Worksheets["Sheet1"];
            wb2.Worksheets.Add();
            wb2.Worksheets[0].Copy(sh);
        sh = wb1.Worksheets["Chart1"];
        wb2.Worksheets.Add();
        Int32 i = 1;
        wb2.Worksheets[i].Copy(sh);
        Aspose.Cells.Charts.Chart ch = wb2.Worksheets[i].Charts[0];
        ch.NSeries.Clear();
        ch.NSeries.Add("Sheet1!B2:C3", false);
        ch.NSeries.CategoryData = "Sheet1!B1:C1";
        ch.Style = sh.Charts[0].Style;
        for (int j = 0; j < ch.NSeries.Count; j++)
        {
            ch.NSeries[j].Name = "=Sheet1!" + CellsHelper.CellIndexToName(1 + j, 0);
        }
        wb2.Save("Book2.xlsx");
        wb2.Worksheets[1].Charts[0].ToImage("image.png");

Hi,

Thanks for your sample file and the code. I was able to reproduce this issue using the latest version:
Aspose.Cells for .NET v7.0.3.2

We have logged this issue in our database. We will look into it and fix it and update you asap.

This issue has been logged as CELLSNET-40128.

Hi there, thanks for letting me know, is there any indication on how long it normally takes for these sorts of issues to be fixed?

Many thanks,

Dj

Hi,


We are working on the issue, it is not fixed yet. If the issue is not very complex, it should be fixed within a few days e.g (before the end of this week or so). If it is complex, it might take some time. Anyways, if this is complex issue, we will let you know the eta for it here.

Thank you.

Hi,

Please try the fixed version: v7.0.3.3. Your issue should be fixed in it now.


Thank you.

Hi there,

Thanks for the quick response, I have tested it and the issue is indeed resolved.

Great service, thanks.

Dj

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


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