Operation not possible
Hello,
i tried to print the MasterData1 without any data. I found that i must use Scriptcode in the report.
In the first step i removed the DataSet from the MasterData1-Band and put the following code into the Code-Tab:
In this step everything works fine for the "normal"-Output with Data...
The i tried the following Code:
Then the report will work, if the Dataset is empty. But when the Dataset hold some Data i get the error: [0x0005] Operation not possible.
What is here wrong? Can anyone help me?
Thanks a lot
Andreas
i tried to print the MasterData1 without any data. I found that i must use Scriptcode in the report.
In the first step i removed the DataSet from the MasterData1-Band and put the following code into the Code-Tab:
var
ds: TfrxDataSet;
begin
  ds := Report.GetDataset('frxDBDataset1');
      MasterData1.DataSet := ds;
end.
In this step everything works fine for the "normal"-Output with Data...
The i tried the following Code:
var
ds: TfrxDataSet;
begin
  ds := Report.GetDataset('frxDBDataset1');
    if ds.recordcount = 0 then
      begin                         Â
        MasterData1.DataSet := nil;
        MasterData1.RowCount := 1;
      end                       Â
    else
      begin                       Â
        MasterData1.DataSet := ds;
        MasterData1.RowCount := 0;
      end;                         Â
end.
Then the report will work, if the Dataset is empty. But when the Dataset hold some Data i get the error: [0x0005] Operation not possible.
What is here wrong? Can anyone help me?
Thanks a lot
Andreas
Comments
i can't reproduce here
d14, fr4.9.99
your code runs fine.
thank you for your fast answer...
I reinstalled FR with the version 4.9.99 Prof. (How can i see the Build-Version of the installed FR?)
my Delphi 2007 Prof. is Version 11.0.2902.10471
The report will still not work with the code inside...
Regards
Andreas
i found the solution for this error. It did not come from FR... Is still comes from the dbexpress-component in Delphi. I use the dbExpress driver for mySQL from devart. Reading RecordCount will generate an exception...
Read more here: http://dn.codegear.com/article/28494
Regards
Andreas