Grupos de Google ya no admite publicaciones ni suscripciones nuevas de Usenet. El contenido anterior sigue visible.

Quick Report And DBGrid MultiSelect

67 vistas
Ir al primer mensaje no leído

forums.inprise.com

no leída,
11 ene 1999, 3:00:00 a.m.11/1/1999
para
Is there any way to print only the selected DBGRID ROWS on
the report ?

eg. i selected 1st and 4th and 5th row (DBGrid MultiSelection = True)
on my DBGrid and i want to show these lines on my report instead
the whole dbgrid(or datasource).

Thanx

n4...@ix.netcom.com

no leída,
12 ene 1999, 3:00:00 a.m.12/1/1999
para

Create an empty copy of the dataset, batchcopy the selected rows to
the new dataset and then assign the dataset to the report's dataset
property.

regards
A.G.

Tobias Mueller

no leída,
12 ene 1999, 3:00:00 a.m.12/1/1999
para
Hi,

you have to use filters with your DataSource1.Database (DataSource1 is the
source which the Grid is linked to) or directly with the Table/Query
component.

- Tobias (tobias...@swol.de)


forums.inprise.com <gat...@hotmail.com> wrote in message
news:77dn45$o9...@forums.borland.com...

forums.inprise.com

no leída,
12 ene 1999, 3:00:00 a.m.12/1/1999
para

>source which the Grid is linked to) or directly with the Table/Query
>component.
>
>- Tobias (tobias...@swol.de)
>
>
>forums.inprise.com <gat...@hotmail.com> wrote in message
>news:77dn45$o9...@forums.borland.com...
>> Is there any way to print only the selected DBGRID ROWS on
>> the report ?
>>
>> eg. i selected 1st and 4th and 5th row (DBGrid MultiSelection = True)
>> on my DBGrid and i want to show these lines on my report instead
>> the whole dbgrid(or datasource).
>>
>> Thanx
>>


do you want to try to filter 100.000 records ? =)
it takes about half hour to filter the 100.000 records ...


Tobias Mueller

no leída,
13 ene 1999, 3:00:00 a.m.13/1/1999
para
Can't believe it. I do filter approx. 150.000 records in about 3 seconds.
BTW: I don't think there's any other way. Perhaps you could look through the
soruce code of the DBGrid for some internal storing, but I don'T beleive
you'll find anything.

- Tobias (tobias...@swol.de)

David Martin

no leída,
13 ene 1999, 3:00:00 a.m.13/1/1999
para
Hi,

Put the DataSet property of your Report to nothing. This make the report to
ask you for data at the OnNeedData Event.

Place there code to jump on the table using the SelectedRows property of the
grid (A list of bookmarks) and stop the report.

HTH

forums.inprise.com escribió en mensaje <77dn45$o9...@forums.borland.com>...

forums.inprise.com

no leída,
14 ene 1999, 3:00:00 a.m.14/1/1999
para

>grid (A list of bookmarks) and stop the report.
>
>HTH
>
>forums.inprise.com escribió en mensaje <77dn45$o9...@forums.borland.com>...
>>Is there any way to print only the selected DBGRID ROWS on
>>the report ?
>>
>>eg. i selected 1st and 4th and 5th row (DBGrid MultiSelection = True)
>>on my DBGrid and i want to show these lines on my report instead
>>the whole dbgrid(or datasource).
>>
>>Thanx
>>
>>
>
>

do you have any idea how to implement the OnNeedData Event
in code ? eg to place the selected Rows of DBGrid to report ?
i need the code if you can post it .. thanx =)


forums.inprise.com

no leída,
14 ene 1999, 3:00:00 a.m.14/1/1999
para
>Can't believe it. I do filter approx. 150.000 records in about 3 seconds.


150.000 records in 3 seconds ? can you show me how to do this ?
thanx

(i'm using paradox 7 and i use setrange to do the work. it's too much
faster thanx Filter)

David Martin

no leída,
14 ene 1999, 3:00:00 a.m.14/1/1999
para
Of course, here it is ...

Add this lines to your code ...

...
private
{ Private declarations }
FCont: integer;

...

procedure TForm1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
FCont := 0;
end;

procedure TForm1.QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
begin
MoreData := (FCont < DBGrid1.SelectedRows.Count);

if MoreData then
begin
Table1.Bookmark := DBGrid1.SelectedRows[FCont];
Inc(FCont);
end;//if
end;

forums.inprise.com escribió en mensaje <77j7a5$sl...@forums.borland.com>...

Babis Michail

no leída,
14 ene 1999, 3:00:00 a.m.14/1/1999
para


well it doesn't work .. it's show me an error message
"Record/Key Deleted". =(

i would really apriciate if you can send me a example project .. =)

my e-mail gat...@hotmail.com

if you can't send me that ok.. thanx again for all your answers.


David Martin

no leída,
15 ene 1999, 3:00:00 a.m.15/1/1999
para
I Think you don't use the same table to move by SelectedRows and to link lo
DBGrib.

I send you the project...


Babis Michail escribió en mensaje <77lpoh$1h...@forums.borland.com>...

0 mensajes nuevos