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

Undeclared Identifier?

edited August 2006 in General
Hello All!

I am using RB version 10.03 release 2, and I am seeing the above message
at the most puzzling times. Here is what is happening.

Let's say I have a query (Query1) and a field of that query called Field1.
When I setup a "variable" component which references Query1.Field1 in
the computation, as long as I am in the designer, everything seems just
fine.

That is to say, once I finish the code in the variable (i.e. value :=
Query1.Field1/2.5),
and then when I right click in the window and click on save or compile, in
the status bar at the bottom of the window, I see the message "Compile
Completed: 0 Errors".

Next, when I go to run my report from my app, I notice that the value that
is being displayed in "variable", is always 0.00. That should not be the
case
as Query1.Field1 always has values.

Now, when I go back into the designer, I notice that the OnCalc event of the
"variable" component is suddenly "Red", indicating that is has an error.
Once I open the event, I see the message..."Undeclared Identifier Query1".

That brings me to my question; why does RB think Query1 is undeclared?
Especially since I can drag from it to the report?

Thanks in advance for any and all replies.

Regards,
Everett

Comments

  • edited August 2006
    Hi Everett,

    First I would recommend upgrading your version of ReportBuilder to the
    latest, 10.04. This would be a free upgrade if you are a registered user of
    RB 10.x. Contact info@digital-metaphors.com for upgrade information.

    If the problem still occurs, please provide the exact steps you are taking
    to create the issue so that I can try to recreate it on my machine. So far,
    here are the steps I took...

    1. Create a new application, place a Report and button on the form. Call
    Report.Print from the button's OnClick event.
    2. Create a new dataview in DADE pointing to the Orders table in the
    DBDEMOS database.
    3. Add a TppVariable to the detail band of the report.
    4. In RAP, implement the OnCalc event of the variable with the following
    code... then compile.

    value := orders['AmountPaid'];

    5. Preview the report, close the designer and run the application. The
    previews match.
    6. Go back into the designer and the OnCalc event is still green.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2006
    Thanks for your repsonse Nico! I will do what you suggest and get back to
    you and the group.

    Regards,
    Everett


  • edited September 2006
    Nico:

    We finally got back around to digging into this issue further. As it turns
    out, here was the issue as quoted by another thread.

    - For RB 10.03, the GlobalOnCreate is fired called from the
    Report.InitializeParameters method. This change was made because it was
    firing too late (after the autosearch dialog had been displayed). It needs
    to fire before any other events.

    - The Report.Print method internally calls Report.InitializeParameters as
    the first line of code.

    - The DesignPreview has this code

    if FReport.InitializeParameters then
    FReport.PrintToDevices;

    - If you are calling PrintToDevices, add a line of code like the one shown
    above. That should fix it.





    Nico, thank you again for your advice and your help,

    Regards,

    Everett





This discussion has been closed.