WPTools v5 issues after upgrade from v4.

  • I am simply going to forward some of the issues we are seeing from some users and hopefully get some feedback here. The ONLY change is from v4 to v5 and we are using the absolute minimal code with the WPRichText or DBWPRichText. The only code we are using is setting the default font via the WrittingAttr and DefaultAttr, set the Header left and right margin, do a few inputstring commands and a few inputmergefields, then merge text. It is very basic, yet we are experiencing some very strange issues.

    Thank you for your time.

  • Ok... after many tests with the user I have found the answer to 2 of the issues, but would like to know if there is a way to prevent it.

    We have a document where we create a few lines of text via code and then we create a merge field and then several more lines of text. So you get something like.

    Zitat

    Today's Date

    FirstName LastName
    Address Line 1
    Address Line 2

    RE: MergeField
    Extending
    3 Lines

    Some other text

    Now the first 2 problems in my original post stemmed from the fact the user put the cursor on the last line of the RE merge field text (after the word lines above). She then hit enter twice and started typing more content. Our merge field is not showing the indicators around the text so what is happening is she is actually extending the merge field and typing new text into it. Since the RE text was indented it was causing strange stuff further down several paragraphs AND when the user hit the print button we re-merge in case some other data changed which in turn deleted all of the text they typed into the now extended merge field.

    So this mystery has been solved, but now how do I prevent this?

    What would you recommend doing to keep a user from accidentally extending a merge field, because the merge field will re-merge again prior to printing to handle changes made elsewhere that could effect the merge text?

    Thank you.

    • Offizieller Beitrag

    Hi,

    Zitat

    After you type your letter, review it and hit print, when you hit the okay button, your text disappears completely and you are left with just your date, inside address and salutation/greeting.

    I would say a call to ReformatAll is missing.

    Please note that unlike WPTools 4 the new architecture always delays the reformats. So if you do an inputstring the text is NOT updated immediately. The reformat is dones when the application is idle. The same happens after LoadFromStream. When you are editing, just typing, you don't notice the difference, but if you do a load or merge and then need to print you need a call to ReformatAll.

    Zitat

    What would you recommend doing to keep a user from accidentally extending a merge field, because the merge field will re-merge again prior to printing to handle changes made elsewhere that could effect the merge text?

    You can protect fields using the ProtectProp property.

    And ... don't forget "ReformatAll'

    MergeText('',true)
    ReformatAll(true,true);
    Print;

    Julian

  • Ok...

    Should a refresh be needed after the ReformatAll?

    I have noticed at times I have to do a refresh to see everything updated... but perhaps I shouldn't be doing refresh.

    I think part of my problem is there are many methods and properties that are in WPTools that are not clearly defined as to when they should be used or what they are really for. Not everything is this way as you do have a fair amount of documentation... but there is a lot of items a new developer with your product is left guessing about.

    I definitely would love to see more examples of how to do this or how to do that type of demos that would help the new user of your components get up to speed. Looks like there is a lot of power, just a fairly decent learning curve.

    My coworker who use to do this is no longer with us so it was pushed to me so I am jamming everything he learned over a 3 month period into a couple of weeks.

    Thanks for your time.

    • Offizieller Beitrag

    Hi,

    >>Should a refresh be needed after the ReformatAll?
    No, but ReformatAll has two parameters. If the second is TRUE it will paint the screen, if the first is TRUE it will initialize the text. Thats is required when changing styles but not on input.

    >>I have noticed at times I have to do a refresh to see everything updated... but perhaps I shouldn't be doing refresh. <<

    >>I think part of my problem is there are many methods and properties that are in WPTools that are not clearly defined as to when they should be used or what they are really for. Not everything is this way as you do have a fair amount of documentation... but there is a lot of items a new developer with your product is left guessing about. <<Please>>I definitely would love to see more examples of how to do this or how to do that type of demos that would help the new user of your components get up to speed. Looks like there is a lot of power, just a fairly decent learning curve. <<

    I have more than 50 demos for Delphi (under demos\Tasks)

  • Thanks for the reply... and description of the parameters for ReformatAll as I wasn't absolutely certain what they did and didn't see it in the docs (but could have missed it).

    Yes... I've looked at many of the demos... I think I must just run into things where I want to know how to do x, but the demos talk about y.

    I'll just post questions here if I can't find it in the help or demos.

    Thanks.