Reputation: 2718
I wanted to assign the object text as an rtf text using richText method. I got a strange behavior with the tables inside rtf.
using the same code == tables appears in the text of the object in windows XP but doesn't appear in windows 7. is this a known issue in windows 7 ?
Object o = current
o."Object Text" = richText("{\\rtf1 \\viewkind4
{\\colortbl;\\red0\\green0\\blue0;}
{\\stylesheet
{\\s1\\fs20 heading 1;}
{\\s2\\fs20 heading 2;}
{\\s17\\fs20 Body Text;}
{\\s22\\fs20 List Bullet;}
}
{\\info}
\\pard\\plain \\s17 \\fs20 {Here is a table:\\par}
\\trowd\\trhdr\\trqc\\trbrdrt\\brdrs\\brdrw30\\trbrdrb\\brdrs\\brdrw30\\trbrdrl\\brdrs\\brdrw30\\trbrdrr\\brdrs\\brdrw30\\trbrdrh\\brdrs\\brdrw15\\trbrdrv\\brdrs\\brdrw15\\plain\\pard\\s17 \\fs20 \\trgaph70\\intbl
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx4530
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx9060 \\pard\\plain \\b\\qc \\intbl{Column One\\cell }\\pard\\plain \\b\\qc \\intbl{Column Two\\cell }\\row
\\trowd\\trqc\\trbrdrt\\brdrs\\brdrw30\\trbrdrb\\brdrs\\brdrw30\\trbrdrl\\brdrs\\brdrw30\\trbrdrr\\brdrs\\brdrw30\\trbrdrh\\brdrs\\brdrw15\\trbrdrv\\brdrs\\brdrw15\\plain\\pard\\s17 \\fs20 \\trgaph70\\intbl
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx4530
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx9060 \\pard\\plain \\s17 \\fs20 \\intbl{Item One\\cell }\\pard\\plain \\s17 \\fs20 \\intbl{Value One\\cell }\\row
\\trowd\\trqc\\trbrdrt\\brdrs\\brdrw30\\trbrdrb\\brdrs\\brdrw30\\trbrdrl\\brdrs\\brdrw30\\trbrdrr\\brdrs\\brdrw30\\trbrdrh\\brdrs\\brdrw15\\trbrdrv\\brdrs\\brdrw15\\plain\\pard\\s17 \\fs20 \\trgaph70\\intbl
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx4530
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx9060 \\pard\\plain \\s17 \\fs20 \\intbl{Item Two\\cell }\\pard\\plain \\s17 \\fs20 \\intbl{Value Two\\cell }\\row
\\trowd\\trqc\\trbrdrt\\brdrs\\brdrw30\\trbrdrb\\brdrs\\brdrw30\\trbrdrl\\brdrs\\brdrw30\\trbrdrr\\brdrs\\brdrw30\\trbrdrh\\brdrs\\brdrw15\\trbrdrv\\brdrs\\brdrw15\\plain\\pard\\s17 \\fs20 \\trgaph70\\intbl
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx4530
\\clbrdrt\\brdrs\\clbrdrb\\brdrs\\clbrdrl\\brdrs\\clbrdrr\\brdrs\\cellx9060 \\pard\\plain \\s17 \\fs20 \\intbl{Item Three\\cell }\\pard\\plain \\s17 \\fs20 \\intbl{Value Three\\cell }\\row
\\pard\\plain \\s17 \\fs20 {\\par}
}")
string attr = o."Object Text"
print attr
and this is the screenshot in windows XP
and this on 7
Upvotes: 0
Views: 1300
Reputation: 1892
I see the same issue you do when I use your code. However when I copy the RTF table from XP to DOORS in Windows 7 the table displays fine. So I ran a short script to see what the difference is in the RTF code:
Object o = current
print richText(o."Object Text")
Here is the output:
{\\rtf1\\ansi\\ansicpg1252\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}}
{\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\trowd\\trgaph70\\trpaddl70\\trpaddr70\\trpaddfl3\\trpaddfr3
\\cellx4530\\cellx9060\\pard\\intbl\\qc\\lang1033\\b\\f0\\fs20 Column One\\cell Column Two\\cell\\row\\trowd\\trgaph70\\trpaddl70\\trpaddr70\\trpaddfl3\\trpaddfr3
\\cellx4530\\cellx9060\\pard\\intbl\\b0 Item One\\cell Value One\\cell\\row\\trowd\\trgaph70\\trpaddl70\\trpaddr70\\trpaddfl3\\trpaddfr3
\\cellx4530\\cellx9060\\pard\\intbl Item Two\\cell Value Two\\cell\\row\\trowd\\trgaph70\\trpaddl70\\trpaddr70\\trpaddfl3\\trpaddfr3
\\cellx4530\\cellx9060\\pard\\intbl Item Three\\cell Value Three\\cell\\row\\pard\\par
}
I am thinking that there may be some tags you are missing in your code that would allow it to work on both Windows 7 and XP. If you replace your RTF with this code, it works in both XP and 7.
Upvotes: 1