RTF Grid with Delphi

Posted on 2007-10-10
Last Modified: 2013-11-22
I defined a grid to print on a QuickReport with Delphi.  I'm using RTF. Herre is the code to do that :

\par \trowd \trqc\fs16 \cellx1212\cellx2412\cellx5430\cellx7824\cellx10224\b
\cf2 \intbl\highlight4  001\cell
\b0 \cf0 \b \cf2 \intbl\highlight4  002\cell
\b0 \cf0 \b \cf2 \intbl\highlight4  12345678901234567890\cell
\b0 \cf0 \b \cf2 \intbl\highlight4  004\cell
\b0 \cf0 \b \cf2 \intbl\highlight4  005\cell
\b0 \cf0 \intbl \row\intbl\cf0\highlight0  \cell
\intbl\cf0\highlight0  007\cell
\intbl\cf0\highlight0  008\cell
\intbl\cf0\highlight0  009\cell
\intbl\cf0\highlight0  010\cell
\intbl \row\intbl\cf0\highlight5  011\cell
\intbl\cf0\highlight5  012\cell
\intbl\cf0\highlight5  013\cell
\intbl\cf0\highlight5  014\cell
\intbl\cf0\highlight5  015\cell
\intbl \row\intbl\cf0\highlight0  016\cell
\intbl\cf0\highlight0  017\cell
\intbl\cf0\highlight0  018\cell
\intbl\cf0\highlight0  019\cell
\intbl\cf0\highlight0  020\cell
\intbl \row\intbl\cf0\highlight5  021\cell
\intbl\cf0\highlight5  022\cell
\intbl\cf0\highlight5  023\cell
\intbl\cf0\highlight5  024\cell
\intbl\cf0\highlight5  025\cell
\intbl \row \pard\cf0\highlight0\fs24

It's work great. But...
If the text is to long for a cell, the grid is unstable and the cells are not align anymore :(

Question :  I want the line resized  to have enough place for all the text in the same cell when its too long.  Like WORD do it.    What is the RTF code to add for that, and where I put it ?

Thank you .

Question by:Drareg
    LVL 13

    Accepted Solution

    There are proper documents explaining the RTF format - it can get quite complicated.
    My advice is to either read those documents, or, go into WORD and try and repeat what you want, and then study the sourcecode.
    For the documents on RTF format you can google for it, RTF is not unique to delphi, I suspect there should be something from WC3 and from Microsoft and others about it.

    A good place to start is Wikipedia!
    --which links to:
    The Homepage for the Book "RTF Pocket Guide" -
    The RTF Specification 1.9 from Microsoft:


    Try adding other zones. Good luck!
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    A few months ago I had an issue with LaserJet 1020 printer which was installed to XP and Windows 7.  It was installed to XP and working, but when I tried to connect from a Windows 7 PC, it would attempt connection and then fail.  Sometimes the Spool…
    If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
    The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now