The same code still works and the Richtext retrieved is showing up as soon as the <field name> was updated in version 4.22 of the WpTools however the only way I can get RichText to show up with Wptools 6.0 is to trigger another output event (i.e post a message) after the DataField was updated!? There must be an Object Property I missed when I was migrating from the 4.22. Any idea what could be missing
Thanks
IDE : BCB6
WPTools: 6.0
Database: Oracle10g
OS : MS XP (SP3)
WPTools 6 formats and displays the text when the application is idle. Therefore, if after the loading or changing the text, the immediate output is required (usually PDF creation or print) a call to ReformatAll is required.
In Your case please use ReformatAll(false, true) to display the text.
No difference, the DBRichEdit dialog remained empty even after I included the ReformatAll() call, however Refresh() call did work but I can't run the following ...
TDataSource ds1;
TDBWPRichText DBRichEdit;
ds1->DataSet = <ADO Query>;
DBRichEdit->DataSource = ds1;
DBRichEdit->DataField = String("<Field Name>");
DBRichEdit->Refresh();
DBRichEdit->SelectAll(); <----- does not select
The 4.22 ver of the TWPDBRichText got updated with the Oracle LOB content right after the Query FieldsName assignment! My expectation was to see as a minumum the same behaviour but I had to resort to 'Refresh()' to confirm the data was retrieved.
The aim of the exercise was to debug an issue with TWPDBRichText which is not Streaming the data out as an "RTF" format to an external file and rather than the RichText content we are getting just the RichText Controls when I load the RichText content back into the TWPDBRichText!?
The following code works perfect with ver 4.22
To Export in RTF format
The WPDBRichText object was updated with RichText as soon as LoadFromFile was complete with ver 4.22, but now it also needs a Refresh().
I know the ver 6.0 of the WPTOOLS is addressing the streaming of a Formatted content differently but so far haven't been able to locate anything which shows me how to correct for it.
The following call managed to compile with a warning
On the Export:
WPDBRichText->AsANSIString('RTF');
[C++ Warning] : W8098 Multi-character character constant
WPDBRichText->SaveToStream(mStream);
On the Import:
WPDBRichText->AsANSIString('RTF');
[C++ Warning] : W8098 Multi-character character constant
WPDBRichText->LoadFromFile(rtfFile); <--- did not load anything
I know you indicated not to use the 'Lines' property but how else I can extract the file content?
Also Should I just ignore the Compiler Warning or I am not using the call correctly?
Based on your last reply and what you'v already posted related to problems with TWPDBRichText I am guessing that I would be better off using the TWPRichText instead. If that is the case can you please elaborate on the following
WPRichtext1.AsString := Field.AsString;
Any sample code which correctly ties the 'Field' to a query
I realized that as soon as I hooked the query to the WpRichText component. But the extra step is not required in this case since I am only moving the RTF content to a file.
For places that we actually use the WpDbRichText object to display the RTF content from the database the extra steps poses a problem since everything goes through the 'DataSource' objects.
#12♥ 0
This category is archived. No new posts are possible.