Problem with a RTF edition

  • Hello,

    my company create a software containing several RTF edition using WPTools to merge fields with informations from the database.

    Some editions use a keyword begin / repeat to repeat a part of the RTF and sometimes this begin / repeat contain a table with another begin / repeat to add several line to the the table.

    We used an old version of WPTools and it worked, now we use the new version and try to adapt our old code but it doesn't work properly.

    When we merge the different fields we loop on each part of the RTF file but with the new version we don't have the different fields in the same order and I think it can be the problem.

    I don't know if it's clear but the problem is really specific and complex.

    If you need more information tell me, I'll try to give it to you.

    Thanks.

  • I'll make it clearer now and I know what's wrong.


    In all my rtf everything works fine, but if I made a table and put my begin/repeat loop in it, it's not working anymore.

    Here's an example, imagine that my rtf is like that

    Invoice n°<Number>

    @beginrepeat!

    Proposal n° <ProposalNumber>

    ObjectPriceNumber of unitTotal
    @beginrepeat![ <ObjectName><Price><NumberObject><Total>
    @endrepeat![

    @nextcode

    @endrepeat!

    If I put my beginrepeat![ outside of the table it's working, but when it's inside like in my example I don't have the right order in the process.
    In order to work I should work with this order @beginrepeat!, @endrepeat! then the lines between those two key words.
    When it's in the table I have @beginrepeat!, @nextcode, @endrepeat! which is wrong.

    I think the table is the problem when I try to put key word like @beginrepeat[ in it. and I wonder to know if there's a way to use WPTools in that particular case.
    Maybe there's something to do to "recreate" the table by code.

    Thanks.

    • Offizieller Beitrag

    If I understand correctly this is not a question about WPTools but about a reporting solution which is using certain tokens which are written as text into the RTF?

    As said above, please send your question to support@wptools.de since I cannot help you here.

    It is not a surprise that this this kind of reporting does not work in a table. RTF tables are not that straight forward encoded. In your case I would try to insert a new table and not extend an existing one.

    The product WPReporter which is based on WPTools can create such tables from templates editable in WPTools.