Incompatible types: 'Integer' 'String'

edited 10:11PM in FastReport 4.0
Ladies and Gentlemen

I use Fastreport 4.12, in a management program, I have an invoice form, which at the time of printing gives me error, I checked, there is a problem with this code:
procedure Page1OnShow(Sender: TfrxComponent);
begin
  with Page1, Engine do
  begin
  QueryContratti.Active := true;
  ComboBox1.items.clear;
  QueryContratti.first;
  while not QueryContratti.eof do
  begin
    ComboBox1.items.add(QueryContratti.Fields['NUMERO']);
    QueryContratti.next;
  end;
  end
end;

procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
  with MasterData1, Engine do
  begin
  TMP_IMPONIBILE := ([DialogForm.Query2."TOTALE"]-[DialogForm.Query2."SCONTO"]) * 100 / (100 + [DialogForm.Query2."IVA_PERC"]);
  TMP_IVA := TMP_IMPONIBILE * [DialogForm.Query2."IVA_PERC"] / 100;
  if finalPass then
  begin
    IMPONIBILE := IMPONIBILE + TMP_IMPONIBILE;
    IVA := IVA + TMP_IVA;
    TOTALE1 := TOTALE1 + ([DialogForm.Query2."TOTALE"]-[DialogForm.Query2."SCONTO"]);
    TOTALE2 := TOTALE2 +  ([DialogForm.Query2."TOTALE"]-[DialogForm.Query2."SCONTO"]) * 100 / (100 + [DialogForm.Query2."IVA_PERC"]);
  end;
  end
end;

procedure MasterHeader1OnBeforePrint(Sender: TfrxComponent);
begin
  with MasterHeader1, Engine do
  begin
  IVA := 0;
  IMPONIBILE := 0;
  TOTALE1 := 0;
  TOTALE2 := 0;
  end
end;

begin

end.

error incompatible types: 'Integer', 'String'

waiting for help

Comments

  • edited 10:11PM
    thanks for support Paul he help me with solution,
    ComboBox1.Items.Add(QueryContratti.FieldByName('NUMERO').AsString);
    
    and inserted at the beginning of some strings
    Set
    
    and replaced
    : =
    
    below the correct script,
    procedure Page1OnShow(Sender: TfrxComponent);
    begin
      with Page1, Engine do
      begin
      QueryContratti.Active := true;
      ComboBox1.items.clear;
      QueryContratti.first;
      while not QueryContratti.eof do
      begin
        ComboBox1.Items.Add(QueryContratti.FieldByName('NUMERO').AsString);
        QueryContratti.next;
      end;
      end
    end;
        
    procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
    begin
      with MasterData1, Engine do
      begin
      Set('TMP_IMPONIBILE', ([DialogForm.Query2."TOTALE"]-[DialogForm.Query2."SCONTO"]) * 100 / (100 + [DialogForm.Query2."IVA_PERC"]));      
      Set('TMP_IVA', TMP_IMPONIBILE * ([DialogForm.Query2."IVA_PERC"] / 100));
      if finalPass then
      begin
        Set('IMPONIBILE', IMPONIBILE + TMP_IMPONIBILE);
        Set('IVA', IVA + TMP_IVA);
        Set('TOTALE1', TOTALE1 + ([DialogForm.Query2."TOTALE"]-[DialogForm.Query2."SCONTO"]));
        Set('TOTALE2', TOTALE2 + ([DialogForm.Query2."TOTALE"]-[DialogForm.Query2."SCONTO"]) * 100 / (100 + [DialogForm.Query2."IVA_PERC"]));
      end;
      end
    end;
    
    procedure MasterHeader1OnBeforePrint(Sender: TfrxComponent);
    begin
      with MasterHeader1, Engine do
      begin
      Set('IVA', 0);
      Set('IMPONIBILE', 0);
      Set('TOTALE1', 0);
      Set('TOTALE2', 0);
      end
    end;
    
    begin
    
    end.
    

Leave a Comment