Fast Report 5

Hello, and I have this kind of problem

When I am trying to view (crtl+P) report, it always says that "Could not convert variant of type (NULL) into type (Integer)"

How I fix this problem?



Comments

  • edited 3:22PM
    Mempsu wrote: »
    Hello, and I have this kind of problem

    When I am trying to view (crtl+P) report, it always says that "Could not convert variant of type (NULL) into type (Integer)"

    How I fix this problem?

    Can someone help? This is very annoying problem. Almost every report do this.
  • PolomintPolomint Australia
    edited 3:22PM
    Mempsu, the likely reason you've not had any responses is that there is too little information in your post for any meaningful response.

    The root cause of your problem is that one or more Fields in the Table / Query driving your report has a Null value and is being passed to a non-variant Variable which can't convert it.

    You need to break your problem down in order to solve it.

    Can you view the data in the Table or returned by the Query to check for any unexpected Null values?

    Can you run your report in "debug" mode to check exactly which part of FastReport is "failing"? (BeginDoc, BeforePrint
    for the Report, or BeforePrint for the Header, Footer, Bands etc.)

    At the very least you should provide more data here, such as what you've done so far to track this down, what other reports you have (that are working) and how this one differs from them.

    Cheers, Paul
  • edited 3:22PM
    Thank you for your answer and sorry for the short information. I have been use only a couple of time this software. I will get more info on Monday

    How I run it for "debug" mode?

    And I have trying several reports (about 10-15 reports) and none of them not working. Always same error or some other error from NULL value. I havent make none of those reports so thats why it is a little challenging to find what is the root of error >  I think that every report have the same "basis report" so thats why the error is in every report.
  • gordkgordk St.Catherines On. Canada.
    edited 3:22PM
    if a report is dependent upon code of your exe for values you cannot preview the report
    from the ide environment
  • gpigpi
    edited 3:22PM
    It seems you try to convert null value to integer (numeric formatting or calculations in the report's script). Create small demo project with problem based on standart Delphi's components and local database like MS Access mdb and send it to FR's support
  • PolomintPolomint Australia
    edited 3:22PM
    Mempsu wrote: »
    How I run it for "debug" mode?
    OK sorry Mempsu, I assumed you were the developer of the reports and had access to C++ or Delphi IDE. What exactly is the environment from which you are running the reports? What is the underlying database? Can you run the same queries that the reports use?
    Mempsu wrote: »
    And I have trying several reports (about 10-15 reports) and none of them not working. Always same error or some other error from NULL value. I havent make none of those reports so thats why it is a little challenging to find what is the root of error >  I think that every report have the same "basis report" so thats why the error is in every report.
    That "I think" suggests you don't have access to source, so this will make things very hard! Do you know the developer?

    Sorry if this sounds vague, and long-winded, but we need a "way in" to help with the debugging...
  • edited 3:22PM
    Is this helping, some part is not in english (sorry for that),


    Function Rivitetty(Teksti: String): String;
    var
    posi : Integer;
    output, rivitetty, erotin : String;
    begin
    erotin := '$RVaihto';
    output := Teksti;
    rivitetty := '';
    posi := Pos(erotin,output);
    while posi > 0 do
    begin
    rivitetty := rivitetty +Copy(output,1,posi-1)+#10;
    Delete(output,1,posi+(Length(erotin)-1));
    posi := Pos(erotin,output);
    end;
    rivitetty := rivitetty +output;
    Result := rivitetty;
    end;

    procedure Alusta;
    var
    Tarjous: Integer;
    KieliSQL: String;
    begin
    Tarjous := Get('Tarjous');
    KieliSQL := Get('KieliSQL');
    adsKieli.SQL.Clear;
    adsTarjous.SQL.Clear;

    if Get('Kuva') then
    begin
    Picture1.Parent := PageHeader1;
    Picture1.Visible := true;
    Picture1.FileLink := Get('KuvaOs');
    Picture1.Left := 0.4;
    Memo1.Visible := false;
    Memo2.Visible := false;
    Memo3.Visible := false;
    Memo4.Visible := false;
    Memo99.Visible := false;
    end;

    adsKieli.SQL.Add(KieliSQL);

    adsTarjous.Sql.Add('select T.*, ISNULL(M.Muistio,'+#39#39+') AS Muistio, R.Nimikekoodi, R.Nimike, R.Maara, R.Yksikko, ');
    adsTarjous.Sql.Add('aHinta = Case R.Kirjaustapa WHEN 1 THEN verollinenkplHinta ELSE verotonkplHinta END, ');
    adsTarjous.Sql.Add('R.Alennuspros, ISNULL(R.Alvpros,-1) AS Alvpros, R.rivisumma, R.Rivisaate, R.Rivityyppi, ');
    adsTarjous.Sql.Add(' Eraseuranta = CASE R.Eraseuranta WHEN 0 THEN '+#39#39+' ELSE (SELECT NE.Selite FROM NimikeEra NE LEFT Join EraTapahtuma ET ON (NE.ID=ET.NimikeEraID) Where NE.Era=R.Era AND ET.RiviID=R.ID) END ');
    adsTarjous.Sql.Add('From Tarjous T Left Outer Join TarjousRivi R ON (T.ID=R.ListaID) ');
    adsTarjous.Sql.Add('Left Join Muistio M ON (T.MuistioID=M.ID) ');
    adsTarjous.Sql.Add(' WHERE (ISNULL(R.Ohjaus,0) < 1104) AND T.ID = '+ IntToStr(Tarjous) );



    end;


    procedure frxReport1OnStartReport(Sender: TfrxComponent);
    begin
    Alusta;
    end;

    procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
    procedure LisaaMuksu;
    begin
    if MasterData1.Child = nil then
    MasterData1.Child := Child1
    else
    Child1.Child := Child2;

    end;
    var
    LokNum: Integer;
    RiviID: String;
    begin
    LokNum := 0;
    MasterData1.Child := nil;
    Child1.Child := nil;
    Child2.Child := nil;


    if (<Tarjous."Rivisaate"> <> Null) OR (Length(<Tarjous."Eraseuranta">) > 0) then
    begin
    if Length(Trim(<Tarjous."Rivisaate">)) > 0 then
    begin
    Memo65.Style := 'Tahoma9Italic';
    Set('Lokero'+IntToStr(LokNum),'''' + <Tarjous."Rivisaate"> + '''');
    LisaaMuksu;
    LokNum := LokNum + 1;
    end;
    if Length(<Tarjous."Eraseuranta">) > 0 then
    begin
    Set('Lokero'+IntToStr(LokNum), '''' + <Tarjous."Eraseuranta"> + '''');
    LokNum := LokNum + 1;
    LisaaMuksu;
    end;
    end;
    end;

    procedure Memo61OnBeforePrint(Sender: TfrxComponent);
    begin
    TfrxMemoView(Sender).Text := FormatFloat(Get('aHintaFormat')+';-'+Get('aHintaFormat')+';""',<Tarjous."aHinta">);
    end;

    procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);
    begin
    if Engine.FreeSpace < TfrxBand(Sender).Height then
    begin
    Engine.NewPage;
    Engine.CurY := Engine.CurY + Engine.FreeSpace - TfrxBand(Sender).Height - 1;
    end
    else
    Engine.CurY := Engine.CurY + Engine.FreeSpace - TfrxBand(Sender).Height - 1;
    end;

    procedure Memo48OnBeforePrint(Sender: TfrxComponent);
    begin
    Memo48.Text := Rivitetty(Get('Muistio'));
    end;

    Procedure MuistioPrint(Sender: TFrxComponent);
    begin
    if Length(Trim(Get('Muistio'))) = 0 then
    TfrxHeader(Sender).Child := nil;

    end;

    procedure Memo59OnBeforePrint(Sender: TfrxComponent);
    begin
    if ((<Tarjous."Rivityyppi"> > 0) OR ((Trim(<Tarjous."Nimike">) = '')) AND (<Tarjous."Maara"> = 0)) then
    TfrxMemoView(Sender).Text := '';
    end;

    begin

    end.
  • PolomintPolomint Australia
    edited 3:22PM
    Mempsu wrote: »
    Is this helping, some part is not in english (sorry for that)
    Definite step forward Mempsu > and there's enough Delphi to help those of us who don't speak Finnish[img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> I can't work on this now, but others may give you suggestions, before I get back to it...[/img]

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.