Report - params
I have make a report with a dialog at the beginig. I have a some components (TfrxDateEditControl, CheckBoxes etc) from which I take values. This values are send as params in a BDEQuerry.
On the ok button I have this:
qrReport.Active:=true;
qrReport.First;
if qrReport.EOF then
begin
ShowMessage('No record here');
qrReport.Active:=false;
page2.ModalResult := mrNone;
end;
With some values I have a empty Querry and then it return the modal dialog.
If I change some values in the components (the date) and click the OK button the querry are running with the old values in params.
On the ok button I have this:
qrReport.Active:=true;
qrReport.First;
if qrReport.EOF then
begin
ShowMessage('No record here');
qrReport.Active:=false;
page2.ModalResult := mrNone;
end;
With some values I have a empty Querry and then it return the modal dialog.
If I change some values in the components (the date) and click the OK button the querry are running with the old values in params.
Comments
where you do it (which control and which event) and which property you set, and the taborder of the controls.
sample using internal query report of main demo 52.fr3
enter design mode set button1 enabled to false
with dialog form selected rightclick and select tab order and move button2
to the top. save changes
add code to edit1onexit event
procedure Edit1OnExit(Sender: TfrxComponent);
// it would be wise to add a test for valid numeric value here
begin
bdequery1.active := true;
if bdequery1.recordcount = 0 then
begin
ShowMessage('no records Available edit the value');
bdequery1.active:= false;
Button1.enabled := false;
end
else
begin
bdequery1.active := false;
Button1.enabled := true;
end;
end;
save changes
i have an error: undeclared identifier 'recordcount'
"undeclared identifier: recordcount"
the code that i write
qrReport.Active:=true;
if qrReport.RecordCount = 0 then
begin
...
and for this reason I use eof even I don't trust it.
if you are a registered user updates are free.
It work.