Aspose Update 17.8 - 18.7 Clone template slides problem

Hi
We have updated Aspose.slides from version 17.8 to 18.7, and have some trouble with the downloaded PowerPoint files, when we are trying to clone them.
We are using aspose.slides to generate PowerPoint files online, from templates created by us.

After the update (with version 18.7) when one slide is copied (clone method) from a template into another PowerPoint template file, not every data is displayed or no data displayed at all on the PowerPoint charts.
We have to open the downloaded PowerPoint file and manually edit these charts to appear the data.
(we are using PHP for back end coding and Javabridge to communicate with Java environment, it is working good we have no problem with it)

Please see examples for generated ppt files below

Could you please advise, what is the problem and how can it be solved?
Thank you

ppt_screenshot_1.JPG (87.0 KB)

ppt_screenshot_2.JPG (103.2 KB)

ppt_screenshot_3.JPG (67.1 KB)

ppt_screenshot_4.JPG (68.1 KB)

@weinachta,

I have observed your comments. Can you please share source files so that we may further investigate to help you out.

Hello
Find on below link:

@weinachta,

I have observed your comments. Can you please share generated result with us for further investigation to help you out.

To demonstrate our problem we created a demo code.
with version 18.7, when one slide is copied (clone method) from a template into another PowerPoint template file, not every data is displayed or no data displayed at all on the PowerPoint charts. We have to open the downloaded PowerPoint file and manually edit these charts to appear the data.

The below demo is working with two template.
We add one slide from the 2nd template to the 1st template. For the simplicity the code overwrites the demo data with itself. Our problem is also occurs with this simple example.
Please find on below link the code and the source and target ppt files, and also our running result with version 17.8 and with version 18.7

Thank you, let me know if you need something else

/**
 * @Route(name="aspose", path="/aspose")
 *
 * @return Response
 *
 * @throws SiqException
 * @throws \java_IllegalArgumentException
 * @throws \java_IllegalStateException
 */
