At 10:32 AM 2/26/2008, [EMAIL PROTECTED] wrote:

Would anyone be able to tell me how to capture a DbCalc in a report in to
a variable for the purpose of using the result in other calculations in
the report?

Here's how:

01. While in Report Designer, assign a <Component ID> to DB Calc object

02. Use the following GETPROPERTY command as "Before Generate Custom EEP"
    for the appropriate DB Calc band.

03. Example:

    CLEAR VARIABLE vCustInvoiceTxt, vCustInvoiceTot
    SET VARIABLE vCustInvoiceTxt TEXT = NULL
    SET VARIABLE vCustInvoiceTot CURRENCY = 00.00
    GETPROPERTY CustomerInvoiceTotal VALUE vCustInvoiceTxt
    SET VARIABLE vCustInvoiceTot = (FLOAT(.vCustInvoiceTxt))
    SET VAR vPercentage = (ROUND(((.vCustInvoiceTot/.vCoverPageTot)*100),2))
    PROPERTY CustomerPercent CAPTION .vPercentage

    Where CustomerInvoiceTotal is the Component ID for (SUM(InvoiceTotal))
    DB Calc.

    Calc Type: Sum
    Reset Break[0]: Company

And that's all there is to it!

A sample application to demonstrate the use of such feature is also included
on the 2007 and 2008 R:BASE 7.6/Turbo V-8 Super Advanced Training CD.

Folder: \CapturingDBCalcResultsAsVariablesInReports
Database: DBCalc
Associated Report: SalesAnalysis
Startup File: CapturingDBCalcResultsAsVariablesInReports.DAT

Updated versions of RBG76/RBG8 SAT Sample Applications:

R:BASE 7.6 SAT Applications: http://www.rupdates.com/rbg76SAT/
R:BASE Turbo V-8 SAT Applications: http://www.rupdates.com/rbg8SAT/

Very Best R:egards,

Razzak.


Reply via email to