IDEMPIERE-379 Reporting wizard for end users / Peer review and tests
This commit is contained in:
parent
66c3d210df
commit
3a8d5ce4fe
|
@ -0,0 +1 @@
|
|||
-- Just a placeholder
|
|
@ -96,7 +96,7 @@ INSERT INTO AD_ToolBarButton (Name,ComponentName,IsCustomization,KeyStroke_KeyCo
|
|||
|
||||
-- Oct 30, 2012 10:00:40 AM COT
|
||||
-- IDEMPIERE-379 Reporting wizard for end users
|
||||
UPDATE AD_ToolBarButton SET Name='ReportWizard', ComponentName='Wizard',Updated=TO_DATE('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066
|
||||
UPDATE AD_ToolBarButton SET Name='Report - Wizard', ComponentName='Wizard',Updated=TO_DATE('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066
|
||||
;
|
||||
|
||||
-- Oct 30, 2012 10:08:19 AM COT
|
||||
|
@ -139,7 +139,6 @@ INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,V
|
|||
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200100 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
|
||||
;
|
||||
|
||||
|
||||
SELECT register_migration_script('923_IDEMPIERE_379.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1 @@
|
|||
-- Just a placeholder
|
|
@ -94,10 +94,9 @@ INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTransla
|
|||
INSERT INTO AD_ToolBarButton (Name,ComponentName,IsCustomization,KeyStroke_KeyCode,KeyStroke_Modifiers,AD_Client_ID,AD_Org_ID,Created,CreatedBy,AD_ToolBarButton_ID,Updated,UpdatedBy,IsActive,AD_ToolBarButton_UU,"action") VALUES ('Zk-ReportWizard','org.idempiere.ui.report','N',0,0,0,0,TO_TIMESTAMP('2012-10-29 11:56:09','YYYY-MM-DD HH24:MI:SS'),100,200066,TO_TIMESTAMP('2012-10-29 11:56:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','6009b32b-e28e-4c13-87fc-4df00c5730c9','R')
|
||||
;
|
||||
|
||||
|
||||
-- Oct 30, 2012 10:00:40 AM COT
|
||||
-- IDEMPIERE-379 Reporting wizard for end users
|
||||
UPDATE AD_ToolBarButton SET Name='ReportWizard', ComponentName='Wizard',Updated=TO_TIMESTAMP('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066
|
||||
UPDATE AD_ToolBarButton SET Name='Report - Wizard', ComponentName='Wizard',Updated=TO_TIMESTAMP('2012-10-30 10:00:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ToolBarButton_ID=200066
|
||||
;
|
||||
|
||||
-- Oct 30, 2012 10:08:19 AM COT
|
||||
|
@ -130,7 +129,6 @@ UPDATE AD_Message SET MsgText='Fields Displayed',Updated=TO_TIMESTAMP('2012-10-3
|
|||
UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200091
|
||||
;
|
||||
|
||||
|
||||
-- Oct 30, 2012 5:34:18 PM COT
|
||||
-- IDEMPIERE-379 Reporting wizard for end users
|
||||
INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Client_ID,AD_Org_ID,Created) VALUES ('I','Run Report',200100,'D','5638ff96-ff60-49f0-9871-004f7fa2420e','Run','Y',TO_TIMESTAMP('2012-10-30 17:34:15','YYYY-MM-DD HH24:MI:SS'),100,100,0,0,TO_TIMESTAMP('2012-10-30 17:34:15','YYYY-MM-DD HH24:MI:SS'))
|
|
@ -48,6 +48,7 @@ public class SystemIDs
|
|||
|
||||
public final static int FORM_PAYMENT_PRINT_EXPORT = 106;
|
||||
public final static int FORM_ARCHIVEVIEWER = 118;
|
||||
public final static int FORM_REPORT_WIZARD = 200002;
|
||||
|
||||
public final static int MENU_NOTICE = 233;
|
||||
|
||||
|
@ -154,6 +155,4 @@ public class SystemIDs
|
|||
public final static int SCHEDULE_10_MINUTES = 200002;
|
||||
public final static int SCHEDULE_15_MINUTES = 200003;
|
||||
|
||||
public final static int WIZARD_REPORT_FORM=200002;
|
||||
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class MPrintFormat extends X_AD_PrintFormat
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1246145881920021984L;
|
||||
private static final long serialVersionUID = -8307496567084341384L;
|
||||
|
||||
/**
|
||||
* Public Constructor.
|
||||
|
@ -83,6 +83,10 @@ public class MPrintFormat extends X_AD_PrintFormat
|
|||
m_items = getItems();
|
||||
} // MPrintFormat
|
||||
|
||||
public void reloadItems() {
|
||||
m_items = getItems();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Constructor
|
||||
* @param ctx context
|
||||
|
|
|
@ -191,6 +191,7 @@ public class ReportEngine implements PrintServiceAttributeListener
|
|||
public void setPrintFormat (MPrintFormat pf)
|
||||
{
|
||||
m_printFormat = pf;
|
||||
pf.reloadItems();
|
||||
if (m_layout != null)
|
||||
{
|
||||
setPrintData();
|
||||
|
|
|
@ -704,7 +704,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
|||
* List Item
|
||||
* @author Teo Sarca
|
||||
*/
|
||||
public class ListElement extends NamePair {
|
||||
private class ListElement extends NamePair {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.util.Properties;
|
|||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.apps.WReport;
|
||||
import org.adempiere.webui.component.Button;
|
||||
import org.adempiere.webui.component.ConfirmPanel;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
|
@ -47,7 +46,6 @@ import org.adempiere.webui.window.FDialog;
|
|||
import org.adempiere.webui.window.ZkReportViewer;
|
||||
import org.adempiere.webui.window.ZkReportViewerProvider;
|
||||
import org.compiere.model.MRole;
|
||||
import org.compiere.model.SystemIDs;
|
||||
import org.compiere.print.MPrintFormat;
|
||||
import org.compiere.print.MPrintFormatItem;
|
||||
import org.compiere.print.ReportEngine;
|
||||
|
@ -66,9 +64,7 @@ import org.zkoss.zul.Filedownload;
|
|||
import org.zkoss.zul.Foot;
|
||||
import org.zkoss.zul.Footer;
|
||||
import org.zkoss.zul.Hbox;
|
||||
import org.zkoss.zul.Iframe;
|
||||
import org.zkoss.zul.Separator;
|
||||
import org.zkoss.zul.Toolbarbutton;
|
||||
import org.zkoss.zul.Vbox;
|
||||
|
||||
|
||||
|
@ -106,7 +102,7 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
private Window winExportFile = null;
|
||||
private Listbox cboType = new Listbox();
|
||||
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
|
||||
public static boolean IsChange=false;
|
||||
public boolean isChange=false;
|
||||
public ZkReportViewer viewer;
|
||||
MPrintFormat fm;
|
||||
|
||||
|
@ -122,8 +118,6 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
WRC3SortCriteriaPanel tpsc3=new WRC3SortCriteriaPanel();
|
||||
WRC4GroupingCriteriaPanel tpgc4=new WRC4GroupingCriteriaPanel();
|
||||
WRC5SummaryFieldsPanel tpsf5=new WRC5SummaryFieldsPanel();
|
||||
|
||||
private Iframe iframe = new Iframe();
|
||||
|
||||
private int oldtabidx = 0;
|
||||
|
||||
|
@ -136,13 +130,9 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
*/
|
||||
public WReportCustomization() {
|
||||
super();
|
||||
|
||||
|
||||
m_WindowNo = SessionManager.getAppDesktop().registerWindow(this);
|
||||
|
||||
//dynInit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Static Layout
|
||||
|
@ -157,7 +147,6 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
{
|
||||
m_ctx = m_reportEngine.getCtx();
|
||||
init();
|
||||
//dynInit();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
@ -166,32 +155,28 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
}
|
||||
}
|
||||
|
||||
public void setViewer(ZkReportViewer parent){
|
||||
viewer=parent;
|
||||
}
|
||||
|
||||
private void init()
|
||||
{
|
||||
|
||||
|
||||
form.setStyle("width: 90%; height: 90%; position: absolute; border:none; padding:none; margin:none;");
|
||||
|
||||
headerPanel.setHeight("40px");
|
||||
headerPanel.setWidth("100%");
|
||||
|
||||
|
||||
headerPanel.appendChild(new Separator("vertical"));
|
||||
|
||||
|
||||
comboReport.setMold("select");
|
||||
fm =m_reportEngine.getPrintFormat();
|
||||
comboReport.setTooltiptext(Msg.translate(Env.getCtx(), "AD_PrintFormat_ID"));
|
||||
comboReport.appendItem(fm.getName(), fm.get_ID());
|
||||
headerPanel.appendChild(comboReport);
|
||||
headerPanel.appendChild(new Separator("vertical"));
|
||||
|
||||
|
||||
newPrintFormat=new Button();
|
||||
newPrintFormat.setName("NewPrintFormat");
|
||||
newPrintFormat.setLabel(Msg.getMsg(Env.getCtx(), "CreatePrintFormat"));
|
||||
newPrintFormat.addActionListener(this);
|
||||
|
||||
|
||||
headerPanel.appendChild(newPrintFormat);
|
||||
Separator tor =new Separator("vertical");
|
||||
tor.setSpacing("500px");
|
||||
|
@ -210,15 +195,15 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
headerPanel.appendChild(pipeSeparator);
|
||||
headerPanel.appendChild(new Separator("vertical"));
|
||||
headerPanel.appendChild(deselectAll);
|
||||
|
||||
|
||||
headerPanel.appendChild(new Separator("vertical"));
|
||||
|
||||
|
||||
Auxhead head=new Auxhead();
|
||||
head.appendChild(headerPanel);
|
||||
form.appendChild(head);
|
||||
|
||||
|
||||
headerPanel.appendChild(new Separator("horizontal"));
|
||||
|
||||
|
||||
tabbox.setWidth("100%");
|
||||
tabbox.setHeight("80%");
|
||||
tabfo2.addEventListener(Events.ON_CLICK, this);
|
||||
|
@ -230,14 +215,13 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
tabs.appendChild(tabsc3);
|
||||
tabs.appendChild(tabgc4);
|
||||
tabs.appendChild(tabsf5);
|
||||
|
||||
|
||||
tpdf1.setMPrintFormat(fm);
|
||||
tpdf1.setPrintFormatItems(pfi);
|
||||
tpdf1.setWReportCustomization(this);
|
||||
tpdf1.init();
|
||||
tabpanels.appendChild(tpdf1);
|
||||
|
||||
tpfo2.setReportEngine(m_reportEngine);
|
||||
|
||||
tpfo2.setMPrintFormat(fm);
|
||||
tpfo2.setPrintFormatItems(pfi);
|
||||
tpfo2.setListColumns();
|
||||
|
@ -245,120 +229,90 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
tpfo2.refresh();
|
||||
tpfo2.setWReportCustomization(this);
|
||||
tabpanels.appendChild(tpfo2);
|
||||
|
||||
|
||||
tpsc3.setMPrintFormat(fm);
|
||||
tpsc3.setPrintFormatItems(pfi);
|
||||
tpsc3.init();
|
||||
tpsc3.refresh();
|
||||
tpsc3.setWReportCustomization(this);
|
||||
tabpanels.appendChild(tpsc3);
|
||||
|
||||
|
||||
tpgc4.setMPrintFormat(fm);
|
||||
tpgc4.setPrintFormatItems(pfi);
|
||||
tpgc4.init();
|
||||
tpgc4.refresh();
|
||||
tpgc4.setWReportCustomization(this);
|
||||
tabpanels.appendChild(tpgc4);
|
||||
|
||||
|
||||
tpsf5.setMPrintFormat(fm);
|
||||
tpsf5.setPrintFormatItems(pfi);
|
||||
tpsf5.init();
|
||||
tpsf5.refresh();
|
||||
tpsf5.setWReportCustomization(this);
|
||||
tabpanels.appendChild(tpsf5);
|
||||
|
||||
|
||||
tabbox.appendChild(tabs);
|
||||
tabbox.appendChild(tabpanels);
|
||||
tabbox.addEventListener(Events.ON_SELECT, this);
|
||||
|
||||
|
||||
form.appendChild(tabbox);
|
||||
|
||||
|
||||
Footer foot =new Footer();
|
||||
Foot f=new Foot();
|
||||
|
||||
Foot f=new Foot();
|
||||
|
||||
Grid grid=new Grid();
|
||||
btnSave = new ToolBarButton();
|
||||
btnSave.setAttribute("name","btnSave");
|
||||
btnSave.setImage("/images/Save24.png");
|
||||
if(fm.getAD_Client_ID()== 0 || !IsChange)
|
||||
{
|
||||
btnSave.setVisible(false);
|
||||
}
|
||||
btnSave.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
foot.appendChild(btnSave);
|
||||
foot.appendChild(new Separator("vertical"));
|
||||
|
||||
if (m_isCanExport)
|
||||
btnSave.setAttribute("name","btnSave");
|
||||
btnSave.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Save")));
|
||||
btnSave.setImage("/images/Save24.png");
|
||||
if(fm.getAD_Client_ID()== 0 || !isChange)
|
||||
{
|
||||
btnSave.setDisabled(true);
|
||||
}
|
||||
btnSave.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
foot.appendChild(btnSave);
|
||||
foot.appendChild(new Separator("vertical"));
|
||||
|
||||
if (m_isCanExport)
|
||||
{
|
||||
bExport.setImage("/images/ExportX24.png");
|
||||
bExport.setAttribute("name","btnExport");
|
||||
bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export")));
|
||||
bExport.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
|
||||
foot.appendChild(bExport);
|
||||
foot.appendChild(new Separator("vertical"));
|
||||
|
||||
}
|
||||
|
||||
bRun=new Button();
|
||||
bRun.setLabel(Msg.getMsg(Env.getCtx(), "Run"));
|
||||
bRun.setName("bRun");
|
||||
bRun.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
foot.appendChild(bRun);
|
||||
Separator se =new Separator("vertical");
|
||||
se.setSpacing("800px");
|
||||
foot.appendChild(se);
|
||||
bnext=new Button();
|
||||
bnext.setLabel(Msg.getMsg(Env.getCtx(), "NextPage"));
|
||||
bnext.setName("Next");
|
||||
bnext.addEventListener(Events.ON_CLICK, this);
|
||||
foot.appendChild(bnext);
|
||||
foot.appendChild(new Separator("vertical"));
|
||||
bcancel=new Button();
|
||||
bcancel.setName("Cancel");
|
||||
bcancel.addEventListener(Events.ON_CLICK, this);
|
||||
bcancel.setLabel("Cancel");
|
||||
|
||||
foot.appendChild(bcancel);
|
||||
|
||||
f.appendChild(foot);
|
||||
grid.appendChild(f);
|
||||
form.appendChild(grid);
|
||||
|
||||
bRun=new Button();
|
||||
bRun.setLabel(Msg.getMsg(Env.getCtx(), "Run"));
|
||||
bRun.setName("bRun");
|
||||
bRun.addEventListener(Events.ON_CLICK, this);
|
||||
foot.appendChild(bRun);
|
||||
Separator se =new Separator("vertical");
|
||||
se.setSpacing("500px");
|
||||
foot.appendChild(se);
|
||||
|
||||
bnext=new Button();
|
||||
bnext.setLabel(Msg.getMsg(Env.getCtx(), "NextPage"));
|
||||
bnext.setName("Next");
|
||||
bnext.addEventListener(Events.ON_CLICK, this);
|
||||
foot.appendChild(bnext);
|
||||
foot.appendChild(new Separator("vertical"));
|
||||
|
||||
bcancel=new Button();
|
||||
bcancel.setName("Cancel");
|
||||
bcancel.addEventListener(Events.ON_CLICK, this);
|
||||
bcancel.setLabel("Cancel");
|
||||
foot.appendChild(bcancel);
|
||||
|
||||
f.appendChild(foot);
|
||||
grid.appendChild(f);
|
||||
form.appendChild(grid);
|
||||
form.setBorder("normal");
|
||||
|
||||
//renderStep();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*private void renderStep(){
|
||||
switch (curStep){
|
||||
case 0:
|
||||
renderSelectStep();
|
||||
}
|
||||
}
|
||||
private void renderSelectStep()
|
||||
{
|
||||
if(stepPanels[0]==null){
|
||||
stepPanels[0] = new SelectColumnpanel(m_reportEngine.getPrintFormat());
|
||||
centerPanel.appendChild(stepPanels[0]);
|
||||
}else{
|
||||
stepPanels[0].setVisible(true);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
private void cleanUp() {
|
||||
if (m_WindowNo >= 0)
|
||||
{
|
||||
SessionManager.getAppDesktop().unregisterWindow(m_WindowNo);
|
||||
m_ctx = null;
|
||||
m_WindowNo = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
if (Events.ON_CLICK.equals(event.getName())) {
|
||||
|
@ -567,65 +521,53 @@ public class WReportCustomization implements IFormController,EventListener<Even
|
|||
log.log(Level.SEVERE, "Failed to export content.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void close()
|
||||
{
|
||||
SessionManager.getAppDesktop().closeActiveWindow();
|
||||
}
|
||||
|
||||
|
||||
public void copyFormat(){
|
||||
|
||||
public void close()
|
||||
{
|
||||
SessionManager.getAppDesktop().closeActiveWindow();
|
||||
}
|
||||
|
||||
public void copyFormat(){
|
||||
MPrintFormat newpf=MPrintFormat.copyToClient(m_ctx, m_reportEngine.getPrintFormat().get_ID() ,Env.getAD_Client_ID(m_ctx));
|
||||
pfi=newpf.getAllItems("IsPrinted DESC, NULLIF(SeqNo,0), Name");
|
||||
|
||||
pfi = newpf.getAllItems("IsPrinted DESC, NULLIF(SeqNo,0), Name");
|
||||
|
||||
tpdf1.setMPrintFormat(newpf);
|
||||
tpdf1.setPrintFormatItems(pfi);
|
||||
tpdf1.refresh();
|
||||
|
||||
//tpfo2.setReportEngine(m_reportEngine);
|
||||
|
||||
tpfo2.setMPrintFormat(newpf);
|
||||
tpfo2.setPrintFormatItems(pfi);
|
||||
tpfo2.setListColumns();
|
||||
tpfo2.refresh();
|
||||
|
||||
|
||||
tpsc3.setMPrintFormat(newpf);
|
||||
tpsc3.setPrintFormatItems(pfi);
|
||||
tpsc3.refresh();
|
||||
|
||||
|
||||
|
||||
tpgc4.setMPrintFormat(newpf);
|
||||
tpgc4.setPrintFormatItems(pfi);
|
||||
|
||||
|
||||
|
||||
tpsf5.setMPrintFormat(newpf);
|
||||
tpsf5.setPrintFormatItems(pfi);
|
||||
tpsf5.refresh();
|
||||
setIsChanged(true);
|
||||
|
||||
|
||||
comboReport.removeAllItems();
|
||||
comboReport.appendItem(newpf.getName(), newpf.get_ID());
|
||||
m_reportEngine.setPrintFormat(newpf);
|
||||
}
|
||||
}
|
||||
|
||||
public void setIsChanged(boolean change){
|
||||
IsChange=change;
|
||||
isChange=change;
|
||||
|
||||
if(IsChange){
|
||||
btnSave.setVisible(true);
|
||||
bExport.setVisible(false);
|
||||
bRun.setVisible(false);
|
||||
newPrintFormat.setVisible(false);
|
||||
}
|
||||
else{
|
||||
btnSave.setVisible(false);
|
||||
bExport.setVisible(true);
|
||||
bRun.setVisible(true);
|
||||
newPrintFormat.setVisible(true);
|
||||
}
|
||||
btnSave.setDisabled(!isChange);
|
||||
bExport.setDisabled(isChange);
|
||||
bRun.setDisabled(isChange);
|
||||
newPrintFormat.setDisabled(isChange);
|
||||
}
|
||||
|
||||
public void runReport(){
|
||||
m_reportEngine.setPrintFormat(m_reportEngine.getPrintFormat()); // reload
|
||||
new ZkReportViewerProvider().openViewer(m_reportEngine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,6 @@ import org.adempiere.webui.component.Listbox;
|
|||
import org.adempiere.webui.component.SimpleListModel;
|
||||
import org.adempiere.webui.component.Window;
|
||||
import org.compiere.print.MPrintFormatItem;
|
||||
import org.compiere.print.ReportEngine;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.NamePair;
|
||||
import org.zkoss.zk.au.out.AuFocus;
|
||||
|
@ -54,36 +52,12 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
|
|||
private Button bDown = new Button();
|
||||
|
||||
private ArrayList<MPrintFormatItem> listColumns=new ArrayList<MPrintFormatItem>();
|
||||
Window wind=new Window();
|
||||
SimpleListModel sortModel;
|
||||
private ReportEngine m_reportEngine=null;
|
||||
|
||||
private static CLogger log = CLogger.getCLogger(WRC2FieldOrderPanel.class);
|
||||
|
||||
public WRC2FieldOrderPanel() {
|
||||
super();
|
||||
|
||||
}
|
||||
|
||||
public Window getWind() {
|
||||
return wind;
|
||||
}
|
||||
|
||||
|
||||
public void setWind(Window wind) {
|
||||
this.wind = wind;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Static Layout
|
||||
* @throws Exception
|
||||
*/
|
||||
public void setReportEngine(ReportEngine re) {
|
||||
m_reportEngine = re;
|
||||
|
||||
}
|
||||
|
||||
public void setListColumns() {
|
||||
listColumns = new ArrayList<MPrintFormatItem>();
|
||||
if (m_pfi != null && m_pfi.length > 0) {
|
||||
|
@ -93,7 +67,6 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void init()
|
||||
|
@ -173,7 +146,6 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
|
|||
listHead.setParent(sortList);
|
||||
ListHeader header=new ListHeader();
|
||||
header.setParent(listHead);
|
||||
|
||||
|
||||
hlayout.appendChild(sortList);
|
||||
|
||||
|
@ -200,10 +172,8 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -247,13 +217,6 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
|
|||
|
||||
@Override
|
||||
public void updatePFI() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void updateSortModel(){
|
||||
sortList.removeAllItems();
|
||||
// SortList=SortModel;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@ import org.adempiere.webui.component.ListItem;
|
|||
import org.adempiere.webui.component.Listbox;
|
||||
import org.adempiere.webui.component.SimpleListModel;
|
||||
import org.compiere.print.MPrintFormatItem;
|
||||
import org.compiere.print.ReportEngine;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.NamePair;
|
||||
import org.zkoss.zk.au.out.AuFocus;
|
||||
|
@ -48,10 +46,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
*/
|
||||
private static final long serialVersionUID = -2798618953887598651L;
|
||||
|
||||
private ReportEngine m_reportEngine;
|
||||
private static CLogger log = CLogger.getCLogger(WRC3SortCriteriaPanel.class);
|
||||
|
||||
|
||||
// UI variables
|
||||
private Label noLabel = new Label();
|
||||
private Label yesLabel = new Label();
|
||||
|
@ -59,7 +53,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
private Button bRemove = new Button();
|
||||
private Button bUp = new Button();
|
||||
private Button bDown = new Button();
|
||||
//private AbstractADWindowContent adWindowPanel = null;
|
||||
|
||||
public ArrayList<MPrintFormatItem> yesItems=new ArrayList<MPrintFormatItem>();
|
||||
public ArrayList<MPrintFormatItem> noItems=new ArrayList<MPrintFormatItem>();
|
||||
|
@ -72,16 +65,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
|
||||
public WRC3SortCriteriaPanel() {
|
||||
super();
|
||||
//m_WindowNo = SessionManager.getAppDesktop().registerWindow(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static Layout
|
||||
* @throws Exception
|
||||
*/
|
||||
public void setReportEngine(ReportEngine re) {
|
||||
|
||||
m_reportEngine = re;
|
||||
}
|
||||
|
||||
public void init()
|
||||
|
@ -128,7 +111,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
yesList.setItemDraggable(true);
|
||||
noList.setItemDraggable(true);
|
||||
|
||||
|
||||
EventListener yesListMouseMotionListener = new EventListener()
|
||||
{
|
||||
public void onEvent(Event event) throws Exception {
|
||||
|
@ -193,8 +175,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
listHeader.appendChild(noLabel);
|
||||
listHeader.setParent(listHead);
|
||||
|
||||
|
||||
|
||||
Hlayout hlayout = new Hlayout();
|
||||
hlayout.setVflex("true");
|
||||
hlayout.setHflex("true");
|
||||
|
@ -235,12 +215,8 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
this.appendChild(hlayout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
@ -310,12 +286,9 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updatePFI() {
|
||||
// pfi is being updated on every refresh
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -373,7 +346,7 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
* Move within Yes List
|
||||
* @param event event
|
||||
*/
|
||||
void migrateValueWithinYesList (Event event)
|
||||
private void migrateValueWithinYesList (Event event)
|
||||
{
|
||||
Object[] selObjects = yesList.getSelectedItems().toArray();
|
||||
if (selObjects == null)
|
||||
|
@ -432,27 +405,25 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
}
|
||||
} // migrateValueWithinYesList
|
||||
|
||||
|
||||
public void updateYesList(){
|
||||
yesList.removeAllItems();
|
||||
wc.setIsChanged(true);
|
||||
int sortNo=10;
|
||||
for(int i=0;i<yesModel.getSize();i++){
|
||||
ListElement obj=(ListElement) yesModel.getElementAt(i);
|
||||
for(int j=0;j<m_pfi.length;j++){
|
||||
if(m_pfi[j].get_ID() == obj.getKey()){
|
||||
String name=obj.getName();
|
||||
int ID=obj.getKey();
|
||||
KeyNamePair pair=new KeyNamePair(ID, name);
|
||||
yesList.addItem(pair);
|
||||
m_pfi[j].setSortNo(sortNo);
|
||||
sortNo=sortNo+10;
|
||||
ListElement obj=(ListElement) yesModel.getElementAt(i);
|
||||
for(int j=0;j<m_pfi.length;j++){
|
||||
if(m_pfi[j].get_ID() == obj.getKey()){
|
||||
String name=obj.getName();
|
||||
int ID=obj.getKey();
|
||||
KeyNamePair pair=new KeyNamePair(ID, name);
|
||||
yesList.addItem(pair);
|
||||
m_pfi[j].setSortNo(sortNo);
|
||||
sortNo=sortNo+10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* List Item
|
||||
*/
|
||||
|
@ -500,8 +471,6 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
|
|||
public int getAD_Org_ID() {
|
||||
return m_AD_Org_ID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.adempiere.webui.component.Grid;
|
|||
import org.adempiere.webui.component.Row;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.component.Window;
|
||||
import org.compiere.print.MPrintFormat;
|
||||
import org.compiere.print.MPrintFormatItem;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
|
@ -37,7 +36,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
|
|||
private static final long serialVersionUID = -3142169077710161360L;
|
||||
|
||||
private static final int RENDER_IN_COLUMNS=2;
|
||||
private MPrintFormat m_printFormat;
|
||||
Checkbox m_chkboxes[]=null;
|
||||
String m_oldLabel[]=null;
|
||||
ArrayList<MPrintFormatItem> orderfield=new ArrayList<MPrintFormatItem>();
|
||||
|
@ -47,7 +45,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
|
|||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
orderfield = new ArrayList<MPrintFormatItem>();
|
||||
|
@ -61,22 +58,20 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
|
|||
|
||||
@Override
|
||||
public void updatePFI() {
|
||||
|
||||
for(int i=0 ; i<orderfield.size() ; i++){
|
||||
for(int j=0 ;j<m_pfi.length ; j++){
|
||||
if(orderfield.get(i).get_ID() == m_pfi[j].get_ID()){
|
||||
m_pfi[j].setIsGroupBy(m_chkboxes[i].isChecked());
|
||||
}
|
||||
if(orderfield.get(i).get_ID() == m_pfi[j].get_ID()){
|
||||
m_pfi[j].setIsGroupBy(m_chkboxes[i].isChecked());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
if (Events.ON_CHECK.equals(event.getName())) {
|
||||
wc.setIsChanged(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void init(){
|
||||
|
@ -85,7 +80,6 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
|
|||
wind.setWidth("90%");
|
||||
wind.setHeight("100%");
|
||||
wind.setHflex("1");
|
||||
|
||||
|
||||
grid.setHflex("1");
|
||||
grid.setHeight("90%");
|
||||
|
@ -108,23 +102,17 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
|
|||
columns.appendChild(cols[i+1]);
|
||||
}
|
||||
grid.appendChild(columns);
|
||||
|
||||
|
||||
|
||||
this.appendChild(wind);
|
||||
wind.appendChild(grid);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void dynamicInit()
|
||||
{
|
||||
|
||||
|
||||
if (grid.getRows() != null)
|
||||
grid.removeChild(grid.getRows());
|
||||
|
||||
|
||||
m_chkboxes = new Checkbox[orderfield.size()];
|
||||
m_oldLabel = new String[orderfield.size()];
|
||||
int curCol=0;
|
||||
|
@ -138,7 +126,7 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
|
|||
m_chkboxes[i] = new Checkbox();
|
||||
m_chkboxes[i].setChecked(orderfield.get(i).isGroupBy());
|
||||
m_chkboxes[i].addEventListener(Events.ON_CHECK, this);
|
||||
|
||||
|
||||
String strValue = orderfield.get(i).getPrintName();
|
||||
if(strValue ==null || strValue.length()==0){
|
||||
strValue = orderfield.get(i).getName();
|
||||
|
@ -148,9 +136,8 @@ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListe
|
|||
curCol++;
|
||||
curCol = curCol%RENDER_IN_COLUMNS;
|
||||
}
|
||||
|
||||
|
||||
grid.appendChild(rows);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.adempiere.webui.component.Grid;
|
|||
import org.adempiere.webui.component.Label;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.component.Window;
|
||||
import org.compiere.print.MPrintFormat;
|
||||
import org.compiere.print.MPrintFormatItem;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
|
@ -34,8 +33,6 @@ import org.zkoss.zk.ui.event.Events;
|
|||
import org.zkoss.zul.Div;
|
||||
import org.zkoss.zul.Row;
|
||||
|
||||
|
||||
|
||||
public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener<Event> {
|
||||
/**
|
||||
*
|
||||
|
@ -43,7 +40,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
private static final long serialVersionUID = -2231369601903381581L;
|
||||
|
||||
private static final int RENDER_IN_COLUMNS=10;
|
||||
private MPrintFormat m_printFormat;
|
||||
Checkbox m_chkSum[]=null;
|
||||
Checkbox m_chkCount[]=null;
|
||||
Checkbox m_chkMin[]=null;
|
||||
|
@ -58,13 +54,11 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
super();
|
||||
}
|
||||
|
||||
|
||||
public void init(){
|
||||
Window wind=new Window();
|
||||
wind.setWidth("90%");
|
||||
wind.setHeight("100%");
|
||||
wind.setHflex("1");
|
||||
|
||||
|
||||
grid.setHflex("1");
|
||||
grid.setHeight("90%");
|
||||
|
@ -78,7 +72,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
wind.appendChild(div);
|
||||
this.appendChild(wind);
|
||||
|
||||
|
||||
if (AEnv.isTablet())
|
||||
{
|
||||
LayoutUtils.addSclass("tablet-scrolling", div);
|
||||
|
@ -88,14 +81,11 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
grid.appendChild(columns);
|
||||
Column cols[] = new Column[RENDER_IN_COLUMNS];
|
||||
int width = 100/RENDER_IN_COLUMNS;
|
||||
int widthChk = width/5;
|
||||
for(int i=0;i<RENDER_IN_COLUMNS;i++){
|
||||
cols[i] = new Column();
|
||||
cols[i].setWidth(width+"%");
|
||||
columns.appendChild(cols[i]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -123,9 +113,7 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
m_pfi[j].setIsDeviationCalc(m_chkDesviation[i].isChecked());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -133,7 +121,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
if (Events.ON_CHECK.equals(event.getName())) {
|
||||
wc.setIsChanged(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void dynamicInit(){
|
||||
|
@ -170,7 +157,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
m_chkVariance=new Checkbox[DisplayItems.size()];
|
||||
m_chkDesviation=new Checkbox[DisplayItems.size()];
|
||||
|
||||
|
||||
for(int i=0 ;i<DisplayItems.size(); i++){
|
||||
row=new Row();
|
||||
String strValue = DisplayItems.get(i).getPrintName();
|
||||
|
@ -212,4 +198,4 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
|||
grid.appendChild(rows);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2079827289589862794L;
|
||||
private static final long serialVersionUID = 344552813342946104L;
|
||||
|
||||
/** Window No */
|
||||
private int m_WindowNo = -1;
|
||||
|
@ -308,12 +308,11 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
|||
bRefresh.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));
|
||||
toolBar.appendChild(bRefresh);
|
||||
bRefresh.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
|
||||
bWizard.setImage("/images/Wizard24.png");
|
||||
bWizard.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "PrintWizard")));
|
||||
toolBar.appendChild(bWizard);
|
||||
bWizard.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
|
||||
North north = new North();
|
||||
layout.appendChild(north);
|
||||
|
@ -923,7 +922,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
|||
/**
|
||||
* Report Combo - Start other Report or create new one
|
||||
*/
|
||||
public void cmd_report()
|
||||
private void cmd_report()
|
||||
{
|
||||
ListItem li = comboReport.getSelectedItem();
|
||||
if(li == null || li.getValue() == null) return;
|
||||
|
@ -1104,23 +1103,18 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
|
|||
/*IDEMPIERE -379*/
|
||||
private void cmd_Wizard()
|
||||
{
|
||||
int AD_Window_ID = WINDOW_PRINTFORMAT; // hardcoded
|
||||
int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();
|
||||
|
||||
Env.setContext(m_ctx, "AD_PrintFormat_ID", AD_PrintFormat_ID);
|
||||
int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();
|
||||
|
||||
ADForm form = ADForm.openForm(SystemIDs.WIZARD_REPORT_FORM);
|
||||
WReportCustomization av = (WReportCustomization) form.getICustomForm();
|
||||
av.setReportEngine(m_reportEngine);
|
||||
Env.setContext(m_ctx, "AD_PrintFormat_ID", AD_PrintFormat_ID);
|
||||
|
||||
ADForm form = ADForm.openForm(SystemIDs.FORM_REPORT_WIZARD);
|
||||
WReportCustomization av = (WReportCustomization) form.getICustomForm();
|
||||
av.setReportEngine(m_reportEngine);
|
||||
|
||||
form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||
SessionManager.getAppDesktop().showWindow(form);
|
||||
} // cmd_Wizard
|
||||
|
||||
form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||
SessionManager.getAppDesktop().showWindow(form);
|
||||
|
||||
//ZkReportCustomization zkCustomization = new ZkReportCustomization(m_reportEngine);
|
||||
//zkCustomization.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
|
||||
//zkCustomization.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
|
||||
//SessionManager.getAppDesktop().showWindow(zkCustomization);
|
||||
} // cmd_customize
|
||||
//-- ComponentCtrl --//
|
||||
public Object getExtraCtrl() {
|
||||
return new ExtraCtrl();
|
||||
|
|
Loading…
Reference in New Issue