Beiträge von chuck

    When i use countlines on a wpedit that is displayed on screen, it works fine.

    When i use it on a wpedit generated in Code (without form), it does return 0 because all paragraphs return 0. I can't analyse it further, because i dont have the source.

    What is the reason and what is the solution?

    Chuck

    I would like to use the paragraph names for some Version Publishing, but i have the problem, that the mailmerging does not transfer any names neither form the original Text nor from the inserted RFT-Text.

    Anything i can do?

    Chuck

    Thank you for your answer

    the reason for my question was:

    Some printshops use the output of our programm (produced with wptools) to
    import the text into quark or programs like that.

    Up to this winter for a couple of years we used V3/4 and some home made merging.

    The printshops (stupid) had made little programs to extract what they needed. Certainly we never stated that the RFT would stay constant (as you might now, it is not easy to parse securely:))

    We changed to standard merging with V6 (which had some detail problems...), but now we don't have to bother about RTF details any more.

    But the printshops have a problem, certainly the produced RTF looks different. Because they where looking for a format to parse more securely, i looked and ask about wpt.

    I will have a look at the xml-format

    Thank you, Chuck

    6.07 is already much better, though not perfect. I still need a correction routine to make it well formed (the problem is that we embed it directly in XML, cant change that because the other side can't easily do it)

    If you want, i can try to give you examples

    chuck

    Hi Julian,

    is it possible to include this patch in the next version. We always have to patch the latest version we get, because without it characters line € can't be used in fields

    Thanks

    ---->

    It seems that the not sign arises in WPIOReadRTF in AppendChar, being a subroutine of TWPRTFReader.Parse

    Code:
    if FStack.Destination = rdsFieldStringBuilder then
    begin
    if FStringBuilder <> nil then begin
    FStringBuilder.AppendChar(AnsiChar(aCh));
    end;


    Casting aCh to AnsiChar (3864) results in Char(172) being ¬

    I get the correct output if I replace it with these lines:
    Code:
    if FStack.Destination = rdsFieldStringBuilder then
    begin
    if FStringBuilder <> nil then begin
    if isUnicode then begin
    FStringBuilder.Append(Char(aCh));
    end else
    FStringBuilder.AppendChar(AnsiChar(aCH));
    end;

    Version 4 created HTML, which was well formed as XML. In Version 6 this seems not to be the case. We have now overlapping tags

    Version 4 <p><b>some text</b></p>

    Version 6 <p><b>some text</p></b>

    Is there any way to force the HTML-Output to be wellformed (XML)?

    it seems, that the € gets lost in loading the RTF

    this is the file after saving it:

    ---------------------------------------

    {\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset2 Wingdings;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\landscape\wpprheadfoot1\paperw16838\paperh11906\margl1417\margr1417\margt1417\margb1440\headery720\footery720\endnhere\sectdefaultcl{\*\generator WPTools_6.030;}{\plain\fs30\cf1\b\u8364 ?\u8364 ?\u8364 ?\u8364 ?\u8364 ?\u8364 ?\u8364 ?\u8364 ?\par
    \pard\plain\plain\fs30\cf3\b\par
    \plain\fs30\cf3\b{\field{\*\fldinst{MERGEFIELD FF12 <TI ID="50107" l="0" ><rd><redir t="Lnk" /></rd><Ps><P n="1" ><v t="s">/T=XXX</v></P><P n="2" ><v t="s">gleich</v></P><P n="3" ><v t="s">/T=XXX</v></P><P n="4" ><v t="s">¬</v></P><P n="5" ><v t="s">EURO</v></P></Ps></TI>}}{\*\wpfldparam{IIF}}{\fldrslt{IIF\wpiparam107}}}\par
    \pard\plain\plain\fs30\cf3\b\par
    \plain\fs30\cf3\b\wpiparam107{\field{\*\fldinst{MERGEFIELD FF13 <TI ID="50105" l="0" ><rd><redir t="DB" /></rd><Ps><P n="1" ><v t="s">\u8364 €\u8364 €\u8364 €\u8364 €\u8364 €\u8364 €\u8364 €\u8364 €</v></P></Ps></TI>}}{\*\wpfldparam{/T}}{\fldrslt{/T}}}\par
    \pard\plain\plain\fs22\par
    \plain\fs22 -----\par
    \plain\fs22 x{\field{\*\fldinst{MERGEFIELD FF11 <TI ID="3123" l="0" ><rd><redir t="Obj" /><redir t="Ctl" /><redir t="Ct" /><redir t="Obj" /></rd><Ps></Ps></TI>}}{\*\wpfldparam{Adress}}{\fldrslt{Adress\wpiparam107}}}x\par
    \plain\fs22 ----\par
    }}

    -------------------------------------------------

    perhaps this helps to find the solution

    V6.04

    We have the problem that unicode characters in fields (source) get lost after a write/read cycle

    In the text everythings is alright with €, in the fields the get replaced by a
    mathematical not sign

    chuck

    WHen doing a merge inserting RTF Text with multiple pars and or tables, only the first par takes the indents/aligns from the template, the others take there own original settings (which is in a way logical)

    What might be the best way to modify this behaviour? Where can i set the attributs with "contents"

    How to set the indent/alignment for a table that was inserted?


    Chuck

    i did try that already, but the problem is not, that the fields are left over, but just the displayname of the field is appended to the inserted text with the same attributes as the inserted Text (non-RTF insertion) and with neutral attributes in case of RTF Insertion

    When i use the same form with supermerge, everything is fine

    Chuck

    When i use merge, the displayname of the mergefield is left in the text with the merged contents

    What is wrong?

    i tracked down the problem further, but can not get deeper in it (no source)
    It is a little strange

    saving the generated bands does only work, if the Trichtext resides on a form which is showing on screen and at least update is called (showmodal does this or a show - update sequence. After this, the bands are stored as they should

    doing it without the form showing (minimized for example), it does not work.

    Obviously the paint routine does something do get internal structures right.

    Could you have a look

    chuck

    yes i did

    i traced the save procedure as far as i could, the problem is it does not get the object in this part of code


    if par.ParagraphType in [wpIsReportGroup, wpIsReportHeaderBand,
    wpIsReportDataBand, wpIsReportFooterBand] then
    begin
    band := par.ParagraphObjFind(WPPAROBJ_WPBAND);
    if band <> nil then
    begin
    bands := band.AsString;
    if not par.AGet(WPAT_BANDPAR_STR, i) or
    (par.ANumberToString(i) <> bands) then
    par.ASet(WPAT_BANDPAR_STR,
    par.AStringToNumber(bands));
    {$IFDEF GROUPVAR} //WP6
    bandsvar := band.ExtraAsString;
    {$ENDIF}
    end
    else
    begin
    if par.AGet(WPAT_BANDPAR_STR, i) then
    bands := par.ANumberToString(i)
    else bands := '';
    {$IFDEF GROUPVAR}
    if par.AGet(WPAT_BANDPAR_VAR, i) then
    bandsvar := par.ANumberToString(i)
    else bandsvar := '';
    {$ENDIF}
    end;
    if bands <> '' then
    begin
    WriteString('{\*\wpmergepar{');
    WriteString(bands);
    WriteString('}}');
    end;
    {$IFDEF GROUPVAR}
    if bandsvar <> '' then
    begin
    WriteString('{\*\wpmergevar{');
    WriteString(bandsvar);
    WriteString('}}');
    end;
    {$ENDIF}
    WriteString('\wpmergestart');
    FNeedSpace := TRUE;
    end;
    sty := FRTFProps.ParStyles.GetStyle(par.style);


    chuck

    [/b]