Save rvhtmlimport in stringrid
Save rvhtmlimport in stringrid
hello
I load in richviwedit a page web with rvhtmlimport, as I can make in order to save some data that serve to me in one stringrid?
thanks
sorry my english
I load in richviwedit a page web with rvhtmlimport, as I can make in order to save some data that serve to me in one stringrid?
thanks
sorry my english
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Save rvhtmlimport in stringrid
I read a page web with rvhtmlimporter and from richview I would want to save it or in an Array or a stringgrid. thanks
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Hello sergey you can makes an example me as I must make in order to pass all one stringrid?
***************************
var table: TRVTableItemInfo;
MS: TMemoryStream;
begin
ms:=TMemoryStream.Create;
Memo1.Lines.LoadfromFile('F:\\dati.html');
RvHtmlImporter1.LoadHtml(memo1.Text);
ms.SaveToStream(ms);
ms.Position:=0;
rvesource.LoadTextFromStream(ms,0,0,false);
rvesource.Format;
*******************************
thanks
***************************
var table: TRVTableItemInfo;
MS: TMemoryStream;
begin
ms:=TMemoryStream.Create;
Memo1.Lines.LoadfromFile('F:\\dati.html');
RvHtmlImporter1.LoadHtml(memo1.Text);
ms.SaveToStream(ms);
ms.Position:=0;
rvesource.LoadTextFromStream(ms,0,0,false);
rvesource.Format;
*******************************
thanks
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
As I understand, you need to load HTML in TRichView, save this document as text, assign this text to StringGrid cell.
This code assumes that RvHtmlImporter1.RichView = rveSource.
This code assumes that RvHtmlImporter1.RichView = rveSource.
Code: Select all
uses RVGetText;
var
FileStream: TFileStream;
StringStream: TStringStream;
begin
// 1. Loading file
FileStream := TFileStream.Create('F:\\dati.html', fmOpenRead);
StringStream := TStringStream.Create('');
StringStream.CopyFrom(FileStream, 0);
FileStream.Free;
RvHtmlImporter1.LoadHtml(StringStream.DataString);
StringStream.Free;
rveSource.Format; // not necessary if you do not need to display HTML in rveSource
// 2. Getting text
StringStream.Cells[0,0] := GetAllText(rveSource);
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I want copy only some data of RichView to stringgrid. Exists a way in order to make it? RichView is supplied of cells?
banal example:
***********
var
dato:string;
begin
dato:=richview.cell[1,10];
stringgrid.cells[1,1]:=dato;
end;
************
or in other way with same result.
thanks and sorry for the problem.
edossa
banal example:
***********
var
dato:string;
begin
dato:=richview.cell[1,10];
stringgrid.cells[1,1]:=dato;
end;
************
or in other way with same result.
thanks and sorry for the problem.
edossa
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I can make an example, but I do not understand how do you want to define part of document to copy.
There is no "richview.cell[1,10]", because TRichView does not have cells. It may include table with cells, probably several tables with cells.
If you want to get text representation of table cell, use
dato:=GetRVDataText(table.Cells[1,10].GetRVData);
GetRVDataText is defined in RVGetText unit.
There is no "richview.cell[1,10]", because TRichView does not have cells. It may include table with cells, probably several tables with cells.
If you want to get text representation of table cell, use
dato:=GetRVDataText(table.Cells[1,10].GetRVData);
GetRVDataText is defined in RVGetText unit.