Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Location
    amsterdam
    Posts
    31

    Unanswered: how to use a form's calculated field in a report

    Is it possible to use a calculated field that is made in a form into a report other than to recalculate it in the report? The calculated field does not have a name although it has a field number.

  2. #2
    Join Date
    Feb 2004
    Location
    Gold Coast, Queensland, Australia
    Posts
    15

    Red face Re: how to use a form's calculated field in a report

    Originally posted by fepsy
    Is it possible to use a calculated field that is made in a form into a report other than to recalculate it in the report? The calculated field does not have a name although it has a field number.

    There is only one way that I know of and that is to store your field in a work table and then reference that table in your report.
    YuriK

  3. #3
    Join Date
    Jan 2004
    Location
    amsterdam
    Posts
    31
    A work table? I don't know that concept, can't find it in the guides. Can you please explain. My solution for now is to add fields in the form and calculate the content in ObjectPal. Then the field is available in the report.

  4. #4
    Join Date
    Feb 2004
    Location
    Gold Coast, Queensland, Australia
    Posts
    15

    Talking

    Originally posted by fepsy
    A work table? I don't know that concept, can't find it in the guides. Can you please explain. My solution for now is to add fields in the form and calculate the content in ObjectPal. Then the field is available in the report.

    Sorry, I've been off the air for a while and haven't had the time to even get a reply posted.
    The concept of a work table is simply an application implementation. The idea is that you create a table that probably only ever has one record in it. It is best to put it into your private directory. The record can consist of any number of fields that are relevant to your needs e.g. if you need to pass an amount from a form to a report, you would define one of the fields with those characteristics. You then populate the value of the field in the form, call your report and hey presto, the value that you are passing is in the first record of the work table. The general assumption with this concept is that the contents of the field are only meant for a short life span i.e. it simply "transports" the value from one object to another where there is no other apparent "transport" available. I hope this helps you.

    Cheers.
    YuriK

  5. #5
    Join Date
    Oct 2003
    Posts
    107
    > Is it possible to use a calculated field that is made in a form into a
    > report other than to recalculate it in the report? The calculated field
    > does not have a name although it has a field number.

    In reading this thread, I think that the solution you want may lie in adding a new field to the table your report is based on, then running some objectPAL against it before calling the report. That way the data is calculated before the report is run and you simply display the field in the report.

    pseudocode:

    open table
    start scan loop
    field.value = My Calculation Equation
    end scan loop
    call report

  6. #6
    Join Date
    Jan 2004
    Location
    amsterdam
    Posts
    31
    Originally posted by lmckelvy
    > Is it possible to use a calculated field that is made in a form into a
    > report other than to recalculate it in the report? The calculated field
    > does not have a name although it has a field number.

    In reading this thread, I think that the solution you want may lie in adding a new field to the table your report is based on, then running some objectPAL against it before calling the report. That way the data is calculated before the report is run and you simply display the field in the report.

    pseudocode:

    open table
    start scan loop
    field.value = My Calculation Equation
    end scan loop
    call report

    All good solutions! Thank you for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •