Pipeline dropping DataSource
Hello
Using Delphi 2007, Report Builder 11.02 and Advantage Database Server.
I have recently upgraded to RB11 and have just experienced strange behaviour
with a pipeline loosing and regaining its datasource. I have a sales order
database where the data is selected by the user clicking on tabs to denote
the sales status (New, Open, Closed, All). There are 2 datasets (sales
orders and sales items), 2 datasources and 2 dbpipelines. The delphi code
is as follows.
procedure TFormSales.tabSalesChange(Sender: TObject);
begin
screen.Cursor := crHourglass;
sqlSalesItems.close;
sqlSales.close;
sqlSales.SQL.Clear;
sqlSales.SQL.Add('Select * from SOrder');
case tabSales.TabIndex of
0: sqlSales.SQL.Add('where Status = ''NEW''');
1: sqlSales.SQL.Add('where Status = ''OPEN''');
2: sqlSales.SQL.Add('where Status = ''CLOSED''');
3: ;
end;
sqlSales.Open;
sqlSalesItems.Open;
screen.Cursor := crDefault;
end;
Every time I changed status (ie ran the above sql) then the dbpipelines
would alternately loose and regain the datasource. For example when i
started in New then my report would work, change to Open then my report
would not work, change to Closed then my report would work, change to New
then it would not work, change to Open then it would work. It was
consistent in its behaviour on my machine.
At the same time I have pretty much identical code for Purchase Orders where
there was no problem at all.
I have got round the problem by just adding some code to reconnect the
dbPipelines to the datasources every time the query runs.
pipeSales.DataSource := dsSales;
pipeSalesItems.DataSource := dsSalesItems;
Does anyone know why this is happening. I have a solution but I have 30
plus bespoke applications with various customers
and dont want to have to modify loads of code as I update them to RB11
unless I have to.
Regards
Tim Murfitt
Using Delphi 2007, Report Builder 11.02 and Advantage Database Server.
I have recently upgraded to RB11 and have just experienced strange behaviour
with a pipeline loosing and regaining its datasource. I have a sales order
database where the data is selected by the user clicking on tabs to denote
the sales status (New, Open, Closed, All). There are 2 datasets (sales
orders and sales items), 2 datasources and 2 dbpipelines. The delphi code
is as follows.
procedure TFormSales.tabSalesChange(Sender: TObject);
begin
screen.Cursor := crHourglass;
sqlSalesItems.close;
sqlSales.close;
sqlSales.SQL.Clear;
sqlSales.SQL.Add('Select * from SOrder');
case tabSales.TabIndex of
0: sqlSales.SQL.Add('where Status = ''NEW''');
1: sqlSales.SQL.Add('where Status = ''OPEN''');
2: sqlSales.SQL.Add('where Status = ''CLOSED''');
3: ;
end;
sqlSales.Open;
sqlSalesItems.Open;
screen.Cursor := crDefault;
end;
Every time I changed status (ie ran the above sql) then the dbpipelines
would alternately loose and regain the datasource. For example when i
started in New then my report would work, change to Open then my report
would not work, change to Closed then my report would work, change to New
then it would not work, change to Open then it would work. It was
consistent in its behaviour on my machine.
At the same time I have pretty much identical code for Purchase Orders where
there was no problem at all.
I have got round the problem by just adding some code to reconnect the
dbPipelines to the datasources every time the query runs.
pipeSales.DataSource := dsSales;
pipeSalesItems.DataSource := dsSalesItems;
Does anyone know why this is happening. I have a solution but I have 30
plus bespoke applications with various customers
and dont want to have to modify loads of code as I update them to RB11
unless I have to.
Regards
Tim Murfitt
This discussion has been closed.
Comments
In my quick testing with buttons on a form using similar code to what you
have below, I was unable to recreate this behavior. Are you able to
recreate this with a simple example I could run on my machine? If so,
please send it in .zip format to support@digital-metaphors.com and I'll take
a look at it for you.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I will try to recreate it in a simple example but I am not sure that I can.
Virtually identical code on another form did not exhibit this strange
behaviour. The only thing different between them was the amount of data.
The one with the larger amount of data had the problem, the one without did
not. I have been using the same techniques in bespoke development work with
Delphi, Advantage and ReportBuilder for over 6 years and have never had this
problem before. I will do some experimenting and let you know. If anyone
else has had something similar with RB11 it would be good to know.
Regards
Tim