lisa andrews markitks
lisa andrews markitks

Reputation: 127

Why the second record of the report goes to the next page?

I am printing two lists in my FastReport report, one in each TfrxMasterData, the problem is that when the query returns more than one record this new record is inserted into a new page, it needs to appear on the same page, one underneath the other.

Report OnGetValue procedure

   procedure TfrmBoletimGeralImpressao.frpExemploGetValue(const VarName: string;
      var Value: Variant);
    begin

      if CompareText(VarName, 'element') = 0 then
      begin
        Value := listaDisciplinas[StringDs.RecNo];
      end;

      if CompareText(VarName, 'element2') = 0 then
      begin
        Value := listaNotas[StringDs.RecNo];
      end;
     end;

This is the part of the code where for each student I want to print the test results that he did

  for t := 0 to listaSimulados.Count - 1 do
      begin
        if SimuladoIDAtual = TSimuladoDto(listaSimulados.Items[t]).simuladoID
          then
        begin
          igual := true;
          simuladoAluno := TSimuladoAlunoNotasDto.create;
          simulado := TSimuladoDto(listaSimulados.Items[t]);
          getAluno(AlunoID);
          simuladoAluno.simuladoID := SimuladoIDAtual;
          simuladoAluno.alunoID := AlunoID;
          loadDisciplinasDoSimulado(SimuladoIDAtual);
          StringDs.RangeEnd := reCount;
          StringDs.RangeEndCount := simuladoAluno.listaDisciplinas.Count;
          getReport.PrepareReport(false);
          dtmGlobal.qry1.next;
          SimuladoIDAtual := dtmGlobal.qry1.FieldByName('SimuladoID').AsInteger;
        end;
      end;
      dtmGlobal.qry1.next;
    end;
  end;
  getReport.ShowPreparedReport;
end;

enter image description here

enter image description here When the query returns two or more tests each test appears on a report sheet and I need it to stay one below the other.

Upvotes: 0

Views: 542

Answers (1)

JacalarRick
JacalarRick

Reputation: 153

Check the StartNewPage property of either Header1 or Master1 One of them might be checked True

Upvotes: 1

Related Questions