Recent

Author Topic: Lazreport crash under 1.0.8  (Read 4095 times)

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 256
Lazreport crash under 1.0.8
« on: March 20, 2013, 02:56:22 pm »
I have developed application under Laz 1.0.2 and it has lots of reports,and they all worked fine.
Few minutes a go I downloaded Laz 1.0.8 and compiled my existing application so I could test things.
When i want to print a report it crashes and There's what it says :
Quote
project raised exception class 'EVariantError' with message:
Invalid variant type cast

At address 630F24
when i press the "break" button a new editor tab gets opened containing the unit named LR_Class, and points to the line number 7973. The line is under the procedure
procedure TfrReport.InternalOnGetValue(ParName: String; var ParValue: String);

How do I get the new version working with the existing reports ?
« Last Edit: March 20, 2013, 03:01:27 pm by mirce.vladimirov »

jesusr

  • Sr. Member
  • ****
  • Posts: 484
Re: Lazreport crash under 1.0.8
« Reply #1 on: March 20, 2013, 04:10:51 pm »
There seems to be nothing in the list of changes that could cause the problem you describe. Check the data you feed to your reports and how you handle it in your OnGetValue Handler, if you still think there is a problem in 1.0.8 release, please submit a bug report with a project that proves it.

Edit:  Just to clarify, I mean the list of changes in LazReport code, 1.0.8 is built with FPC 2.6.2, previous version used 2.6.0. That is something to take into count, I don't know of any specific problem though.
« Last Edit: March 20, 2013, 04:18:47 pm by jesusr »

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 256
Re: Lazreport crash under 1.0.8
« Reply #2 on: March 20, 2013, 07:27:31 pm »
Thanks for your reply.
I got my old Lazarus 1.0.2 back to bussines. Reports work again.
I dont know what exactly is it with the new version, this was the shortest way to get myself back to development. Note that not all reports are acting as described, only few (ones that i tested first) and the message sounds like failure during changing datatype.

sin_dragan

  • Full Member
  • ***
  • Posts: 127
Re: Lazreport crash under 1.0.8
« Reply #3 on: May 26, 2015, 08:10:41 pm »
Hi, sorry to bring this back, but I am facing a same issue.

When I use GetValue and debug on I receive the same message for every field I process (I have 6 of them).

When I switch to Release everything works okay and no error message are shown.

Exception was here LR_CLASS 9625

Code: [Select]
CurValue := 0;
  GetVariableValue(ParName, CurValue);
  ParValue := FormatValue(CurValue, AFormat, AFormatStr);
  {
  if TVarData(CurValue).VType=varString then
    ValStr := CopyVarString(CurValue)
  else
    ValStr := CurValue;
  ParValue := FormatValueStr(ValStr, Format, FormatStr);
  }
  {$IFDEF DebugLR}
  DebugLn('TfrReport.InternalOnGetValue(%s) Value=%s',[ParName,ParValue]);
  {$ENDIF}                         


And I use this code to set some varible:

Code: [Select]
if (ParName = 'Usluga1') and (not dmMain.UslugeMainQ.EOF)  then
  begin
     ParValue := dmMain.UslugeMainQ.Fields[0].AsString; /// HERE, looks like an assignment is wrong
     dmMain.UslugeMainQ.Next;
     Exit;
  end;               
Windows 7 64 bit
Lazarus 1.4.1 (w/fixes) FPC 2.6.4 win32

 

TinyPortal © 2005-2018