Fortesreport at Delphi

Asked

Viewed 817 times

6

Someone would have some mini application to let me know how Fortes Report works?

I’ve already made a report with the strong report, but what I’m getting wrong, is that I have to put a Bane SubDetails for me to try to reference 2 querys in the same report and I am not able to do this.

inserir a descrição da imagem aqui

Then you see the Valorpago and the Troco Right below, they are what I want you to take from another query. Ex.:all the above values are from query4 and the lower ones, just the lower 2 are from query7.

From this function below, it would return me the quoted values.(Valorpago and the Troco).

Code:

AssignFile(txt, frmSelection.FileListBox1.FileName);
  Reset(txt);
  while not eof(txt) do
  begin
    Readln(txt, lTemp);

    if (copy(lTemp, 1, 3) = 'E01') then
    begin
      date1 := StrToDateTime(copy(lTemp, 134,2)+'/'+copy(lTemp, 132,2)+'/'+copy(lTemp, 128,4));
      date2 := StrToDateTime(copy(lTemp, 142,2)+'/'+copy(lTemp, 140,2)+'/'+copy(lTemp,
      136,4));
      date1treg := FormatDateTime('yyyy/MM/dd', date1);
      date2treg := FormatDateTime('yyyy/MM/dd', date2);
    end;
    if (copy(lTemp, 1, 3) = 'E21') then
    begin
      DModuleGrid.ZQuery7.Close;
      DModuleGrid.ZQuery7.SQL.Clear;
      DModuleGrid.ZQuery7.SQL.Add('SELECT * FROM finafim WHERE ccf= :ccf AND ' +
        'numcup= :coo AND impcaixa= :ecf AND descfina= :formpag AND vlfina= ' +
        ':valorfinal AND chfina= :pchfina AND dtcomp BETWEEN "'+date1treg+'" ' +
        'AND "'+date2treg+'"');
      DModuleGrid.ZQuery7.ParamByName('ccf').AsString := copy(lTemp, 53, 6);
      DModuleGrid.ZQuery7.ParamByName('coo').AsString := copy(lTemp,47,6);
      DModuleGrid.ZQuery7.ParamByName('ecf').AsString := copy(lTemp,4,20);
      DModuleGrid.ZQuery7.ParamByName('formpag').AsString := copy(lTemp,65,15);
      DModuleGrid.ZQuery7.ParamByName('valorfinal').AsFloat := StrToFloat(copy(lTemp,80,13))/100;
      DModuleGrid.ZQuery7.Open;


      if (DModuleGrid.ZQuery7.ParamByName('ccf').AsString = DModuleGrid.ZQuery7.FieldByName('ccf').AsString)
      and (DModuleGrid.ZQuery7.ParamByName('coo').AsString = DModuleGrid.ZQuery7.FieldByName('numcupom').AsString)
      and (DModuleGrid.ZQuery7.ParamByName('ecf').AsString = DModuleGrid.ZQuery7.FieldByName('impcaixa').AsString)
      then
      begin

        if (DModuleGrid.ZQuery7.FieldByName('descfina').AsString = 'DINHEIRO')
        and (DModuleGrid.ZQuery7.FieldByName('chfina').AsInteger = 1)
        and (DModuleGrid.ZQuery7.FieldByName('numcup').AsString = DModuleGrid.ZQuery4.FieldByName('numcupom').AsString)
        and (DModuleGrid.ZQuery7.FieldByName('ccf').AsString = DModuleGrid.ZQuery4.FieldByName('ccf').AsString)
        and (DModuleGrid.ZQuery7.FieldByName('impcaixa').AsString =
          DModuleGrid.ZQuery4.FieldByName('NSerie').AsString)
        then
        begin
          frmDivIt.RLDBText13.DataField := 'vlfina';
        end;

        if (DModuleGrid.ZQuery7.FieldByName('descfina').AsString = 'TROCO')
        and (DModuleGrid.ZQuery7.FieldByName('chfina').AsInteger = 91)
        and (DModuleGrid.ZQuery7.FieldByName('numcup').AsString = DModuleGrid.ZQuery4.FieldByName('numcupom').AsString)
        and (DModuleGrid.ZQuery7.FieldByName('ccf').AsString = DModuleGrid.ZQuery4.FieldByName('ccf').AsString)
        and (DModuleGrid.ZQuery7.FieldByName('impcaixa').AsString =
          DModuleGrid.ZQuery4.FieldByName('NSerie').AsString)
        then
        begin
          frmDivIt.RLDBText14.DataField := 'vlfina';
        end;
      end;
    end;
  end;
  CloseFile(txt);

In addition, the Subdetail received no data.

  • 5

    I think you should ask a more specific question. Currently it is very comprehensive. I mean, any example of the Forts would answer your question, but it wouldn’t help you. The way it is, the question would be better put in a forum. In case, I suggest you specify the querys and the layout that will be used.

  • 2

    @Embarrass, okay man! I’m gonna do this now, I’m gonna edit my original question!

  • 1

    You linked the datasets in the bands correctly?

1 answer

3

First a comment on its architecture.

Try to condense your report into a query, you’re probably making the information redundant.

Returning to the subject, I found here a master-detail example for Forte Reports.

PAS:

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
  case RadioGroup1.ItemIndex of
    0:begin
        ClientDataSet1.IndexFieldNames :='City';
        RLGroup1.DataFields := 'City';
        RLLabel1.Caption := 'City';
        RLDBText1.DataField := 'City';
      end;
    1:begin
        ClientDataSet1.IndexFieldNames :='State';
        RLGroup1.DataFields := 'State';
        RLLabel1.Caption := 'State';
        RLDBText1.DataField := 'State';
      end;
  end;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  RadioGroup1.OnClick(Sender);
  RLReport1.Preview();
end;

procedure TForm1.RLDBText1BeforePrint(Sender: TObject; var Text: String;
  var PrintIt: Boolean);
begin
  if PrintFirst then
  begin
    PrintIt := true;
    PrintFirst := false;
  end
  else
    PrintIt := false;
end;

procedure TForm1.RLGroup1AfterPrint(Sender: TObject);
begin
  PrintFirst := true;
end;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.