EaxMdService.createCopy

Syntax

createCopy(report: EaxAnalyzer, parentKey: Number, name: String, id: Number, withSave: boolean, saveOperation, callback);

Parameters

report. Source express report.

parentKey. Key of the parent folder to which the express report is copied.

name. Name of the new express report.

id. Identifier of the created express report.

withSave. Indicates that the express report is to be saved.

saveOperation. Save operation is specified by means of the PP.Mb.ObjectCopyOperation enumeration.

callback. Callback function to be called after the user has created an express report copy.

Description

The createCopy method creates an express report copy.

Comments

The method returns an object of the PP.Exp.EaxDocument type.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). A folder with the 109 key must be available in the repository:

Create a copy of the source express report:

// Declare callback function that is called after creating an express report copy.
var createCopyFunction = function (sender, args) {    
    var source = args.Args && (args.Args.Document || args.Args.Report);    
    if (source) {
        expressBox.setSource(source);    
    }
};
// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Create a copy of express report
var newCopy = eaxMdService.createCopy(eaxAnalyzer, 109, "New_report", "EXP_DYN", True, PP.Mb.ObjectCopyOperation.CreateNew, PP.Delegate(createCopyFunction, expressBox, {
    Document: eaxAnalyzer    
}));

After executing the example a copy of the express report is created in the folder with specified key.

Then run the following code:

// Get express report copy key
console.log("Source express report: " + expressBox.getSource().getKey());
console.log("Express report copy key: " + newCopy.getKey());
console.log("Express report copy name: " + newCopy.getName());

After executing the example the browser console displays key and name of the created express report copy, and also the key of the source express report:

Key of the source express report: 109
Key of express report copy: 2667
Name of the express report copy: New_report

See also:

EaxMdService