Recent

Author Topic: Lasreport Sqlite Maestro detalle  (Read 2316 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 543
Lasreport Sqlite Maestro detalle
« on: December 27, 2012, 03:54:54 am »
Hi friends well after be testing master detail for couple of day i fond my solution, i want share with you if some body is having problems with that, well couple o pases i did.

1 Query o DataSource
   1 for data invoice (Maestro)
   2 for rows of invoice (detalle)
 
to here no problem.

   DM.SQLQDetTick.Active:=false;
   Sqltext:= 'select * ';
   SqlText:= SqlText+' from detalle_tickets where ';
   sqltext:= sqltext+' fecha_exp >= '''+dateedit1.text+''' or fecha_exp <='''+dateedit2.text+''' order by ticket_folio';
   DM.SQLQDetTick.SQL.Text:=Sqltext; 
   
   this the filter for detalle.

Sqltext:= 'select * ';
   SqlText:= SqlText+' from tickets where ';
   sqltext:= sqltext+' fecha_exp >= '''+dateedit1.text+''' or fecha_exp <='''+dateedit2.text+''' order by ticket_folio';
   DM.SQLQTickesB.SQL.Text:=Sqltext;
   DM.SQLQTickB.Active:=true;

here is the filter for master

on deseing report put.

1 pageheader band
1 masterdata band link with dm.sqlqTickb.
1 datail header band
1 detail data link datase with DM.SQLQDetTick

well my tip was on DM.SQLQDetTick we have some events of wich you can use but i use inly one on next event add next code.

procedure TFormrvtasdet.DetalleNext(Sender: TObject);
begin
  if not ( Maestro.DataSource.DataSet.FieldByName('ticket_folio').AsInteger = Detalle.DataSource.DataSet.FieldByName('ticket_folio').AsInteger) then begin
    Detalle.DataSource.DataSet.Last;
  end;

end;

so this event check each line printed is the same value in master and detail if no send detail to last record.

that is all.

best regards for all.
sorry for my english.

 

TinyPortal © 2005-2018