1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" width="100%"
|
---|
3 | xmlns:widget="gov.va.med.edp.widget.*"
|
---|
4 | height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
|
---|
5 |
|
---|
6 | <mx:Script>
|
---|
7 | <![CDATA[
|
---|
8 | import gov.va.med.edp.control.reports.ReportDownloadEvent;
|
---|
9 | import gov.va.med.edp.util.ReportUtil;
|
---|
10 | import mx.controls.dataGridClasses.DataGridColumn;
|
---|
11 | import gov.va.med.edp.vo.reports.ShiftReportColumnVO;
|
---|
12 | import mx.core.Application;
|
---|
13 | import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
|
---|
14 | import mx.printing.FlexPrintJob;
|
---|
15 | import gov.va.med.edp.model.TrackingModelLocator;
|
---|
16 | import gov.va.med.edp.util.ChangeWatcher;
|
---|
17 | import gov.va.med.edp.util.AccessibilityTools;
|
---|
18 |
|
---|
19 | [Bindable]
|
---|
20 | private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
|
---|
21 |
|
---|
22 | private function buildGridColumns():void {
|
---|
23 | var newCols:Array = new Array();
|
---|
24 | var newCol: DataGridColumn;
|
---|
25 | //add the category column first
|
---|
26 | newCol = new DataGridColumn('category');
|
---|
27 | newCol.headerText = 'Category';
|
---|
28 | newCol.dataField = 'category';
|
---|
29 | newCol.width = 230;
|
---|
30 | newCols.push(newCol);
|
---|
31 | //add shift columns
|
---|
32 | for each (var colInfo: ShiftReportColumnVO in model.reports.shiftReport.shiftReportColumns) {
|
---|
33 | newCol = new DataGridColumn(colInfo.name);
|
---|
34 | newCol.headerText = colInfo.name;
|
---|
35 | newCol.dataField = colInfo.shiftId;
|
---|
36 | newCols.push(newCol);
|
---|
37 | }
|
---|
38 | shiftReportDataGrid.columns = newCols;
|
---|
39 | }
|
---|
40 |
|
---|
41 | private function doPrint():void {
|
---|
42 | var printJob:FlexPrintJob = new FlexPrintJob();
|
---|
43 | if (printJob.start() != true) return;
|
---|
44 |
|
---|
45 | ReportUtil.printDataGrid(printJob,shiftReportDataGrid.columns, shiftReportDataGrid.dataProvider, lblReportTitle.text);
|
---|
46 | printJob.send();
|
---|
47 | }
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 | ]]>
|
---|
52 | </mx:Script>
|
---|
53 | <mx:HBox width="100%">
|
---|
54 | <mx:Label
|
---|
55 | id="lblReportTitle"
|
---|
56 | text="{ReportUtil.buildReportLabelText('ED Shift Summary Report')}"
|
---|
57 | paddingTop="0"
|
---|
58 | paddingBottom="0"
|
---|
59 | width="100%"
|
---|
60 | styleName="viewTitle"
|
---|
61 | textAlign="center" />
|
---|
62 | <mx:HBox id="exportButton">
|
---|
63 | <widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_SHIFT_REPORT);}" tabIndex="1900"/>
|
---|
64 | <mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
|
---|
65 | </mx:HBox>
|
---|
66 | <widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>
|
---|
67 | </mx:HBox>
|
---|
68 | <mx:DataGrid id="shiftReportDataGrid"
|
---|
69 | initialize="{AccessibilityTools.accessComponentName(shiftReportDataGrid,ReportUtil.accessibleReportLabelText('ED Shift Summary Report'))}"
|
---|
70 | dataProvider="{model.reports.shiftReport.shiftCategories}"
|
---|
71 | width="100%"
|
---|
72 | height="100%"
|
---|
73 | creationComplete="buildGridColumns()"
|
---|
74 | tabIndex="1100"/>
|
---|
75 | </mx:VBox>
|
---|