Skip to Content
avatar image
Former Member

Pass Report Detail Function Variables to Report Footer

I need to track and accumulate the costs for different "PROJECTS"  and print them out on the report in the detail section.  The "PROJECTS" names are in a string variable delimited by a semi-colon, coming from a database table.  Because of this, I cannot use any of the built-in CRYSTAL grouping or summary function.

I use a CRYSTAL Formula "TheProjectsAndCostsAvg" to pass all the cost variables and project-name string variable to a function, where I split out all the data to get the various Project name(s) and cost(s).

I build string variables for each "Project' name and their costs, then pass them back to the report to print out in the detail section.

What I would like to do is accumulate the totals, that I am printing in the detail section, in the function for each project, create a string variable which includes the project names and dollar amounts.  I would like to pass this string variable back to the Report and print it out in the Report-Footer.  I have not figured out how to pass variables created in the detail section to the report footer section.

I enclosed a copy of the Formula, The Function and output.

Thanks,  Vince

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 10, 2014 at 06:04 AM

    Hi Vince,

    Could you also post a mock-up of what data you'd like to see on the footer based on the screenshot you've posted above?

    That makes it easier to propose a formula.

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

    • Hey Vince,

      Your understanding about the variables being referenced from the formula on the details section is correct.

      And yes, you can use 'VB Syntax' to create a formula too. In the formula editor, select 'VB Syntax' from the dropdown on the top that defaults to 'CR Syntax'.

      -Abhilash

  • avatar image
    Former Member
    Sep 09, 2014 at 11:07 PM

    Vince

    Try the below ex:

    You just need to force Crystal Reports to evaluate your function, so in your F2 function, add WhilePrintingRecords; to the first line, like this:

    WhilePrintingRecords; datetimevar endts; endts; 

    This should force the report to evaluate the formula as it prints each grouping.

    Thank,

    DJ

    Add comment
    10|10000 characters needed characters exceeded