ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

report.js
Go to the documentation of this file.
1
6 if( !ultimix )
7 {
8 ultimix = {};
9 }
10
16 if( !ultimix.report )
17 {
18 ultimix.report = {};
19 }
20
34 ultimix.report.compile_iframe_code = function( PackageName , PackageVersion , ReportName , ReportGenerationParameters )
35 {
36 var IFrameCode = '<iframe id="report_generation_id" style="display: none;" ' +
37 'src="./report.html?report_package_name=';
38
39 IFrameCode = IFrameCode + PackageName + '&report_package_version=' + PackageVersion;
40
41 IFrameCode = IFrameCode + '&report_name=' + ReportName + '&' + ( new Date() ).getTime();
42
43 return( IFrameCode + ReportGenerationParameters + '"></iframe>' );
44 }
45
59 ultimix.report.create_frame = function( PackageName , PackageVersion , ReportName , Data )
60 {
61 if( jQuery( '#report_generation_id' ).length )
62 {
63 jQuery( '#report_generation_id' ).remove();
64 }
65
66 var ReportGenerationParameters = '';
67 if( !Data )
68 {
69 Data = {};
70 }
71 for( i in Data )
72 {
73 ReportGenerationParameters = '&' + i + "=" + new String( Data[ i ] ) + ReportGenerationParameters;
74 }
75
76 jQuery( 'body' ).append(
77 ultimix.report.compile_iframe_code( PackageName , PackageVersion , ReportName , ReportGenerationParameters )
78 );
79 }
80
90 ultimix.report.report_generation_process = function( OnGenerate , ShowProgress )
91 {
92 if( ShowProgress )
93 {
94 var LoadingId = ultimix.std_dialogs.WaitingMessageBox( 'report_is_generating' , 'report_dialog' );
95 }
96
97 jQuery( '#report_generation_id' ).load(
98 function()
99 {
100 if( ShowProgress )
101 {
102 ultimix.std_dialogs.close_message_box( LoadingId );
103 }
104 if( OnGenerate )
105 {
106 OnGenerate();
107 }
108 }
109 );
110 }
111
129 ultimix.report.generate_report = function( Name , Version , ReportName , Data , OnGenerate , ShowProgress )
130 {
131 ultimix.report.create_frame( Name , Version , ReportName , Data );
132
133 ultimix.report.report_generation_process( OnGenerate , ShowProgress );
134 }
135
147 ultimix.report.on_run_report_generation = function( DataAcceptor , StatusAcceptor , DataSource )
148 {
149 var PackageName = jQuery( DataSource ).find( 'span.package_name' ).html();
150 var PackageVersion = jQuery( DataSource ).find( 'span.package_version' ).html();
151 var ReportName = jQuery( DataSource ).find( 'span.report_name' ).html();
152 var Data = ultimix.forms.extract_form_data( DataSource );
153
154 ultimix.report.generate_report( PackageName , PackageVersion , ReportName , Data , false , true );
155 }