Ticket T602994
Visible to All Users

Problem with missaligned Tab Leader Dots

created 7 years ago

Hi,
I am using the Rich Text Control and RichEditDocumentServer to generate a TOC for my Report.
As shown in the screenshot I am trying to draw some dots between the TOC entry and the page number given the following code:

C#
private static void SetDimensionPagesTabs(RichEditDocumentServer reds, DocumentRange dimensionsRange) { ParagraphProperties paragraphProps = reds.Document.BeginUpdateParagraphs(dimensionsRange); paragraphProps.LineSpacingMultiplier = 1; TabInfoCollection tabInfos = paragraphProps.BeginUpdateTabs(false); tabInfos.Add(new TabInfo() { Position = 60, Alignment = TabAlignmentType.Left }); tabInfos.Add(new TabInfo() { Position = 130, Alignment = TabAlignmentType.Left }); tabInfos.Add(new TabInfo() { Position = 1800, Alignment = TabAlignmentType.Right, Leader = TabLeaderType.Dots }); tabInfos.Add(new TabInfo() { Position = 1850, Alignment = TabAlignmentType.Right }); paragraphProps.EndUpdateTabs(tabInfos); reds.Document.EndUpdateParagraphs(paragraphProps); }

The problemn is that the leader dots do not go all the way to the next tabstop. Am I missing some settings?
What I expected: The dots fill the gap between the text and the "1800" stop.

Sincerely,
Bernd Boruttau

Comments (2)
DevExpress Support Team 7 years ago

    Hi Bernd,

    Would you please provide me with code demonstrating how you create a TOC in your document? I will examine this code and do my best to find an appropriate solution.
    I look forward to hearing from you.

    BB BB
    Bernd Boruttau 7 years ago

      Attached is an example where the misalignment can be reproduced.

      - Dots should fill up to the same "column"
      - page numbers should be right aligned behind last tabstop

      Answers approved by DevExpress Support

      created 7 years ago (modified 7 years ago)

      Hi Bernd,
      Thank for your sample project. We're aware of this issue and has already fixed it in the context of the following bug report:  System.InvalidOperationException is thrown when exporting a report with specific RTF content to DOCX using the 'Single File' export mode. Needless to say, you're welcome to download the hotfix. Anticipating your possible question, I'd like to mention that we're following the continuous integration model and for this reason it is not possible to propagate the required changes to the version you're currently using (16.2). So, it will be necessary to upgrade your project either to 17.1 or 17.2. The full list of changes between any two particular DevExpress versions can be found on the Version History page.

      Regards,
      Yaroslav

        Show previous comments (1)
        DevExpress Support Team 7 years ago

          Hi Bernd,

          The cause of this behavior is that a distance between two last tab stops is too small to properly align page numbers (e.g., "555" does not fit into this distance). Having examined your sample project further, I do not entirely understand why you need to apply two different tab stops. From my point of view, it is sufficient to create a single dotted tab stop to make this TOC generating routine operate properly.

          I have slightly modified your sample project to demonstrate this. Please review the attachment.

          BB BB
          Bernd Boruttau 7 years ago

            Giving the tabstops more space solves the problem. Thank you!

            The reason why I added two tabs at the end is that I wanted the dots to end at the same distance over all TOC entries independend of the following page number lenght.

            DevExpress Support Team 7 years ago

              Hi Bernd,

              Thank you for the clarification. Please feel free to contact us if you have further questions.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.