2015-01-23 13:09:30 +00:00
|
|
|
|
2015-09-22 07:20:47 +00:00
|
|
|
Vn.Report = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
2015-08-17 18:02:14 +00:00
|
|
|
Extends: Vn.Object
|
|
|
|
|
2015-09-22 07:20:47 +00:00
|
|
|
,initialize: function (props)
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
2015-09-22 07:20:47 +00:00
|
|
|
this.parent (props);
|
|
|
|
this.open ();
|
|
|
|
}
|
|
|
|
|
|
|
|
,showWindow: function ()
|
|
|
|
{
|
|
|
|
var reportWindow = window.open ('js/hedera/report.html', reportPath,
|
|
|
|
'resizable=yes,height=600,width=750,scrollbars=yes,menubar=no');
|
|
|
|
//report.print ();
|
|
|
|
|
|
|
|
Vn.includeCss ('reports/'+ reportPath +'/style.css');
|
|
|
|
window.document.body.appendChild (this.node);
|
|
|
|
|
|
|
|
var report = new Vn.Report (reportWindow.document.body);
|
|
|
|
return reportWindow;
|
2015-07-28 19:14:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-09-22 07:20:47 +00:00
|
|
|
* Gets an object from the builder associated to this report.
|
2015-07-28 19:14:26 +00:00
|
|
|
*
|
|
|
|
* @param {string} objectId The object identifier
|
|
|
|
* @return {Object} The object, or %null if not found
|
|
|
|
**/
|
|
|
|
,$: function (objectId)
|
|
|
|
{
|
2015-08-17 18:02:14 +00:00
|
|
|
if (this.builder)
|
|
|
|
return this.builder.get (objectId);
|
|
|
|
|
|
|
|
return null;
|
2015-07-28 19:14:26 +00:00
|
|
|
}
|
2015-01-23 13:09:30 +00:00
|
|
|
|
2015-07-28 19:14:26 +00:00
|
|
|
/**
|
|
|
|
* Called when the form is opened.
|
|
|
|
**/
|
|
|
|
,open: function ()
|
2015-09-22 07:20:47 +00:00
|
|
|
{
|
2015-01-23 13:09:30 +00:00
|
|
|
this.builder = new Vn.Builder ();
|
2015-03-27 19:10:49 +00:00
|
|
|
this.builder.signalData = this;
|
2015-09-22 07:20:47 +00:00
|
|
|
this.builder.loadXml (Vn.getXml ('reports/'+ this.reportPath +'/report.xml'));
|
2015-03-06 23:33:54 +00:00
|
|
|
this.node = this.builder.get ('form');
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
var models = this.builder.getObjects ('db-model');
|
|
|
|
|
|
|
|
for (var i = 0; i < models.length; i++)
|
|
|
|
models[i].conn = this.conn;
|
|
|
|
|
2015-07-17 14:34:42 +00:00
|
|
|
var queries = this.builder.getObjects ('db-query');
|
|
|
|
|
|
|
|
for (var i = 0; i < queries.length; i++)
|
|
|
|
queries[i].conn = this.conn;
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
2015-07-28 19:14:26 +00:00
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
2015-07-28 19:14:26 +00:00
|
|
|
* Called when the form is activated.
|
2015-01-23 13:09:30 +00:00
|
|
|
**/
|
|
|
|
,activate: function () {}
|
2015-09-22 07:20:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when the form is deactivated.
|
|
|
|
**/
|
|
|
|
,deactivate: function () {}
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
/**
|
2015-01-31 01:05:12 +00:00
|
|
|
* Called when the form is closed.
|
2015-01-23 13:09:30 +00:00
|
|
|
**/
|
|
|
|
,close: function ()
|
|
|
|
{
|
2015-09-22 07:20:47 +00:00
|
|
|
this.builder.unref ();
|
|
|
|
this.builder = null;
|
2015-01-23 13:09:30 +00:00
|
|
|
}
|
2015-08-17 18:02:14 +00:00
|
|
|
|
|
|
|
,_destroy: function ()
|
|
|
|
{
|
|
|
|
this.close ();
|
2015-08-31 13:56:01 +00:00
|
|
|
this.parent ();
|
2015-08-17 18:02:14 +00:00
|
|
|
}
|
2015-01-23 13:09:30 +00:00
|
|
|
});
|
|
|
|
|