Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

RAP error after upgrading from 7.03 to 9.02

edited October 2005 in RAP
Hi all,

I have a weird error in a rap function
I am using D7 sp 1 and RB 9.02
The rap function is attached to a BeforeHeaderPrint event
I isolated the line which gives error.
This line tries to read the value from
an autosearch field and assign it to a string variable.
It is something like this

procedure HeaderBeforePrint;
var
Comando : string;
begin
Comando := Report.AutoSearchCriteriaByName(Report.DataPipeline.Name,
'F305').Value;
end;

The error is :

HeaderBeforePrint'' is not a valid integer value.

I don't know how to further debug this.
Help please!
Thanks in advance
Bye
Nicola

PS
In RB 7.03 (or 7.04 I don't remember exactly) this report works fine.

Comments

  • edited October 2005
    I just found another problem "upgrade-related"
    The case statement

    A code like this

    case SomePipeline[SomeField] of
    1: ..
    2: ..
    end;

    with 9 gives an AV
    which you can workaround assigning the field to a variable

    var
    FldValue integer;

    ...

    FldValue := Pipeline[SomeField]
    case FldValue

    This way it works.
    But I have to search *all* reports to fix this!
  • edited October 2005

    I cannot reproduce either one of these in my testing here and we have had no
    reports of any compatibility issues between upgrading reports written in RB
    7.x.

    Perhaps you have a corrupt installation. Try following the instructions in
    the following article.

    --------------------------------------------
    Article: Cleaning up a Corrupt Installation
    --------------------------------------------

    If you have been advised by Digital Metaphors technical support that you may
    have a corrupt installation, or if you are having difficulty installing,
    compiling or running applications after a ReportBuilder install, then it may
    be necessary to manually remove all ReportBuilder files from your system.
    Corrupt installations usually result when you are installing over a previous
    version of ReportBuilder which was not installed into the default directory,
    which was recompiled from the source, or when ReportBuilder files were
    manually moved from the default install location. Cleaning up a corrupt
    installation, consists of locating all ReportBuilder related files, and
    deleting them from your system. The first step is to use the uninstall
    program to remove as much of ReportBuilder as possible.


    Run the uninstall program

    1. Exit Delphi, and all other applications. You should have no applications
    running except the uninstall, otherwise you may lose some of your work.

    2. Select Start | Settings | Control Panel from your Windows desktop.

    3. Double-click the Add/Remove programs icon.

    4. Locate the version of ReportBuilder you wish uninstall and double-click
    it.

    5. The first page of the Uninstall Wizard allows you to choose between an
    Automatic or Custom uninstall. Choose Custom and click the Next button.

    6. Click the Select All button, then the Next button. Repeat these steps
    until you reach the last page of the wizard.

    7. Click the Finish button. All of the items you selected will be removed
    from the system.

    8. After all the ReportBuilder files are removed, you may be prompted to
    reboot the system. If this is the case, reboot the system.


    Delete the ReportBuilder root directory (and all subdirectories)

    1. Using the Windows Explorer, locate the ReportBuilder root directory. The
    default directory is:

    C:\Program Files\Borland\DelphiX\RBuilder

    2. Once you have located this directory, inspect it. If you have any custom
    work in this directory which you would like to keep, move it to another
    directory.

    3. Delete the ReportBuilder root directory.


    Delete all remaining ReportBuilder files

    1. Using the Windows Explorer, search the entire hard drive for all
    occurrences of:

    dclRB*.bpl
    dclRB*.dcp
    rb*.bpl
    rb*.dcp

    2. Delete any occurrences which correspond to the version you are removing.
    All packages are named with the convention NN, where the first number
    is the ReportBuilder version and the second number is the Delphi version.
    Thus, a typical package name for Delphi 5 would be rbRCL45.bpl. The same
    package for Delphi 4 would be: rbRCL44.bpl. Check Installing ReportBuilder
    for a list of the packages associated with each version.

    3. Using the Windows Explorer, search your hard drive for all occurrences
    of:

    pp*.*
    da*.*
    ra*.*

    4. These are the prefixes used by individual ReportBuilder units. 'pp' is
    used for ReportBuilder units, 'da' is used for DADE units, and 'ra' is used
    for RAP units. Depending on which ReportBuilder you have (Standard,
    Professional or Enterprise) you may not have all of these unit types.



    Additional Notes

    1. Never have Delphi running when installing ReportBuilder.

    2. All ReportBuilder related files should be stored in the root directory
    $(DELPHI)\RBuilder.

    3. All ReportBuilder run-time packages should be stored in the
    Windows\System directory.

    4. You should never have ReportBuilder files in Delphi\Lib, Delphi\Bin or
    Delphi\Projects\Bpl.

    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2005
    Hi Nard,

    I followed the instructions and removed and re-installed rb on my
    machine but sadly this not resolved my issue.
    I analyzed it better and found the root cause.
    I think you should be able to reproduce it.
    Here are the steps:

    0. Pick an end user report with at least a database table in it
    (the database type *should* not be relevant)
    1. Define an AutoSearchField on a *integer* field
    2. Define a rap function (e.g. HeaderBeforePrint) in which you read the
    as.value in a string variable. E.g.

    procedure HeaderBeforePrint;
    var
    sEmp : string;
    begin
    sEmp := Report.AutoSearchCriteriaByName(Report.DataPipeline.Name,
    'EMPNO').Value;
    end;

    3. When launching the report, don't specify any value

    This causes the error in (I think) TppAutoSearchField.ConvertValue

    '' is not a valid integer value

    For my test I used two version (rb 7.04 and 9.02) of the EndUser program
    in demos\end user databases\Oracle 8\doa.

    The one compiled with 7.04 doesn't give the error.
    It seems that 7.04 silently convert an empty autosearchfield value in an
    empty string
    while 9.02 complains that this is not "a valid integer value"

    May you try to reproduce in this way?

    Many thanks
    Bye
    Nicola
  • edited October 2005

    I researched this and have created a patch for RB 9.02.

    Another alternative is to access AutoSearch.SearchExpression property. It
    always returns the string entered by the user. (But I realize in this case
    you are looking to provide backward compatibility)


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2005
    Nard Moseley (Digital Metaphors) ha scritto:
    Yes, backward compatibility is my target since I have
    quite some dozens of reports written in 7.04
    Many thanks.
    Bye
    Nicola
  • edited November 2005
    Nard Moseley (Digital Metaphors) wrote:


    Where can I get this patch?

    Carsten
  • edited November 2005

    Upate to RB 9.03.

    If you are a registered user of RB 9.x and did not receive notifaction about
    RB 9.03, please email info@digital-metaphors.com with your serial number and
    registration information and request it.





    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2005
    Nard Moseley (Digital Metaphors) wrote:


    Ouch... am already using 9.03 :)

    Carsten
This discussion has been closed.