Unable to screenshot chart that uses spill formulas

Aspose Team,

We’ve come across an odd issue using Spill Formulas with charts. The attached workbook creates a chart over a range of spilled data. Named ranges need to be used to chart the spill data since Microsoft doesn’t fully support the Spill syntax (#) in the Select Data screens. Charting spill data is supported though. The problem we’re seeing in Aspose is that we can not take a screenshot of a range that includes this chart. The screenshot comes back as blank.

We have isolated the problem to the CHOOSECOLS formula in the Data named range with formula =CHOOSECOLS(‘Sheet 1’!$G$4#,2). If you change this formula to point directly to the spill range =E4#, then the screenshot will appear as expected.

Here’s the code for the screenshot.

        var filename = @"C:\Data\Systems\Demo\Reports\Support\SpillFormulaInChart.xlsx";
        var workbook = new Workbook(filename);
        var worksheet = workbook.Worksheets["Sheet 1"];

        MemoryStream stream = new MemoryStream();

        worksheet.PageSetup.PrintArea = "K2:Q15";
        worksheet.PageSetup.LeftMargin = 0;
        worksheet.PageSetup.RightMargin = 0;
        worksheet.PageSetup.TopMargin = 0;
        worksheet.PageSetup.BottomMargin = 0;

        SheetRender sr = new SheetRender(worksheet, new ImageOrPrintOptions
        {
            OnePagePerSheet = true,
            ImageType = Aspose.Cells.Drawing.ImageType.Png,
            HorizontalResolution = 200,
            VerticalResolution = 200,
            Transparent = true,
            OnlyArea = true,
        });

        sr.ToImage(0, stream);
        stream.Seek(0, SeekOrigin.Begin);

        stream.Rewind();
        using (FileStream fs = File.Create("ChartScreenshot.png"))
        {
            stream.CopyTo(fs);
            fs.Close();
        }

SpillFormulaInChart.zip (14.6 KB)

@weissa,

Thanks for the template XLSX file.

After an initial testing, I am able to reproduce the issue as you mentioned by using your template file. I found I could not take screenshot for the chart that uses spill formulas.
We need to investigate your issue in details. 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-53582

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.

@amjad.sahi,
I was wondering if there is an update on issue CELLSNET-53582. I would like to pass along an update to our customer if there is any news to share.

Thank You,
-Andy

@weissa,

I am afraid, your issue is not resolved yet. We are still working over it. We will check if we could provide latest updates or a possible ETA on it.

We will get back to you soon.

@weissa,

We have just finished the fix and test for this issue. The fix will be included into the new release 23.7 which will be available today.

@johnson.shi,

This is fantastic news, thank you for the update.
-Andy

@weissa,

You are welcome.

The issues you have found earlier (filed as CELLSNET-53582) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

1 Like