The CREPORTINPUT formula allows you to give users of your Published Reports a data entry field that can be used by other parts of your report.
CREPORTINPUT (Value, InputType, AutoCalc)
Specify the default value to show when the report is published.
"Text" to let the formula know what type of data will be put into this input in a report. Specifying
"Number" will mean that users can only enter numeric values.
Specify if changing the value will “automatically” trigger a calculate on the report.
A classic use of this formula is to provide users with a field on a report in order to drive a top count, by passing the value of the CREPORTINPUT cell into the MDX query.
This simple number example calculates a number of values based upon the input of two numbers. Input of “Number A” will trigger an automatic recalculation, whereas “Number B” won’t trigger a recalculation.
Entering 10 into “Number A” and pressing Enter results in the following screen. A number of fields have updated automatically:
Entering 2 into “Number B” and pressing Enter still leaves the selector on “Number B”:
Clicking on “Number A” allows us to move off the input, but has not updated the calculations.
To update the calculations we must press F9 (or recalculate).
Any time “Number A” changes, we just need to press Enter for a recalculation to occur. For Number B the user must explicitly request the recalculation (F9).
Utilising the CALUMO CREFLEX function, we can obtain the top n products from Adventure Works. Relevant formulas are:
CReportInput Cell B5:
MDX Cell B10 using CCONCAT:
ReflexReportCell Cell A14:
Formatting has been defined in cells B12:D12.
Cell B15 has the constant
On publish we see the following:
Changing the CReportInput value to
20 (in the web) and recalculating (F9) changes our list of products to the following:
5, we obtain the following: