CB.CreateRptND

This subroutine sets report preferences and creates a Crystal Ball report. For any preferences not manually set, the default is the current setting in the Create Report dialog. Use CB.CheckData before using this call.

Note:

Although Full is the default report type in the Create Report dialog, Custom (cbRptCustom) is the default report for CB.CreateRptND.

To create a custom report, call CB.CreateRptND as follows before creating the report:

CB.CreateRptND cbRptDefinedType, cbRptCustom

Table 30. CB.CreateRptND Parameters

Parameter

VBA Data Type

Description

Index

Integer

Specifies which report preference you are setting. See Table 31.

Value1 (Optional)

Variant

Specifies settings for the preference indicated by Index. See Table 31.

Value2 (Optional)

Variant

Specifies settings for the preference indicated by Index. See Table 31.

Table 31 shows each Index value and the corresponding Value1 and Value2 parameter values.

Table 31. Index and corresponding Value1 and Value2 Parameters

Named Constant Value

Index Value

Description

Value1 (Optional)

Value2 (Optional)

cbRptOK

1

Generates the report. Use this parameter after setting other report options.

n/a

n/a

cbRptTrendChart

2

Includes all open trend charts in the report at a specified scale

(Boolean) True includes the chart; False does not.

(Integer) 1 to 200 defines the percent scale of the chart.

cbRptSensitivChart

3

Includes all open sensitivity charts in the report at a specified scale

(Boolean) True includes the chart; False does not.

(Integer) 1 to 200 defines the percent scale of the chart.

cbRptForeSummaries

4

Includes summary information about the included forecasts

(Boolean) True includes the summaries. False does not.

n/a

cbRptForeStatistics

5

Includes the statistics table for each included forecast

(Boolean) True includes the statistics. False does not.

n/a

cbRptForeCharts

6

Includes the frequency chart for each included forecast at a specified scale

(Boolean) True includes the chart; False does not.

(Integer) 1 to 200 defines the percent scale of the chart.

cbRptForePercentiles

7

Includes the percentile statistics for each included forecast

(Boolean) True includes the percentiles. False does not.

(Integer) See Table 32.

cbRptChooseFore

9

enables you to clear, add, and set the list of forecasts to include in the report

(Integer) See table Table 33, following.

n/a

cbRptAssumParam

10

Includes the distribution parameters for each included assumption

(Boolean) True includes the parameters. False does not.

n/a

cbRptAssumCharts

11

Includes the distribution graph for each included assumption at the specified scale

(Boolean) True includes the chart; False does not.

(Integer) 1 to 200 defines the percent scale of the chart.

cbRptChooseAssum

12

Clears, adds, and sets the assumptions to include in the report

(Integer) See table Table 34 following.

n/a

cbRptChartType

13

Selects the type of chart to include in the report

(Integer) See Table 35 following.

n/a

cbRptOverlayChart

14

Includes all open overlay charts in the report at a specified scale

(Boolean) True includes the chart; False does not.

(Integer) 1 to 200 defines the percent scale of the chart.

cbRptExistingSheet

16

Creates the report in an existing worksheet

(Boolean) True creates the report in a new page of the existing workbook. False creates the report in a new workbook.

n/a

cbRptSummary

17

Specifies which summary information to include in the report

(Boolean) True includes the parameter specified in Value2; False does not.

(Integer) See Table 36.

cbRptChooseDecVar

18

Clears, adds, and sets the list of decision variables to include in the report

(Integer) See Table 37.

n/a

cbRptDecVarBounds

19

Includes the bounds for each included decision variable

(Boolean) True includes the bounds; False does not.

n/a

cbRptDecVarType

20

Includes the type for each included decision variable

(Boolean) True includes the type; False does not.

n/a

cbRptAssumStatistics

21

Includes the statistics table for each included assumption

(Boolean) True includes the statistics; False does not.

n/a

cbRptAssumPercentiles

22

Includes the percentile data for each included assumption

(Boolean) True includes percentile data; False does not.

(Integer) Same as that for cbRptFore-Percentiles. See Table 32 following.

cbRptAssumCorr

23

Includes the correlations for each included assumption

(Boolean) True includes the correlations; False does not.

n/a

cbRptOverlayCharts

24

Includes the distribution graph for each included overlay chart

(Boolean) True includes the charts; False does not.

(Integer) 1 to 200 defines the percent scale of the charts.

cbRptTrendCharts

25

Includes the graph for each included trend chart

(Boolean) True includes the charts; False does not.

(Integer) 1 to 200 defines the percent scale of the charts.

cbRptSensitivityCharts

26

Includes the graph for each included sensitivity chart

(Boolean) True includes the charts; False does not.

(Integer) 1 to 200 defines the percent scale of the charts.

cbRptScatterCharts

27

Includes the graph for each included scatter chart

(Boolean) True includes the charts; False does not.

(Integer) 1 to 200 defines the percent scale of the charts.

cbRptChooseOverlay

28

Clears, adds, and sets the overlay charts to include in the report (when used with CB.SelectChart)

(Integer) See Table 38. If cbChartAdd, the selected chart is added.

n/a

cbRptChooseTrend

29

Clears, adds, and sets the trend charts to include in the report (when used with CB.SelectChart)

(Integer) See Table 38. If cbChartAdd, the selected chart is added.

n/a

cbRptChooseSensitivity

30

Clears, adds, and sets the sensitivity charts to include in the report (when used with CB.SelectChart)

(Integer) See Table 38. If cbChartAdd, the selected chart is added.

n/a

cbRptChooseScatter

31

Clears, adds, and sets the scatter charts to include in the report (when used with CB.SelectChart)

(Integer) See Table 38. If cbChartAdd, the selected chart is added.

n/a

cbRptDefinedType

32

Selects a predefined report type or uses the settings defined by the various CB.CreateRptND constants

(Integer) See Table 39.

n/a

cbRptSheetName

33

Specifies the sheet name

(String) The sheet name to create.

n/a

cbRptIncludeCellLocs

34

Includes the cell location in the report

(Boolean) True includes the cell location information; False does not.

n/a

cbRptSection

35

Indicates whether to include or exclude entire report sections

(Boolean) True includes the report section specified in Value2; False excludes the specified section.

(Integer) See Table 40.

cbRptSectionOrder

36

Specifies the order of the report sections.

Note:

Sections must be explicitly included using cbRptSection statements.

(String) A string of ten comma-separated values (listed in Table 40) that specify the section order. For example: 1,6,7,8,2,3,4,5,9,10 indicates that the report should include sections in this order: Summary, Forecasts, Assumptions, Decision Variables, Overlay, Trend, Sensitivity, Scatter, OptQuest results, Predictor forecasts

n/a

cbRptCapMetrics

37

Specifies whether to report capability metrics for forecasts in custom reports

True includes the metrics; False does not include the metrics.

n/a

cbRptScatterChart

38

Includes all open scatter charts in the report at a specified scale

(Boolean) True includes the chart; False does not.

(Integer) 1 to 200 defines the percent scale of the chart.

cbRptOptimizerSummary

39

Includes the OptQuest Summary section in the report following an optimization run

(Boolean) True includes the OptQuest summary information; False does not.

n/a

cbRptOptimizerChart

40

Includes the optimization solution graph in the report following an optimization run

(Boolean) True includes the chart; False does not.

(Integer) 1 to 200 defines the percent scale of the chart.

cbRptOptimizerBestSolution

41

Includes the OptQuest Best Solution section in the report following an optimization run

(Boolean) True includes the OptQuest best solution information; False does not.

n/a

cbRptOptimizerConstraints

42

Includes the OptQuest Constraints section in the report following an optimization run

(Boolean) True includes the OptQuest constraints information; False does not.

n/a

cbRptOptimizerDecVars

43

Includes the OptQuest Decision Variables section in the report following an optimization run

(Boolean) True includes the OptQuest decision variables information; False does not.

n/a

cbRptPredictorChart

45

Includes Predictor results charts for each series in the report following a Predictor run.

(Boolean) True includes the charts; False does not.

(Integer) 1 to 200 defines the percent scale of the charts.

cbRptPredictorStatistics

46

Includes the Predictor Statistics section in the report following a Predictor run

(Boolean) True includes the Predictor statistics information; False does not.

n/a

cbRptPredictorAutocorrelations

47

Includes the Predictor Autocorrelations section in the report following a Predictor run

(Boolean) True includes the Predictor autocorrelations information; False does not.

n/a

cbRptPredictorForecast

48

Includes the Predictor Forecasts section in the report following a Predictor run

(Boolean) True includes the Predictor forecasts information; False does not.

n/a

cbRptPredictorConfidenceIntervals

49

Includes the Predictor Confidence Intervals section in the report following a Predictor run

(Boolean) True includes the Predictor confidence intervals information; False does not.

n/a

cbRptPredictorMethods

50

Indicates which Predictor Methods to include in the report

(Integer) See Table 41 following.

n/a

Note:

The following constants have been removed since Crystal Ball 2000.5 (5.5): cbRptForeFrequencies = Index 8 (obsolete), cbRptDecVar = Index 15 (included in CB 7.1 and later for compatibility; users should migrate to using cbRptChooseDecVar instead). cbRptScatterChart [38] and similar constants such as cbRptOverlayChart [14] include all open charts of the selected type, as stated in their descriptions. These constants override any previous settings made with “Choose” commands, such as cbRptChooseScatter [31]. The cbRptOptimizer... constants (39-43) were added in Crystal Ball 11.1.1.0.00

With Index set to cbRptForePercentiles, you can specify which percentile ranges to include in the report (see Table 32).

Table 32. For Index = cbRptForePercentiles, Value2 Values — Optional, Integer

Named Constant Value

Index Value

Percentile Ranges

cbPctQuartiles

1

Quartiles (25%)

cbPctQuintiles

2

Quintiles (20%).

cbPctDeciles

3

Deciles (10%). This is the default.

cbPctIcosatiles

4

Icosatiles (5%)

cbPctSet1

5

2.5, 5, 50, 95, 97.5%-iles

cbPctSet2

6

10, 25, 50, 75, 90%-iles

cbPctSet3

7

5, 95% percentiles

cbPctSet4

8

10, 90% percentiles

With Index set to cbRptChooseFore, you can specify which forecasts to include in the report (see Table 33).

Table 33. For Index = cbRptChooseFore, Value1 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbChfAll

1

Includes all forecasts

cbChfOpen

2

Includes open forecasts

cbChfChosen

3

Includes chosen forecasts. Run this option after adding forecasts.

cbChfAdd

4

Adds the forecast in the selected cell to the list of chosen forecasts

cbChfClearList

5

Clears the list of chosen forecasts

With Index set to cbRptChooseAssum, you can specify which assumptions to include in the report (see Table 34).

Table 34. For Index = cbRptChooseAssum, Value1 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbChaAll

1

Includes all assumptions

cbChaChosen

2

Includes chosen assumptions. Run this option after adding assumptions.

cbChaAdd

3

Adds the assumption in the selected cell to the chosen assumptions. Use cbChaChosen after this option.

cbChaClearList

4

Clears the list of chosen assumptions

cbChaOpen

5

Includes all open assumptions

With Index set to cbRptChartType, you can specify what type of chart the report uses (see Table 35).

Table 35. For Index = cbRptChartType, Value1 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbChtColored

1

Makes all charts colored, Crystal Ball format

cbChtExcel

2

Makes all charts Microsoft Excel format

Note:

cbChtBW = 0 was removed as an index to this parameter.

With Index set to cbRptSummary, you can specify what to include in the summary (see Table 36).

Table 36. For Index = cbRptSummary, Value2 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbRptSummaryTitle

1

Includes the report title

cbRptSummaryDate

2

Includes the date

cbRptRunPreferences

3

Includes run preferences for the simulation

cbRptRunStatistics

4

Includes run statistics for the simulation

With Index set to cbRptChooseDecVar, you can specify which decision variables to include in a report (see Table 37).

Table 37. Index = cbRptChooseDecVar, Value1 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbChdAll

1

Includes all decision variables

cbChdChosen

2

Includes chosen decision variables. Include a statement with this constant after added decision variables

cbChdAdd

3

Adds the decision variable in the selected cell to the list of chosen decision variables

cbChdClearList

4

Clears the list of chosen decision variables

With Index set to cbRptChooseOverlay, cbRptChooseTrend, or cbRptChooseSensitivity, you can specify which individual charts to include in a report when charts are selected with CB.SelectChart (see Table 38).

Table 38. For Index = cbRptChooseChartype, Value1 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbChartAll

1

Includes all charts of the specified type

cbChartOpen

2

Includes all open charts of the specified type

cbChartChosen

3

Includes chosen charts of the specified type

cbChartAdd

4

Adds the selected chart to the list of chosen charts

cbChartClearList

5

Clears the list of chosen charts

With Index set to cbRptDefinedType, you can indicate which predefined report type to use (see Table 39).

Table 39. For Index = cbRptDefinedType, Value1 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbRptFull

1

Report format is the predefined full report

cbRptAssumption

2

Report format is the predefined assumption report

cbRptForecasts

3

Report format is the predefined forecast report

cbRptDecVars

4

Report format is the predefined decision variable report

cbRptIndex

5

Report format is the predefined index report

cbRptCustom

6

Report format is set through various CB.CreateRptND code statements

cbRptOptimizer

7

Report format is the predefined OptQuest report, available following an OptQuest optimization run

cbRptPredictor

8

Report format is the predefined Predictor report, available following a Predictor forecasting run

With Index set to cbRptSection, you can use the following constants as the Value2 parameter to specify the order of report sections (see Table 40).

Table 40. For Index = cbRptSection, Value2 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbRptSectSummary

1

Includes the summary section

cbRptSectOverlay

2

Includes the overlay chart section

cbRptSectTrend

3

Includes the trend chart section

cbRptSectSensitivity

4

Includes the sensitivity chart section

cbRptSectScatter

5

Includes the scatter chart section

cbRptSectForecasts

6

Includes the forecasts section

cbRptSectAssumptions

7

Includes the assumptions section

cbRptSectDecVars

8

Includes the decision variables section

cbRptSectOptimizerResults

9

Includes the OptQuest results section, following an OptQuest optimization run

cbRptSectPredictorSeries

10

Includes the Predictor results section, following a Predictor forecasting run

With Index set to cbRptPredictorMethods, you can use the following constants as the Value1 parameter to specify which forecasting methods to include in Predictor report data (see Table 41).

Table 41. For Index = cbRptPredictorMethods, Value1 Values — Optional, Integer

Named Constant Value

Index Value

Description

cbPredictorMethodsNone

1

Includes no methods

cbPredictorMethodsAll

2

Includes all methods

cbPredictorMethods1Best

3

Includes the method with the best accuracy

cbPredictorMethods2Best

4

Includes the method with the second-best accuracy

cbPredictorMethods3Best

5

Includes the method with the third-best accuracy

Use cbRptOK to generate the report after you use the other index values to set report preferences.

A simulation must not be in progress. If a simulation has not yet run, the report only includes assumption information.

Note:

To add individual charts, use constants cbRptChooseOverlay, cbRptChooseTrend, and cbRptChooseSensitivity from Table 30. Use these constants with CB.SelectChart and the constants in Table 38. If you create a chart through the Developer Kit, open it before including it in a report. Otherwise, the chart will show up in the report with a “no data available” message. See the Oracle Crystal Ball User's Guide for more information on creating reports.