Beiträge von fanderlf

    Hello,

    As we have an application running at our site we would need to make it a web application, so that other sites can use it, too. There is no chance to get the program running at the other site, because the database access is very slow (using lots of CLOBs).

    So my question is if TextDynamic (especially the ASP.NET server version) is compatible to WPTools.

    I store the Data from WPTools via

    Code
    DBTable->FieldByName("Text")->Value = WPRichText->AsString;

    Would I be able to do something like:

    Code
    TextDynamicRichText->AsString = DBTable->FieldByName("Text")->AsString;

    I stumbled about default properties in the manual under notes for upgraders:

    Zitat


    To set the default font for an editor use the OnClear event:

    Code
    procedure TForm1.DBWPRichText1Clear(Sender: TObject);
    begin
    DBWPRichText1.WritingAttr.Clear;
    DBWPRichText1.WritingAttr.SetFontName('Arial');
    DBWPRichText1.WritingAttr.SetFontSize(11);
    end;

    Hello :)

    We need to export a Document as a .txt file. The problem now is, that all table rows are exported as a line (text of cells combined to one string). Is there any possibility to change the export output?
    I would prefer tabs as delimiter. Is there a gerenal way to influence .txt-file exporting? Something like an Event Handler?

    thanks for your help,
    Florian

    a small hint from my side, which made the work much easier (at least for me :))

    try to build the text only using AppendNewPar and par->SetText(). I often had trouble mixing the direct input (WPRichtText1.Insert(...)) with paragraph input (par->SetText).

    I've built myself some functions like:

    Code
    TParagraph * __fastcall Tfrm_TestspecData::AppendTextToDocument(TWPRichText *target, AnsiString Text){  TParagraph *par;  par = target->LastPar->AppendNewPar(false);  par->ASet(WPAT_Alignment,Integer(paralLeft));  par->ASet(WPAT_IndentLeft,500);  par->SetText(Text,txtplain);  return par;}

    of for formated text:

    SetIndent sets the leftindent + 500 from the formated text to append (WPRichtText->AsString saved to blob field in DB), because I'm painting a border arround my document :)

    As the built in TOC was too unflexible for me I decided to build up one myself :)

    Before Building the document add a Paragraph and save a Pointer to it (TOCParagraph)

    As I'm only using paragraphs to build my Document I used the TParagraph.Name Property to seperate Headlines from Text

    e.g. when building the Document and you got a Headline (In my Document I've only got 2 Levels) name the Paragraph "Head_<Counter>".
    each sublevel gets a different prefix (to recognise which format to use)

    Like:

    A. Big Chapter One! -> Name: Head_1
    A.1 Subchapter One! -> Name: Subhead_1_1
    and so on

    then build your Document

    now run through all paragraphs and search the name for the prefixes. Each time you find an specific prefix append a new Paragraph to your saved TOC Paragraph. You can get the Text via the Paragraph.GetText () function.
    Mark the appended TOCParagraph with toc_ + Paragrpah.Name (so you later know which Content Entry this TOC Entry is related to)

    After doing through the all paragraphs again and search for toc_*. If you find one extract the original paragraph name and run through all paragraphs to determine the page the actual paragraph is on.
    Append the pagenr to the TOC paragraph.

    et voilá a wonderful TOC which is fully formatable =)

    headcounter and subheadcounter are global variables and should be reset each time you rebuild the document.

    Appending a Headline:

    Code
    TParagraph *par;  par = target->LastPar->AppendNewPar(true);  par->ASet(WPAT_Alignment,Integer(paralLeft));  par->ASet(WPAT_IndentLeft,500);  par->ASet(WPAT_ParIsOutline,1);  par->Name = "head_" + IntToStr(++headcounter);  if( NewPage )    par->prop = par->prop <<paprNewPage>SetText(Text,headline);  target->CPPosition = MaxInt;  // Possibility to jump to headline via BookmarkMoveTo();  target->BookmarkInput("head_" + IntToStr(headcounter));

    Appending Subheadline:

    Code
    TParagraph *par;  par = target->LastPar->AppendNewPar(true);  par->ASet(WPAT_Alignment,Integer(paralLeft));  par->ASet(WPAT_IndentLeft,500);  par->ASet(WPAT_ParIsOutline,1);  par->Name = "subhead_" + IntToStr(headcounter) + "_" + IntToStr(++subheadcounter);  par->SetText(Text,subheadline);  target->CPPosition = MaxInt;  target->BookmarkInput("subhead_" + IntToStr(headcounter) + "_" + IntToStr(subheadcounter));

    Building Document and TOC

    Hope I could help :) Sure this is not the best way to build a TOC but it works :P

    P.S.: Oups just saw that you asked for an Delphi example... well I hope it should be no Problem to translate my example to Delphi. Functions and important Member Names are the same is in Delphi

    Hello,

    I've got a behaviour in WPTools in don't understand. I'm building a very complex document out of a Database.
    A use 2 TWPRichEdits to build the Document. In one RichEdit I build blocks which I append to the other RichEdit.
    If I only build the blocks and append them together in the second TWPRichEdit everything works fine.
    But as soon as I change some formatting in the second document all the font information from the first RichEdit gets lost (except the underlined property). This only happens with Text I built in code. The text the users entered (I append some text using ->SelectionAsString = TextFromDB) stays nicely formatted, though it is also in RichEdit1.

    I use this to format my text:

    It looks like the component can't handle it if there are Cardinals from 2 different TWPRichEdits in one Document. Or is there a better way for general formatting of texts in code?

    Thanks for your help!!!

    Florian Fanderl

    Hello,

    I've got a problem with MailMerge and Tables. I have some MMFields in a Table looking like this:

    Code
    Column1 Column2   Column31       <Field11> <Field12>1       <Field21> <Field22>1       <Field31> <Field32>

    When I use FieldGetNames() I get as much Fields in as there really are, but they are all called Field11 and Field12.
    So the list looks like:

    Code
    Field11
    Field12
    Field11
    Field12
    Field11
    Field12

    I have the same behaviour if I use the OnMailMergeGetText. Am I missing something? Or does MailMerge not work in Tables?

    Maybe you get a hint.

    Thanks in advance!!!!

    Florian Fanderl

    Hello,

    For a few days I try to install the new version of WPTools. If I do simply install and compile I get the Error:

    Undefined Symbol: TWPDroppedTextMarkers

    After a little research I recognised the file WPHPPFIX.INC which seems to have to do something with this problem, but I simply can't get it to work.

    Can you give me a hint what to do with this file? Or how to get the component installed.

    I don't have any clue how to solve this.

    Thanks in advance,
    Florian Fanderl

    Setting the visibility state is nice for some solutions :) Thanks for the tip.

    but especially I'd like to change the behavior of the save button and this isn't possible with the delphi Version.

    We use BCB V6.0 (Build 10.166). I include the sources of the default editor into my project and it compiles successful. Using the default editor is also no problem. But if I try to change something via CBuilder (e.g. simply try to delete a Button from the form), I get a message ("Diese Operation wird bei Pascal-Formularen nicht unterstützt.") which tells me that I can't do that with Delphi sources/forms.
    I tried it with your Demo Projects and I've got the same effect. As I can't open a .dpr File, I create a new C++-Project and include the sources needed for Project (e.g. the CreateTable Demo). Same behavior here. Compiles nicely, but I can't change anything in the form (in the Demo "CrTableU").

    I hope you understand the problem now and it seems to be a general Problem.

    A C++-Version would be great :)

    Thanks in advance,
    Florian Fanderl

    Hello,
    Is there a version of the default editor in c++? The Delphi Version works fine (even in C++-Builder) as long as I don't have to change anything in the source code of the default Editor. But if I try to change anything in the form at design time, I get an error which tells me that I'm not allowed to do this with the Pascal sources.
    The Default Editor is really nice for most of our purposes, but I'd like to change and remove some of them.

    Is there a C++-Version of the Default Editor?

    Thanks in advance,
    Florian Fanderl

    Hello :)

    In my application I need to combine many different TWPRichTexts into one big Document. I get those Documents from the Database (in WP File format), so I can access them as string.

    At the moment I load them into a seperate TWPRichText and Append them via fastappendtext to the main document. As I read that this function shouldn't be used I asked myself how to do something like that in another way, but I didn't get any idea :(

    Shall I just add them via:

    Code
    wp_MainDocument->AsString = wp_MainDocument->AsString + StringFromDatabase;

    I need to keep the formatting of all added paragraphs as the were originally entered.

    Hope you understand what I want to do. What be great if anyone could helpt.

    Thanks in advance,
    Florian Fanderl