public function asposeDemoAction(): Response
{
    $fileName = 'report.pptx';

    $templateFileTarget = '/home/weinacht/DBV/siq/PPT/templates/target.pptx';
    $templateFileSource = '/home/weinacht/DBV/siq/PPT/templates/source.pptx';

    // Init JavaBridge and Aspose.Slides services. It is not important for demonstrate our problem.
    $this->get('dbv.siq.javabridge');
    $this->get('dbv.siq.aspose.slides');

    // Open target presentation
    $presentationTarget = new Java('com.aspose.slides.Presentation', $templateFileTarget);
    $targetPresentationSlides = $presentationTarget->getSlides();

    // Open second presentation
    $presentationSource = new Java('com.aspose.slides.Presentation', $templateFileSource);

    // Get the slides of source presentation
    $sourcePresentationSlides = $presentationSource->getSlides();
    $numberOfSlides = java_values($sourcePresentationSlides->size());

    //Iterating through all slides
    for ($i = 1; $i <= $numberOfSlides; $i++)
    {
        $slide = $sourcePresentationSlides->get_Item($i - 1);

        // Replace chart Content
        // Get all charts from slide
        $shapes = $slide->getShapes();
        $shapeList = (array) java_values($shapes->toArray());
        $charts = [];
        foreach ($shapeList as $shape) {
            if (java_instanceof($shape, Java('com.aspose.slides.Chart'))) {
                $charts[] = $shape;
            }
        }

        // Iterating through all charts
        foreach ($charts as $chart) {
            $seriesCollection = $chart->getChartData()->getSeries();
            $categoryCollection = $chart->getChartData()->getCategories();
            $seriesNumbers = java_values($seriesCollection->size());
            $categoryNumbers = java_values($categoryCollection->size());

            // Traverse through every chart categories
            $valueToWriteToCell = null;
            for ($categoryIndex = 0; $categoryIndex < $categoryNumbers; ++$categoryIndex) {
                $category = $categoryCollection->get_Item($categoryIndex);
                if (java_values($category->getUseCell())) {
                    $categoryCell = $category->getAsCell();
                    $categoryCell->setValue(java_values($categoryCell->getValue()));
                }
            }

            // Traverse through every chart series
            $actSeriesIndex = null;
            for ($seriesIndex = 0; $seriesIndex < $seriesNumbers; ++$seriesIndex) {
                $seriesHaveData[$seriesIndex] = false;
                $series = $seriesCollection->get_Item($seriesIndex);
                $series->setInvertIfNegative(false);

                // Set series cell's
                $seriesCellCollection = $series->getName()->getAsCells();
                $seriesCellNumber = java_values($seriesCellCollection->getCount());
                for ($seriesCellIndex = 0; $seriesCellIndex < $seriesCellNumber; ++$seriesCellIndex) {
                    $seriesCell = $seriesCellCollection->get_Item($seriesCellIndex);
                    $seriesCell->setValue(java_values($seriesCell->getValue()));
                }

                // Get series dataPointCollection
                $dataPointCollection = $series->getDataPoints();
                $dataPointNumbers = java_values($dataPointCollection->size());

                // Traverse through every series's dataPointCollection
                $valueToWriteToCell = null;
                for ($dataPointIndex = 0; $dataPointIndex < $dataPointNumbers; ++$dataPointIndex) {
                    $dataPoint = $dataPointCollection->get_Item($dataPointIndex);

                    // Set dataPoint's label
                    $dataLabel = $dataPoint->getLabel();
                    $dataLabelTextFrame = $dataLabel->getTextFrameForOverriding();
                    $dataLabelTextFrame->setText(java_values($dataLabelTextFrame->getText()));

                    // Set dataPoint's value (cell)
                    if (java_values($dataPointCell = $dataPoint->getValue()->getAsCell())) {
                        // The two replace add the same result.
                        // Replace by data point cell
                        try {
                            $data = java_values($dataPointCell->getValue());
                            $dataPointCell->setValue($data);
                        } catch (\JavaException $exception) {
                            // Nothing to do. This code is just demonstrate a problem.
                        }
                        // Replace by data point value

// $dataValue = $dataPoint->getXValue();
// $dataValue->setData(java_values($dataValue->getData()));
}

                    // Set dataPoint's Xvalue (cell)
                    if (java_values($dataPointCell = $dataPoint->getXValue()->getAsCell())) {
                        // The two replace add the same result.
                        // Replace by data point cell
                        try {
                            $data = java_values($dataPointCell->getValue());
                            $dataPointCell->setValue($data);
                        } catch (\JavaException $exception) {
                            // Nothing to do. This code is just demonstrate a problem.
                        }
                        // Replace by data point value

// $dataValue = $dataPoint->getXValue();
// $dataValue->setData(java_values($dataValue->getData()));
}

                    // Set dataPoint's Yvalue (cell)
                    if (java_values($dataPointCell = $dataPoint->getYValue()->getAsCell())) {
                        // The two replace add the same result.
                        // Replace by data point cell
                        try {
                            $data = java_values($dataPointCell->getValue());
                            $dataPointCell->setValue($data);
                        } catch (\JavaException $exception) {
                            // Nothing to do. This code is just demonstrate a problem.
                        }
                        // Replace by data point value

// $dataValue = $dataPoint->getXValue();
// $dataValue->setData(java_values($dataValue->getData()));
}
}
}
}

        // Clone slide
        $targetPresentationSlides->addClone($slide);
    }

    // Get presentation
    $save_format = Java('com.aspose.slides.SaveFormat');
    $memoryStream = new Java('java.io.ByteArrayOutputStream');
    $presentationTarget->save($memoryStream, $save_format->Pptx);
    $memoryStream->close();
    $presentationContent = java_values($memoryStream->toByteArray());

    // Create the response
    try {
        $response = new Response($presentationContent, 200);
    } catch (\Exception $exception) {
        throw new SiqException('Presentation export issue.', 0, $exception);
    }

    // Adding headers
    $response->headers->set('Content-Type', 'application/vnd.ms-powerpoint');
    $response->headers->set('Content-Disposition', 'attachment;filename="' .$fileName. '"');
    $response->headers->set('Pragma', 'public');
    $response->headers->set('Cache-Control', 'max-age=1');

    return $response;
}

@weinachta,

I have observed your comments. A ticket with ID SLIDESJAVA-37303 has been added in our issue tracking system to resolve the issue. This thread has been associated with the ticket so that we share notification with you once issue will be fixed.

Hi, Adnan.Ahmad

We are here again,

We have updated Aspose.Slides from version 17.8 to 18.10 (newest version) and the problem is the same what we have mentioned above.

We tested our demo example what we uploaded for you last time

and the problem has not resolved.

Here are the new demo source and results files.

We’d like to update our Aspose.Slides from old version to new one and it is important to work everything properly as before!

Could you please advise, what is the problem and how can it be solved?

Thank you

@weinachta,

I have verified the issue status from our issue tracking system and regret to share that concerned internal issue is still unresolved owing to internally blocking issue. We will share the good news with you as soon as the issue will be fixed and request for your patience in this regard.

hi @mudassir.fayyaz,

I wonder if this issue has been fixed?

I ask you for an update this issue.

Thank you

@weinachta-1,

I have verified from our issue tracking system and regret to share that at present the issue is still unresolved. However, I have requested team to share updates and will share them as soon as they will be available.

@mudassir.fayyaz

If we purchase paid support, will it help resolve the blocker issue and are you able to guarantee a fix with a deadline?

@weinachta-1,

If you avail paid support option the issue shall be considered on raised priority level. However, based on nature and complexity of issues the development may take some time. However, the paid support is still expedited as against normal support.

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