Need help to remove tables from RV

General TRichView support forum. Please post your questions here
Post Reply
kdu
Posts: 1
Joined: Wed Sep 19, 2007 12:37 pm
Location: germany

Need help to remove tables from RV

Post by kdu »

Hi community,

I am work with BDS 2006.
I need a function to change tables to text nearly as found here:
http://www.trichview.com/forums/viewtopic.php?t=581

The example removes the tables and put the text from each table in one new line. The problem: I want to have all tabletext found in a Item together in a new item using tabs as separator.

My concept was to modify the RTF-Stream but when I am using "SaveRTFToStream" in place of "SaveRVFToStream"

Code: Select all

......snip......

		if(table->Rows->Items[r]->Count)
		{
			TMemoryStream*Stream = new TMemoryStream;
			for (int c=0; c<table->Rows->Items[r]->Count; c++)
			{
				if(table->Cells[r][c])
				{
				   //	table->Cells[r][c]->GetRVData()->SaveRVFToStream(Stream, false,clNone, NULL, NULL);  
                                                                
				   	[color=red]table->Cells[r][c]->GetRVData()->SaveRTFToStream(Stream, false,clNone, NULL, NULL);[/color]
				}
			 			}
			Stream->Position = 0;
			Stream->SaveToFile("Test.rtf");
			Stream->Position = 0;
			rv->InsertRVFFromStream(Stream, rv->ItemCount);
         delete Stream;
    }
......snip......	
I got this errors:

E2015 Mehrdeutigkeit zwischen '_fastcall System::AnsiString::AnsiString(char)' und '_fastcall System::AnsiString::AnsiString(short)'
E2342 Keine Übereinstimmung des Typs beim Parameter 'Path' ('const AnsiString' erwartet, 'bool' erhalten)
W8006 TColor wird mit int initialisiert
:evil:
Any solution or bit code to solve the problem?

Regards and thanx for help

KDU
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Oh, RVData->SaveRTFToStream has a bunch of parameters.
Call

Code: Select all

table->Cells[r][c]->GetRVData()->SaveRTFToStream(Stream, '', false, 0,  clNone, NULL, NULL, NULL, NULL, NULL, 0, true); 
(the last parameter was added in a recent version)
Post Reply