To execute the example, create an HTML page and add links to the following JS and CSS file in the <head> tag:
PP.css.
PP.Express.css.
PP.js.
PP.Metabase.js.
PP.Express.js.
resources.ru.js.
The repository must also contain an express report with the 66676 key.
In the <body> tag, specify name of the function to be executed, after page body has been loaded, as attribute value:
<body onload="Ready()"> <div id="eaxGrid" style="float: left"></div> </body>
Add the following script in the <head> tag:
PP.ImagePath = "../Build/img/"; // Path to images folder PP.ScriptPath = "../Build/"; // Path to scenarios folder PP.CSSPath = "../Build/"; // Path to style files folder // Specify path to root folder containing resources files PP.resourceManager.setRootResourcesFolder("../Resources/"); // Determine regional settings PP.setCurrentCulture(PP.Cultures.ru); function Ready() { var waiter = new PP.Ui.Waiter(); // Create a repository connection metabase = new PP.Mb.Metabase({ PPServiceUrl: "PPService.axd?action=proxy", Id: "p7repository", UserCreds: { UserName: "sa", Password: "Qwerty1" }, StartRequest: function () { // When requesting metadata display a component of the PP.Ui.Waiter type waiter.show(); }, EndRequest: function () { // After metadata has been requested hide a component of the PP.Ui.Waiter type waiter.hide(); }, Error: function (sender, args) { // If error occurs, display error description alert(args.ResponseText); } }); // Open repository connection metabase.open(); // Create a service for working with express reports eaxMdService = new PP.Exp.EaxMdService({ Metabase: metabase }); // Open express report with the 66676 key for edit eaxAnalyzer = eaxMdService.openDocument(66676); // Create a table eaxGrid = new PP.Exp.Ui.EaxGrid({ Source: eaxAnalyzer, // Data source ParentNode: "eaxGrid", Service: eaxMdService, // Service }); };
After executing the example the EaxGrid component is placed on the HTML page.
See also: