Format lost when setting text in table

Hello,


I have a slide with a table in it. The table has formats set such as FontHight. When I clone the slide and set the content of the Portion in a cell, the format is lost.

Please find attached an example for your reproduction.

Slide Aspose_Table_format_loss.pptx has a table. The FontHight for the cells is 12. The cells are empty.

I am trying to set the value using two alternatives

var templatePath = Path.Combine(@"[SLIDEPATH]", “Aspose_Table_format_loss.pptx”);
var pres = new Presentation(templatePath);
var slide = pres.Slides[0];

var table = (Aspose.Slides.ITable)(from shape in slide.Shapes
where shape is Aspose.Slides.ITable && shape.AlternativeText == “tabelle”
select (Aspose.Slides.ITable)shape).Single();

// First alternative, set the value directly
table[1,1].TextFrame.Paragraphs[0].Portions[0].Text = “High”;

// Second alternative: clone portion and add new one
var valuePortion = new Portion((Portion)table[1,2].TextFrame.Paragraphs[0].Portions[0]) { Text = “High” };
table[1,2].TextFrame.Paragraphs[0].Portions.Add(valuePortion);



Presentation newPres = new Presentation();
newPres.Slides.AddClone(slide);

newPres.Save(Path.Combine(@"[SLIDEPATH]", @“Aspose_Table_format_loss__.pptx”) , Aspose.Slides.Export.SaveFormat.Pptx);

Thank you for your help!

Hi Nasser,

Thank you for sharing the sample file and code.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: SLIDESNET-36164. You will be notified via this forum thread once the issue gets resolved.

Thanks & Regards,

Hello Owais,


is it possible at all to change the context of a table-cell while retaining the format? I am trying all possible approaches and the format is lost regardless. Is there a work-around that I can use? For example, is it possible to find out what the original FontHight of the cell is? All properties I found pertaining to FontHeight show NaN as a value.

Please this is a really basic function and I am certain that there should be a way to change the value whilst maintaing the format!

Best regards

Hi Nasser,

Well, the property to get the font height information is as following:

table[1, 1].TextFrame.Paragraphs[0].Portions[0].PortionFormat.FontHeight;

However, as you have mentioned, this value is returning NaN for the existing table in the presentation file you shared. I have reproduced the issue at my end and registered the issue in our issue tracking system with issue id: SLIDESNET-36177. Our development team will further look into this issue and you will be notified via this forum thread once the issue gets resolved.

Thanks & Regards,

Hello Owais,


this bug was introduced in the latest version (15).
Can you please confirm that this problem was introduced with the latest version?
I have tested the last version (14) and the behavior of the Table is as expected when cloning portions, i.e. Formats are copied.

This relates to SLIDESNET-36164 as well as SLIDESNET-36177.

This is a major and serious problem for anyone that wants to reuse formatting from existing slides, which is a reason to use Aspose in the first place. Being unable to set a value in a cell in a table without losing all formatting is a major setback. At the same time, I cannot return to the last version, because other bugs were solved.

Thank you for your help.

Hi Nasser,

Please share the complete version of Aspose.Slides for .NET v14.x.x you are using at your end which is working fine. We will check the issue for treating it as a regression at our end.

Thanks & Regards,

Hello Owais,


I am testing against 14.10.0.

Best regards

Hello Owais,


this issue probably also relates this issue as well. Setting the color of the text in Version 14.10 works perfectly.

Best regards

Hi Nasser,

Thank you for sharing the details.

I am able to reproduce the regression issues regarding cell font and height. Both the issues are now registered as Regression issues. Regarding setting the text color issue, it has already been replied in the relevant thread. Please check it and let us know if you are still facing the issue.

Thanks & Regards,

Hello Owais,


thank you for your message.

Setting the color is also related. If you have a table in a slide where the text has colors and you re-set the text, the color formatting is lost. I asked the question because the slides I have on disk have cells with text that has a different color than default. When I set the text of these cells, the color formatting is lost. This is identical to the issue of Font and Hight.

In order to reproduce this, please do the following
- in the slide Aspose_Table_format_loss.pptx give the text in the cell [1,1] a different color than black
- in the code, set the text of the cell, just the text, don’t change any formatting
- when you save the slide you will see that the text has lost it’s color formatting

This is really critical. I need to deliver slides in the coming days and I have a lot (> 100) of tables that have been formatted where I “inject” data. I would really appreciate it if you would give some information about the timeframe for solving this regression issue. This would be very helpful in determining how to go about this problem.

Best reagrds

Hi Nasser,

Thank you for the details.

I tried replicating the issue by following the steps mentioned by you but I am unable to reproduce the issue. Please share the input file and also let us know some details about your system environment i.e. OS, .NET Framework, MS PowerPoint version etc. We will check it and get back to you.

Thanks & Regards,

Hello,


due to the problems formatting the content of cells, I had to revert to the version 14.10. However, this causes a different issue to show up again.

Bar Chart Preset NoShadow - #4 by owais.ahmad - Free Support Forum - aspose.com

All charts in the slides now have shadows. Could you please show me how to reset the shadow to no shadow? It is possible to do this in Powerpoint, so how can i do this using the Aspose API.

Again, I cannot use the current version because I have 100’s of tables that need to be reformatted. 14.10 works well with tables. My deadline is days away and I would really appreciate your support on this issue.

Best regards

Hello,


any news on this regression error?

I would really appreciate it if you could provide some timeline for solving the issue.

Best regards

Hi Nasser,

I have verified from our issue tracking system and regret to share that the issues are still pending for investigation in our normal priority support queue. I have requested our development team to share the feedback in this regard. I will share the information with you as soon as it will be shared by our development team.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-36177;SLIDESNET-36164) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.