Post by Michele Sa » Wed, 04 May 2005 00:21:08

Hello NG,

I've some problem trying to print a single record using QReport... I tried
filtering the recordset bound to the report but I got no results (the report
keeps showing just the first record of the table that's not what is supposed
to show).

Michele Santucci
Celin Avio S.r.l.
Software Dev. Manager
tel. +390187564080
Via Fontevivo 21/M
19126 La Spezia


Post by Barak zaba » Wed, 04 May 2005 20:29:24

I would test and see what row the dataset show after the Filter and in the
before print of QReport.
If it show the currect record after the filter then the problem is with




Post by Michele Sa » Thu, 05 May 2005 16:37:38

"Brian Bushay TeamB" < XXXX@XXXXX.COM > ha scritto nel messaggio

Suppose the dataset provinding data for this report is called dsPlatform and
report is called rptPlatform
I have:

rptPlatform.dataset := dsPlatform;


dsPlatform.Filter := AnsiString( "IDPlatform=21");
dsPlatform.Filtered := true;
dsPlatform.Filtered :=false;

Obv there's just ONE record in that table / dataset that satisfy the
condition IDPlatform = 21.

Yes I'm.


Post by Michele Sa » Fri, 06 May 2005 01:32:32

"Barak zabari" < XXXX@XXXXX.COM > ha scritto nel messaggio

This's the constructor of the form housing the report....

__fastcall TfrmPlatformReportGeneral::TfrmPlatformReportGeneral(Variant
IDPlatform, TComponent* Owner)
: TForm(Owner)
dmTargetDB->adodsPlatform->Filter = "IDPlatform=" +
AnsiString( IDPlatform );
dmTargetDB->adodsPlatform->Filtered = true;
dmTargetDB->adodsPlatform->Filtered = false;

It's called with a simple:

frmPlatformReportGeneral = new TfrmPlatformReportGeneral(
currentActor->IDPlatform,this );

Tracing the execution I noticed that the RecordCount property of
dmTargetDB->adodsPlatform (Dataset)
before filtering is set to 2 for some seconds after Filtered = true sets to
1 (correctly since there's just one record satisfying that condition) then
bounce back to 2 just before rptPlatformGeneral->PreviewModal().


Post by Michele Sa » Fri, 06 May 2005 16:26:42

The problem is just another... to popup the report I have to create
it's housing window... just create ... after that the system keep
managing other events and between them I have an event that resets
the platform dataset filter. I just disabled this event management before
and after the visualization of the report and anything is fixed.

"Brian Bushay TeamB" < XXXX@XXXXX.COM > ha scritto nel messaggio