Table column widths not preserved with RTF round trip

6 posts, 0 answers
  1. Brian Sayatovic
    Brian Sayatovic avatar
    91 posts
    Member since:
    Nov 2009

    Posted 16 May 2012 Link to this post

    We're using Silverlight Controls 2012 Q1 (2012.1.0215.1050).  Our RichTextBox is used to edit and save RTF content to our database.  Upon creating a table with specific widths, it looks OK in the editor before save (see TablesBefore.png).  But when we re-load the same content, the column widths of the table are reverted to being equal widths (see TablesAfter.png).

    I've tried setting the widths via dragging the column dividers, using the properties dialog to set them in pixels, and using the properties dialog to set them in percents.  None of these approaches work after re-loading the file.

    I did notice that if I copy the contents to the clipboard, and later paste into a reverted document, the pasted content does preserve the column widths of a pasted table.

    I have not yet grabbed the bytes out of the database to save to a file to determine if it is a problem with save or load.

    In searching these forums, I found several similar issues reported for HTML import/export, etc.; however, while those are all claimed to be resolved, none seemed to apply to my problem which -- through direct observation -- is not resolved.
  2. Brian Sayatovic
    Brian Sayatovic avatar
    91 posts
    Member since:
    Nov 2009

    Posted 16 May 2012 Link to this post

    I grabbed the bytes out of our database and saved them as an *.rtf file, and loaded it into Microsoft Word.  Word shows the tables with their appropriate widths (see RichTextBoxRtfTablesLoadedInWord.png).  This suggests it is not a save problem, but a load problem. 
  3. DevCraft banner
  4. Brian Sayatovic
    Brian Sayatovic avatar
    91 posts
    Member since:
    Nov 2009

    Posted 16 May 2012 Link to this post

    I can't attach the *.rtf file; blocked by forums.  However, it's small, so here's its raw content:

    {\rtf\ansi\ansicpg1252\uc1\deff0\deflang1033{\fonttbl{\f0 Verdana;}}{\colortbl\red0\green0\blue0 ;\red255\green255\blue255 ;\red0\green0\blue0 ;}{\*\defchp\ltrch\fs24\i0\b0\strike0\ulnone}{\*\defpap\fs24\sl276\slmult1\sa180}{\stylesheet{\*\ts2\tsrowd\sqformat\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trgaph0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\tsvertalt\ltrch\fs24\i0\b0\strike0\ulnone\fs24\sl276\slmult1\sa180 TableNormal;}{\*\ts3\tsrowd\sqformat\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trgaph0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\tsvertalt\ltrch\fs24\i0\b0\strike0\ulnone\fs24\sl240\slmult1 TableGrid;}}\nouicompat\viewkind4\paperw12240\paperh15840\margl1425\margr1425\margt1425\margb1425\deftab720\sectd\pgwsxn12240\pghsxn15840\marglsxn1425\margrsxn1425\margtsxn1425\margbsxn1425\headery720\footery720\pard\ltrpar\fs24\sl276\slmult1\sa180{\ltrch\i0\b0\strike0\ulnone}\par{\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 1"}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 2"}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 3"}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone 4"}\cell\trowd\irow0\irowband0\ts3\ltrrow\trgaph0\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trwWidth5000\trftsWidth2\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx1410\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx4290\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx8595\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx14460\row\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone A}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone B}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone C}\cell\pard\yts3\ltrpar\intbl\itap1\fs24\sl240\slmult1{\ltrch\i0\b0\strike0\ulnone D}\cell\trowd\irow1\irowband1\ts3\ltrrow\lastrow\trgaph0\trbrdrt\brdrs\brdrw15\brdrcf0\trbrdrb\brdrs\brdrw15\brdrcf0\trbrdrl\brdrs\brdrw15\brdrcf0\trbrdrr\brdrs\brdrw15\brdrcf0\trbrdrh\brdrs\brdrw15\brdrcf0\trbrdrv\brdrs\brdrw15\brdrcf0\trwWidth5000\trftsWidth2\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx1410\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx4290\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx8595\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf0\clbrdrb\brdrs\brdrw15\brdrcf0\clbrdrl\brdrs\brdrw15\brdrcf0\clbrdrr\brdrs\brdrw15\brdrcf0\clpadft3\clpadt75\clpadfr3\clpadr75\clpadfl3\clpadl0\clpadfb3\clpadb0\cellx14460\row}\pard\ltrpar\fs24\sl276\slmult1\sa180{\ltrch\i0\b0\strike0\ulnone}\par}
  5. Alex
    Admin
    Alex avatar
    129 posts

    Posted 21 May 2012 Link to this post

    Hello,

    Thanks for bringing this issue to our attention. It is indeed a problem when loading the document. The reason that the column widths are not accurately imported is that we rely on the \clwWidth and \clftsWidth RTF tags to be able to read the exact width of the imported cells. Most RTF editors do export this control words when creating RTF files containing tables. However, this is not the case.
    It should be possible to reconstruct the correct layout of the table using only the \cellx control words which are present in the document you've sent, but currently we don't support this. We will add this to our to do list, however I cannot give you exact timeline of when this will be implemented. 
    Please don't hesitate to contact us again if you have more questions.

    Greetings,
    Alex
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Brian Sayatovic
    Brian Sayatovic avatar
    91 posts
    Member since:
    Nov 2009

    Posted 21 May 2012 Link to this post

    To be clear, the RTF which I provided came from the RichTextBox.  So the missing \clwWidth and \clftsWidth are missing because the RichTextBox did not export them.  I'd be perfectly happy in the short-term if the RichTextBox could export these values so that a round trip was reliable (that is the user experience our users are presently frustrated by).
  7. Alex
    Admin
    Alex avatar
    129 posts

    Posted 24 May 2012 Link to this post

    Hello,

    Indeed the table cell width tags are not exported in some cases. However we managed to fix the issue and the fix will be included in the Q2 2012 release which will be out in the first half of June.

    Thank you again for your feedback.

    All the best,
    Alex
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner