[Openroad-users] Richtextbox

Bodo Bergmann Bodo.Bergmann at ingres.com
Wed Sep 5 03:47:44 EST 2007


To concatenate RTF files, just remove the last line of the first document,
remove the first and last line of all the middle documents,
and the first line of the last document that you append.
 
I assume that your rtf files are stored as "long varchar" or "long byte" column in the database,
so you should be able to fetch them into LongVcharObject or LongByteObject instances.
 
Here is an example for OR2006:
 
initialize(filenames = ARRAY OF StringObject)=
declare
    i = INTEGER NOT NULL;
    pos = INTEGER NOT NULL;
    s     = StringObject;
    s_all = StringObject;
    lvo = LongVCharObject;
enddeclare
{
    FOR i=1 TO filenames.LastRow
    DO
        // Fetch file from db
        lvo.Value = '';
        lvo.FetchFromDB(query = 'SELECT rtf FROM rtf_files WHERE filename='''+filenames[i]+'''');
        // Convert LongVChar object into StringObject
        s.Value='';
        s.LoadLong(object=long_arr[i]);
        IF (i>1) THEN
            // Remove fist line from all but the first rtf file
            pos = s.LocateString(match=HC_NEWLINE, startposition=1);
            s.LeftTruncate(endposition=pos);
        ENDIF;
        IF (i<filenames.LastRow) THEN
            // Remove last line (starts with '}') from all but the last rtf file 
            pos = s.LocateString(match='}', startposition=s.Length, backwards=TRUE);
            s.RightTruncate(startposition=pos);
        ENDIF;
        s_all.ConcatString(string = s);
    ENDFOR;

    // Write concatenated rtf string into file
    s_all.WriteToFile(filename='C:\temp\file_all.rtf');

    CurFrame.Flush();
 
    // Load concatenated rtf file into richtextbox control
    rtf_fld.FileName= 'C:\temp\file_all.rtf';
}
 
Hope this helps,
Bodo.
 
Bodo Bergmann
Senior Software Engineer
OpenROAD Worldwide Development
Ingres Corp.
 

________________________________

From: openroad-users-bounces at peerlessit.com [mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Christian Birkl
Sent: Tuesday, September 04, 2007 12:10 PM
To: International OpenROAD Users
Subject: Re: [Openroad-users] Richtextbox


That's it!

Thank you, Hervé, Chris and Bodo. External Classes seem pretty powerful - if you know how to use them.
Got it running at last, thanks again.

That said, my problem to append several rtf-files stored within the DB remains unsolved.
I guess I need Word to do this.

Cheers,

Chris.

Bodo Bergmann wrote: 

	The occording ActiveX control libraries are not part of the standard Windows OS,
	but were part of a VB (version 4, 5 or 6) distribution.
	So you either have to install a software package coming with the according VB components,
	or you have to download them (the controls are free to distribute).
	 
	Here are the controls (and inf files) in cab files for download:
	 
	
	http://activex.microsoft.com/controls/vb6/comdlg32.cab <http://activex.microsoft.com/controls/vb6/comdlg32.cab> 
	http://activex.microsoft.com/controls/vb6/richtx32.cab
	 
	Extract the ocx files from the cab into your windows\system32 directory and register them, e.g. using
	 
	EXPAND comdlg32.cab -F:comdlg32.ocx %SystemRoot%\system32
	
	EXPAND richtx32.cab -F:richtx32.ocx %SystemRoot%\system32
	REGSVR32 comdlg32.ocx
	
	REGSVR32 richtx32.ocx
	 
	They will probably only run with an according VB runtime (if not already installed),
	so if you get errors about missing msvbvm60.dll, then check out the Microsoft download pages
	(search for "vbrun60sp6.exe", if the following link does not work):
	http://www.microsoft.com/downloads/details.aspx?FamilyID=7b9ba261-7a9c-43e7-9117-f673077ffb3c&DisplayLang=en
	 
	Afterwards you should have external libraries with the same TypeLib IDs mentioned by Chris (though I have minor version 2 rather than 0):
	Microsoft Common Dialog Control 6.0 (SP6)
	
	Microsoft Rich Textbox Control 6.0 (SP6)
	 
	Hope this helps,
	Bodo.
	 
	Bodo Bergmann
	Senior Software Engineer
	OpenROAD Worldwide Development
	Ingres Corp.

________________________________

	From: openroad-users-bounces at peerlessit.com [mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Christian Birkl
	Sent: Tuesday, September 04, 2007 9:28 AM
	To: International OpenROAD Users
	Subject: Re: [Openroad-users] Richtextbox
	
	
	Thanks, Chris. 
	Unfortunately Microsoft Common Dialog Control 6.0 is not listed on my machine.
	I hope, this doesn't become one of these never ending stories ...
	
	[BodoBergmann] Picture deleted to prevent "Message body is too big" problem (limit of 100 KB).
	
	Chris Wallace wrote: 

		Hervé,

		

		Microsoft Common Dialog Control 6.0

		Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.0#0; COMDLG32.OCX

		

		???

		Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.0#0; RICHTX32.OCX

		

		

		Regards

		Chris Wallace
		Management Information Systems (WA) Pty Ltd
		Level 9, MIS House
		231 Adelaide Terrace, PERTH  WA  6000
		Ph: (08) 9221-9221  Fax: (08) 9221-9224
		Email: chrisw at miswa.com.au
		Web: http://www.miswa.com.au
		
		Disclaimer <http://www.miswa.com.audisclaimer/> :  Management Information Systems (MIS)
		This e-mail is private and confidential. If you are not the intended recipient, please advise us by return e-mail immediately, and delete the e-mail and any attachments without using or disclosing the contents in any way. The views expressed in this e-mail are those of the author, and do not represent those of MIS unless this is clearly indicated.  You should scan this e-mail and any attachments for viruses.  MIS accepts no liability for any direct or indirect damage or loss resulting from the use of any attachments to this e-mail.

		 

	
________________________________


	________________________________________________________________
	OpenROAD-Users mailing list
	
	You can maintain your subscription here:
	http://www.peerlessit.com/mailman/listinfo/openroad-users
	
	To unsubscribe click on this link
	mailto:openroad-users-unsubscribe at peerlessit.com&subject=unsubscribe
	
	To subscribe click on this link
	mailto:openroad-users-subscribe at peerlessit.com&subject=subscribe 


-- 

Mit freundlichen Grüßen / With kind regards
Christian Birkl
Software Engineering 

GAMED Gesellschaft für Angewandte
Mathematik und EDV mbH
Austria       8053 Graz, Harter Straße 48
Phone:       +43 (0) 316  27 86 60 - 18
Telefax:     +43 (0) 316  27 86 60 - 10
E-Mail:       Christian.Birkl at gamed.com
Internet:    www.gamed.com
Firmenbuchnummer: FN 50094v
Firmenbuchgericht:   Handelsgericht Graz 

This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system. Thank you for your cooperation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20070904/8605b567/attachment.html 


More information about the Openroad-users mailing list