Ejemplo n.º 1
0
        public Form ShowTabular()
        {
            if (!BaseWinFramework.CheckModuleAccessWithError(ModuleName,
                                                             SecurityVarName.ReportView, true))
            {
                return(null);
            }

            using (new WaitCursor())
            {
                if (!TypeChecked)
                {
                    CheckEntityType();
                }

                if (_UIN != null)
                {
                    IRuleInitUI riu = (IRuleInitUI)_UIN.Entity;
                    _DataFilter   = riu.GetBrowseFilter();
                    BrowseColumns = riu.GetBrowseColumns();
                    riu.GetBrowseSql(out BrowseSql, out BrowseCondition, out BrowseOrder);
                    BrowseFormat.Clear();
                    riu.GetBrowseFormat(BrowseFormat);

                    TableDef td = MetaData.GetTableDef(riu.GetType());
                    if (riu.GetFieldTransactionDate().Length == 0)
                    {
                        fldTransactionDate = td.fldTransactionDate;
                    }
                    else
                    {
                        fldTransactionDate = td.GetFieldDef(
                            riu.GetFieldTransactionDate());
                    }
                }

                if (_BrowseForm == null || _BrowseForm.IsDisposed ||
                    _BrowseType != BrowseType.Tabular)
                {
                    if (BaseWinFramework.TouchScreenVersion)
                    {
                        _BrowseForm = new frmGridReportTC();
                    }
                    else
                    {
                        _BrowseForm = new frmGridReport();
                    }
                    _BrowseForm.MdiParent = BaseWinFramework._MdiParent;
                    ((IBrowseForm)_BrowseForm).ShowForm(this, ModuleName);
                    _BrowseType = BrowseType.Tabular;
                }
                else
                {
                    _BrowseForm.BringToFront();
                }
                return(_BrowseForm);
            }
        }
Ejemplo n.º 2
0
        public Form ShowFreeLayout()
        {
            if (!BaseWinFramework.CheckModuleAccessWithError(ModuleName,
                                                             SecurityVarName.ReportView, true))
            {
                return(null);
            }

            using (new WaitCursor())
            {
                if (!TypeChecked)
                {
                    CheckEntityType();
                }

                if (_UIN != null)
                {
                    IRuleInitUI riu = (IRuleInitUI)_UIN.Entity;
                    _DataFilter   = riu.GetBrowseFilter();
                    BrowseColumns = riu.GetBrowseColumns();
                    riu.GetBrowseSql(out BrowseSql, out BrowseCondition, out BrowseOrder);
                    BrowseFormat.Clear();
                    riu.GetBrowseFormat(BrowseFormat);
                }

                if (_BrowseForm == null || _BrowseForm.IsDisposed ||
                    _BrowseType != BrowseType.FreeLayout)
                {
                    if (BaseWinFramework.mdiRibbonControl != null)
                    {
                        _BrowseForm = new frmFreeReport();
                    }
                    else
                    {
                        _BrowseForm = new frmFreeReport2();
                    }

                    _BrowseForm.MdiParent = BaseWinFramework._MdiParent;
                    ((IFreeReport)_BrowseForm).ShowForm(this, ModuleName);
                    _BrowseType = BrowseType.FreeLayout;
                }
                else
                {
                    _BrowseForm.BringToFront();
                }
                return(_BrowseForm);
            }
        }