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

Free Support Forum - aspose.com

RTL - % symbol appears at the start of the cell followed by the number (only for specific cells)

Hi Team,

I am trying to show percentages in a column. And for RTL it seems to show % symbol at the start of the value which supposed to be at the end of the value. But this happens only for specific cells. Attached the generated ppt. Please help!!!

Thanks,
Priya

Hi Priya,

I have observed your comments and request you to please provide the source presentation and working sample code to further investigate the issue on our end. Please also provide the snapshot highlighting your requirement on chart. We will investigate the issue further once requested information will be shared.

Many Thanks,

Hi,

Please find the attached PPT. The open and close brackets appear weird in the header for the RTL languages. I am atatching two PPTs with the issue with open close brackets and % symbol.

Attached ppts for brackets (QVExport(8).pptx slide no.:7)
and % symbol issue (QuickView for KT(1) (1).pptx)

Please check the below code that I am using for the table paragraphs for RTL. Code contains some logic to handle if the columns has stacked bars or other shapes.

public static void ConvertTableWithBarsToRTL(ISlide slide, ITable table, Dictionary<string, IList> barShapes, bool isBreakoutsTbl = false)
{
table.RightToLeft = true;
int rowCount = 0;
int barOffSetRowStart = isBreakoutsTbl ? 3 : 0;
Dictionary<string, double> barOffSetDictionary = new Dictionary<string, double>();
if(barShapes == null)
barShapes = new Dictionary<string, IList>();
int barColumnIndex = -1;

foreach (var key in barShapes.Keys)
{
barOffSetDictionary.Add(key, -1);
}

bool calcBarOffset = true;
double offSet = 0;
foreach (IRow row in table.Rows)
{
if (rowCount == barOffSetRowStart && calcBarOffset && barShapes.Count > 0)
{
foreach (var key in barShapes.Keys)
{
offSet = 0;

barColumnIndex = Int32.Parse(key);
for (int i = 1; i < row.AsICellCollection.Count - barColumnIndex; i++)
{
offSet += row.AsICellCollection[barColumnIndex + i].Width;
}
barOffSetDictionary[key] = offSet;
}

calcBarOffset = false;
}

for (int x = 0; x < table.Columns.Count; x++)
{
var cells = row.AsICellCollection;
int lastMergedCellIndex = GetLastMergedCellIndex(x, cells);
var cellText = cells[x].TextFrame.Text;
var cell = cells[x];
int isNumeric;

//Don’t set the paragragh to RTL if it’s bar column and it’s not header row.
//Exceptions: NA text, numberic or percentage text
if (barShapes.ContainsKey(x.ToString()) && rowCount != 0 && (string.IsNullOrEmpty(cellText) || (cellText.Contains("%") || Int32.TryParse(cellText, out isNumeric))))
{
continue;
}
cell.TextFrame.OnEachParagraph(ConvertParagraphToRTL);

if (lastMergedCellIndex > x)
{
x = lastMergedCellIndex >= cells.Count - 2 ? lastMergedCellIndex : lastMergedCellIndex + 1;
}
}

rowCount++;
}

foreach (var key in barShapes.Keys)
{
if (barShapes[key].Count > 0)
{
foreach (var s in barShapes[key])
{
s.X = (float) (table.X + barOffSetDictionary[key] + Configuration.HorizontalPadding);
}
}
}
}

public static void ConvertParagraphToRTL(IParagraph paragraph)
{
paragraph.ParagraphFormat.RightToLeft = NullableBool.True;
paragraph.ParagraphFormat.Alignment = TransformToRTLAlignment(paragraph.ParagraphFormat.Alignment);
var cellText = paragraph.Portions[0].Text;
double isTextDouble;
int isTextInteger;
//If the text doesn’t a have decimal point, we need to add the control marker to the full-stop.
if (cellText.Contains(".") && !(Int32.TryParse(cellText, out isTextInteger) || Double.TryParse(cellText, out isTextDouble)))
{
paragraph.Portions[0].Text = cellText.Replace(".", “\u200F” + “.”);
}
if (cellText.Contains("-"))
{
paragraph.Portions[0].Text = cellText.Replace("-", “\u200F” + “-”);
}

/if (paragraph.Text.Contains("(") && paragraph.Text.Contains(")"))
{
ProcessBrackets(paragraph);
}/
}

Hi Priya,


I have observed your comments. An issue with ID SLIDESNET-38468 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

We are sorry for your inconvenience,

Team,

Could you please let me know if there is any resolution for this?

Thanks!!

Hi Priya,


I have observed your comments. I regret to inform that issue is still unresolved and in progress for investigation by our product team. I have requested our product team to share further feedback regarding this issue. I request for your patience until further feedback is shared by our product team.

We are sorry for your inconvenience,