Beiträge von mrbar2000

    Ok, julian we change the code to create just 2 objects wptools objects

    This is my process. The user mount a document with header, footer and at body it can put a field. this fields is a composiition of many other litle documents. ie.

    MergeItem get a model and do merge.
    see that we are cleaning the rtfedits before each iteration, yet the memory is being used increasingly.

    hi julian,

    We are have some trouble when doing merge and submerge of many documents.
    The problem happen when using fastmm. See Below the Fastmm´s log please.

    I see that my database is very huge because my wptools rtf text. I need compress the text before save to blob and decompress this text before load it.

    I'm using wpRichText dataware components.

    What events I can use to compress and decompress the text?

    Thanks

    I do "cascading" mailmerge!

    I had put option into program to edit editfields and merge the editfields and mergefields again.

    I create a MergeEngine class to merge the document.

    Code
    procedure TMergeEngine.DoMergeGetText(Sender: TObject;  const inspname: string; Contents: TWPMMInsertTextContents);begin  FCampo.LoadFromWPObj(Contents.StartInspObject);  if (FCampo.Tipo = cTC_Modelo) then  begin    Contents.Options := [mmMergeAsRTF];    Contents.StringValue := SubMerge(FDataEngine.DoGetValue(InspName), FCampo)  end else    Contents.StringValue :=      FormatValue(FDataEngine.DoGetValue(InspName), FCampo);  FCampo.SetVariable(cMerged, 'True');  Contents.StartInspObject.Source := FCampo.ConfigToString;end;


    On merge, when (FCampo.Tipo = cTC_Modelo) Contents.StringValue is a formatted text ('{\rtf1\ansi\deff0\uc1\ansic.......MAL -\par'#$D#$A'}}')

    All ok here, but i need that the user can change some field of database and he could remake the merge, but not lost changes that he did out of fields!

    Then I create a ReadConfig class to read fields of merged document:

    but Contents.StringValue not return a formated text, just a plain text.

    How I can get a field content as RTF formated?

    I tried put Contents.Options := [mmMergeAsRTF] on TReadConfig.DoMergeGetText but I dont have luck! :(

    Zitat

    Everything is working OK, but I'd like to make these documents, that are add'ed, to be protected from editing, because If the user changes it, I dont know what he changed, and where to save it.


    Whould you like let the user edit the final document, and this changes reflect on fields?
    If the answer is yes u can use bookmark. Bookkmark is a text object and u can put information on Command or Source property. then before add a document u can do.

    <Bookmark1 Tabelax Campoy>
    Your first document
    <\Bookmark1 Tabelax Campoy>
    <Bookmark2 Tabelax Campoy>
    Your second document
    <\Bookmark2 Tabelax Campoy>
    <Bookmark3 Tabelax Campoy>
    Your third document
    <\Bookmark3 Tabelax Campoy>

    Then the user can edit the final document and u could do a For to get the content of each bookmark and change the original field.

    But if u dont like this. make your finaldocument readonly![/b]

    Very thanks julian, but there is a problem yet!

    When the user write more text that one page i need all width.

    On second page do not have images, and he will need select text and change the right margin to works. I dont want he need do this!

    I have used this code:

    Code
    procedure TForm1.Button2Click(Sender: TObject);
    var
      oField: TWPTextObj;
    begin
      oField := wprichtext1.InputTextFieldName('TIME');
      oField.Source := '\@ "d'' de ''MMMM'' de ''yyyy"';
    end;

    But if I copy the text and paste just the day number is pasted!

    5.20.4

    WPRichText1.TextCursor.CurrAttribute.ToggleCharstyle(...) just work if there is a selection or if your press shortcut, type something and press the shortcut again.

    Put 2 wprichtexts, 2 buttons and 1 memo on form:
    1) type something at wpr1;
    2) press CTRL+B;
    3) type some word at wpr1 yet (it will set to bold)!
    but....
    4) click on btn1 (memo1.lines.text := wpr1.asstring)
    3) click on btn2 (wpr2.asstring := memo1.lines.text)

    U will see that the bold text not is show on wpr2.

    No julian, I have used wprichtext no dbaware and I have the same behavior.
    Follow this steps:

    Teste 1:
    typesome text, press CTRL+B, type more text, press CTRL+B
    Result of Wprich.AsString on Teste 1
    {\rtf1\ansi\...
    {\plain\fs24 mvm\b mvmvmvmvm\b0 \par }}

    Teste 2:
    typesome text, press CTRL+B, type more text, DON'T press CTRL+B again
    Result of Wprich.AsString on Teste 2
    {\rtf1\ansi\...
    {\plain\fs24 mvm mvmvmvmvm\par }}

    I get on a other post a routine similar to this, to control CTRL+B:

    But there is a problem here. If I dont have nothing selected, then I press Ctrl+B the words show me BOLD, this is ok, but when I post the record the \b not put around the text that i write after i pressed CTRL+B.

    If I select some word on text and press CTRL+B then all works!

    What the problem?

    I whould like show some images into a right side of text. Sample

    I have 4 images to show on right and the text on left. I need some blank space between images but i dont want that any text between images.

    [Blockierte Grafik: http://www.microprocess.com.br/WPTOOLS_REQUEST.JPG]

    I'm think inherited TWPOImage, put a list of strings (path and filename) and paint all images into this obj. So I put just a wpoimage relative to page on right side.

    Anyone can help me with this object or with other Idea?