Page 1 of 1
Save rvhtmlimport in stringrid
Posted: Sat Jun 09, 2007 3:52 pm
by edossa
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
Posted: Mon Jun 11, 2007 6:46 pm
by Sergey Tkachenko
Do you load document by rvhtmlimporter from some string? Why not to use this string to assign to the stringgrid cell? I do not remember if it supports multiline text, though.
Save rvhtmlimport in stringrid
Posted: Tue Jun 12, 2007 2:17 am
by edossa
I read a page web with rvhtmlimporter and from richview I would want to save it or in an Array or a stringgrid. thanks
Posted: Tue Jun 12, 2007 10:58 am
by Sergey Tkachenko
Use richview.SaveHtmlToStream or SaveToStreamEx to save document to TStringStream.
Posted: Sat Jun 16, 2007 6:09 pm
by edossa
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
Posted: Tue Jun 19, 2007 11:18 am
by Sergey Tkachenko
Sorry, I do not undestand your code.
What does ms.SaveToStream(ms) mean?
Do you want to load HTML source code in rvesource and set it to stringgrid? Why not to use StringGrid.Cells[0,0] := memo1.Text?
Posted: Wed Jun 20, 2007 10:12 pm
by edossa
Hello excuse for my English, is not explained to me well. I load a page web in Richview and must capture some data as I can capture them (no source html) and put them in a database or stringgrid or string? thanks
edossa
Posted: Thu Jun 21, 2007 2:45 am
by Sergey Tkachenko
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.
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);
Posted: Thu Jun 21, 2007 10:57 am
by edossa
Sergey thanks
Richview is divided from many cells? can be copied one cells x,y?
how I make in order to copy only some data that interest to me?
example:
12:00 CET Friendlies Indonesia - Jamaica 2-1
12:00
CET
Friendlies
Indonesia
Jamaica
2-1
Posted: Fri Jun 22, 2007 1:27 am
by Sergey Tkachenko
Do you want to copy TRichView table to TStringGrid?
Posted: Fri Jun 22, 2007 1:51 am
by edossa
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
Posted: Sun Jun 24, 2007 7:19 am
by Sergey Tkachenko
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.
Posted: Sun Jun 24, 2007 9:07 am
by edossa
ok but for being able to copy the text in table column for column?
Thanks