Exemple #1
0
        private void UpdateLayout(string NewLayout)
        {
            MemoryStream LayoutData;

            if (NewLayout == strTanpaLayout)
            {
                LayoutData = msTanpaLayout;
            }
            else
            {
                DocPrintBrowseLayout.GetLayoutData(
                    LayoutHeader + RptName, NewLayout, out LayoutData);
            }

            if (LayoutData == null)
            {
                return;
            }
            //xReport Rpt = new xReport(_Evaluator);
            xReport Rpt = (xReport)xrDesignPanel1.Report;

            Rpt.LoadLayout(LayoutData);
            Rpt.DataSource = _DataSource;
            xrDesignPanel1.Report.DataSource = _DataSource;
            fieldListDockPanel1.UpdateDataSource(_DesignerHost);
            //xrDesignPanel1.Report.DataSource = null;
            xrDesignPanel1.OpenReport(Rpt);
            xrDesignPanel1.FileName = string.Empty;
            xrDesignPanel1.Report.ScriptReferences = new string[] { GetType().Assembly.Location };
            OriginalPrintControl = BaseWinFramework.mdiRibbonPrintController.PrintControl;
        }
Exemple #2
0
        public static int DeleteLayout(string DocId, string LayoutId)
        {
            DocPrintBrowseLayout dpbl = new DocPrintBrowseLayout();

            dpbl.DocId    = DocId;
            dpbl.LayoutId = LayoutId;
            return(dpbl.SaveDelete());
        }
        //Simpan Layout
        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            string LayoutName = barEditItem3.EditValue.ToString();

            if (LayoutName == strTanpaLayout)
            {
                XtraMessageBox.Show("(Tanpa Layout) tidak dapat disimpan !",
                                    "Error Simpan Layout",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (XtraMessageBox.Show("Update Layout Cetak Laporan ?",
                                    "Konfirmasi Update Layout Cetak Laporan",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
            {
                return;
            }

            using (new WaitCursor())
            {
                try
                {
                    MemoryStream mst = new MemoryStream();
                    xrDesignPanel1.Report.SaveLayout(mst);

                    if (SaveEval)
                    {
                        Dictionary <string, object> Filter = new Dictionary <string, object>();

                        if (_Evaluator != null)
                        {
                            foreach (KeyValuePair <string, object> Var in _Evaluator.Variables.VarDictionary)
                            {
                                Filter.Add(Var.Key, Var.Value);
                            }
                        }

                        DocPrintBrowseLayout.SaveUpdateFreeLayout(LayoutHeader + RptName,
                                                                  LayoutName, mst, Filter);
                    }
                    else
                    {
                        DocPrintBrowseLayout.SaveUpdateLayout(LayoutHeader + RptName,
                                                              LayoutName, mst);
                    }
                    xrDesignPanel1.ReportState = ReportState.Opened;
                    xrDesignPanel1.FileName    = string.Empty;
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(ex.Message, "Error Update Layout",
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
        }
Exemple #4
0
        public static void SaveNewLayout(string DocId, string LayoutId,
                                         MemoryStream LayoutData)
        {
            DocPrintBrowseLayout dpbl = new DocPrintBrowseLayout();

            dpbl.DocId      = DocId;
            dpbl.LayoutId   = LayoutId;
            dpbl.LayoutData = LayoutData.ToArray();
            dpbl.SaveNew();
        }
Exemple #5
0
        public static void SaveUpdateFreeLayout(string DocId, string LayoutId,
                                                MemoryStream LayoutData, Dictionary <string, object> QueryFormFilter)
        {
            DocPrintBrowseLayout dpbl = new DocPrintBrowseLayout();

            dpbl.DocId           = DocId;
            dpbl.LayoutId        = LayoutId;
            dpbl.LayoutData      = LayoutData.ToArray();
            dpbl.QueryFormFilter = BaseUtility.Dictionary2String(QueryFormFilter);
            dpbl.SaveUpdate();
        }
Exemple #6
0
        //Simpan Layout Baru
        private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmSaveLayout frm = new frmSaveLayout();

            if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }

            using (new WaitCursor())
            {
                MemoryStream mst = new MemoryStream();
                xrDesignPanel1.Report.SaveLayout(mst);

                try
                {
                    if (SaveEval)
                    {
                        Dictionary <string, object> Filter = new Dictionary <string, object>();

                        if (_Evaluator != null)
                        {
                            foreach (KeyValuePair <string, object> Var in _Evaluator.Variables.VarDictionary)
                            {
                                Filter.Add(Var.Key, Var.Value);
                            }
                        }

                        DocPrintBrowseLayout.SaveNewFreeLayout(LayoutHeader + RptName,
                                                               frm.strText, mst, Filter);
                    }
                    else
                    {
                        DocPrintBrowseLayout.SaveNewLayout(LayoutHeader + RptName,
                                                           frm.strText, mst);
                    }

                    ((RepositoryItemComboBox)barEditItem3.Edit).Items
                    .Add(frm.strText);

                    barEditItem3.EditValue = frm.strText;

                    xrDesignPanel1.ReportState = ReportState.Opened;
                    xrDesignPanel1.FileName    = string.Empty;
                }
                finally { }
                //catch (Exception ex)
                //{
                //    XtraMessageBox.Show(ex.Message, "Error Menambah Layout",
                //        MessageBoxButtons.OK, MessageBoxIcon.Information);
                //    return;
                //}
            }
        }
Exemple #7
0
        public static void SaveUpdateLayout(string DocId, string LayoutId,
                                            MemoryStream LayoutData)
        {
            DocPrintBrowseLayout dpbl = new DocPrintBrowseLayout();

            dpbl.DocId    = DocId;
            dpbl.LayoutId = LayoutId;
            if (dpbl.FastLoadEntity("QueryFormFilter"))
            {
                dpbl.LayoutData = LayoutData.ToArray();
                dpbl.SaveUpdate();
            }
        }
 protected override void RefreshReport()
 {
     comboBoxEdit1.Properties.Items.Clear();
     comboBoxEdit1.Properties.Items.AddRange(
         DocPrintBrowseLayout.GetListLayout("F_" + _ReportName));
     LoadFilter = false;
     if (comboBoxEdit1.SelectedIndex == -1)
     {
         comboBoxEdit1.SelectedIndex = 0;
     }
     else
     {
         comboBoxEdit1_SelectedIndexChanged(null, null);
     }
 }
Exemple #9
0
        //Hapus Layout
        private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
        {
            string LayoutName = barEditItem3.EditValue.ToString();

            if (LayoutName == strTanpaLayout)
            {
                XtraMessageBox.Show("(Tanpa Layout) tidak dapat dihapus !",
                                    "Error Simpan Layout",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (XtraMessageBox.Show(string.Concat("Hapus Layout Laporan '",
                                                  LayoutName, "' ?"),
                                    "Konfirmasi Hapus Layout Laporan", MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
            {
                return;
            }

            using (new WaitCursor())
            {
                try
                {
                    DocPrintBrowseLayout.DeleteLayout(LayoutHeader + RptName, LayoutName);

                    RepositoryItemComboBox icb = (RepositoryItemComboBox)barEditItem3.Edit;
                    int Index = icb.Items.IndexOf(LayoutName);

                    icb.Items.RemoveAt(Index);
                    if (Index == icb.Items.Count)
                    {
                        barEditItem3.EditValue = icb.Items[Index - 1];
                    }
                    else
                    {
                        barEditItem3.EditValue = icb.Items[Index];
                    }

                    UpdateLayout(barEditItem3.EditValue.ToString());
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(ex.Message, "Error Hapus Layout",
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
        }
Exemple #10
0
        public static void GetLayoutData(string DocId, string LayoutId,
                                         out MemoryStream LayoutData)
        {
            DocPrintBrowseLayout dpbl = new DocPrintBrowseLayout();

            dpbl.DocId    = DocId;
            dpbl.LayoutId = LayoutId;
            if (dpbl.FastLoadEntity("LayoutData"))
            {
                LayoutData = new MemoryStream(dpbl.LayoutData);
            }
            else
            {
                LayoutData = null;
            }
        }
Exemple #11
0
        public static void GetFreeLayoutData(string DocId, string LayoutId,
                                             out MemoryStream LayoutData,
                                             Dictionary <string, object> QueryFormFilter)
        {
            DocPrintBrowseLayout dpbl = new DocPrintBrowseLayout();

            dpbl.DocId    = DocId;
            dpbl.LayoutId = LayoutId;
            if (dpbl.LoadEntity())
            {
                LayoutData = new MemoryStream(dpbl.LayoutData);
                BaseUtility.String2Dictionary(dpbl.QueryFormFilter, QueryFormFilter);
            }
            else
            {
                LayoutData = null;
            }
        }
Exemple #12
0
        // Dari Dokumen
        public void ShowForm(Form MdiParent, string ReportName,
                             BusinessEntity DataSource, Evaluator Evaluator)
        {
            SaveEval = false;
            try
            {
                xrDesignPanel1.SetCommandVisibility(ReportCommand.AddNewDataSource, CommandVisibility.None);

                _Evaluator = Evaluator ?? BaseFactory
                             .CreateInstance <Evaluator>();
                LayoutHeader = "D_";
                IDataDictionary ds = new ReportSingleEntity(DataSource);

                Text = "Desain Cetak " + ReportName;
                xReport rpt = new xReport(_Evaluator);
                rpt.PaperKind  = PaperKind.A4;
                rpt.DataSource = ds;

                RptName = ReportName;
                NewDesign(rpt);
                msTanpaLayout = new MemoryStream();
                rpt.SaveLayout(msTanpaLayout);

                if (MdiParent != null)
                {
                    this.MdiParent = MdiParent;
                }

                List <string> ListLayout = DocPrintBrowseLayout
                                           .GetListLayout(LayoutHeader + RptName);
                ((RepositoryItemComboBox)barEditItem3.Edit)
                .Items.AddRange(ListLayout);
                barEditItem3.EditValue = strTanpaLayout;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Error Baca Layout Laporan",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                Show();
            }
        }
Exemple #13
0
        //Cetak
        private void barButtonItem7_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            using (new WaitCursor())
            {
                try
                {
                    List <string> ListPrintLayout = DocPrintBrowseLayout.GetListLayout("L_" + _ReportName);

                    if (ListPrintLayout.Count == 0)
                    {
                        XtraMessageBox.Show("Layout Cetak Laporan tidak ditemukan !",
                                            "Error Cetak Laporan",
                                            MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    string Layout;
                    if (ListPrintLayout.Count == 1)
                    {
                        Layout = ListPrintLayout[0];
                    }
                    else
                    {
                        Layout = frmCetak.ShowForm(ListPrintLayout, CurrPrintLayoutId, "Cetak Laporan");
                        if (Layout.Length == 0)
                        {
                            return;
                        }
                    }
                    MemoryStream LayoutData;
                    DocPrintBrowseLayout.GetLayoutData("L_" + _ReportName, Layout, out LayoutData);

                    xReport Rpt = new xReport(_Evaluator);
                    Rpt.DataSource = pivotGridControl1.DataSource;
                    Rpt.LoadLayout(LayoutData);

                    new frmPreview().ShowForm(MdiParent, _ReportName, Rpt);
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(ex.Message, "Error Cetak Laporan",
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemple #14
0
        public static void SaveReportFromTemplateFolder(string RptHeader, string RptName,
                                                        List <string> ListItems, Dictionary <string, object> FilterList)
        {
            if (!Directory.Exists(BaseWinFramework.ReportFolder))
            {
                return;
            }
            string[] Files = Directory.GetFiles(
                BaseWinFramework.ReportFolder, string.Concat(
                    RptHeader, RptName.Replace("/", "_"), "*.repx"));
            int LenRName = BaseWinFramework.ReportFolder
                           .Length + RptName.Length + 2;

            foreach (string fl in Files)
            {
                string TmpName = fl.Substring(LenRName + 1);
                if (TmpName.Length == 5 || TmpName.Substring(0, 1) == "_")
                {
                    byte[] PrintLayout = File.ReadAllBytes(fl);
                    if (TmpName.Length == 5)
                    {
                        TmpName = RptName;
                    }
                    else
                    {
                        TmpName = TmpName.Substring(1, TmpName.Length - 6)
                                  .Replace("_", "/");
                    }
                    if (PrintLayout != null)
                    {
                        DocPrintBrowseLayout.SaveNewFreeLayout(RptHeader + RptName,
                                                               TmpName, new MemoryStream(PrintLayout),
                                                               FilterList);
                        if (ListItems != null)
                        {
                            ListItems.Add(TmpName);
                        }
                    }
                }
            }
        }
Exemple #15
0
        // Dari Laporan Bebas
        public void ShowForm3(Form MdiParent, string ReportName,
                              Evaluator Evaluator)
        {
            SaveEval = true;
            try
            {
                fieldListDockPanel1.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
                xrDesignPanel1.SetCommandVisibility(ReportCommand.AddNewDataSource, CommandVisibility.None);
                _Evaluator   = Evaluator ?? BaseFactory.CreateInstance <Evaluator>();
                LayoutHeader = "F_";
                Text         = "Desain Cetak " + ReportName;
                xReport rpt = new xReport(Evaluator);
                rpt.PaperKind = PaperKind.A4;
                RptName       = ReportName;
                NewDesign(rpt);
                msTanpaLayout = new MemoryStream();
                rpt.SaveLayout(msTanpaLayout);
                if (MdiParent != null)
                {
                    this.MdiParent = MdiParent;
                }

                List <string> ListLayout = DocPrintBrowseLayout
                                           .GetListLayout(LayoutHeader + ReportName);
                ((RepositoryItemComboBox)barEditItem3.Edit)
                .Items.AddRange(ListLayout);
                barEditItem3.EditValue = strTanpaLayout;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Error Baca Layout Laporan",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                Show();
            }
        }
        private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (new WaitCursor())
            {
                BaseWinFramework.WinForm.AutoLockEntity.LockForm(re, this);

                try
                {
                    MemoryStream ms;
                    Dictionary <string, object> QueryFormFilter =
                        new Dictionary <string, object>();
                    DocPrintBrowseLayout.GetFreeLayoutData("F_" + _ReportName,
                                                           comboBoxEdit1.Text, out ms, QueryFormFilter);

                    if (_FilterForm != null)
                    {
                        try
                        {
                            if (re != null)
                            {
                                if (LoadFilter)
                                {
                                    re.SetPersistanceField(QueryFormFilter);
                                }
                                else
                                {
                                    LoadFilter = true;
                                }
                                re.GetVariables(QueryFormFilter);
                                re.DataChanged();
                            }
                            else
                            {
                                if (QueryFormFilter != null)
                                {
                                    _FilterForm.FilterList = QueryFormFilter;
                                }
                                QueryFormFilter = _FilterForm.FilterList;
                            }
                        }
                        catch (Exception ex)
                        {
                            XtraMessageBox.Show(ex.Message,
                                                "Error Baca Filter Data",
                                                MessageBoxButtons.OK,
                                                MessageBoxIcon.Exclamation);
                        }

                        if (re != null)
                        {
                            _DataSource = re.GetDataSource();
                            if (_DataSource == null)
                            {
                                string            SqlQuery;
                                string            SqlOrder;
                                List <FieldParam> ListParam = new List <FieldParam>();
                                re.GetDataSource(out SqlQuery, out SqlOrder,
                                                 ListParam);
                                if (SqlQuery.Length > 0)
                                {
                                    if (SqlOrder.Length > 0)
                                    {
                                        SqlQuery = string.Concat("SELECT * FROM (",
                                                                 SqlQuery, ") x ORDER BY ", SqlOrder);
                                    }
                                    _DataSource = re.Dp.OpenDataTable(SqlQuery, ListParam);
                                }
                            }
                            re.GetVariables(QueryFormFilter);
                        }
                        else
                        {
                            _DataSource = null;
                        }

                        foreach (KeyValuePair <string, object> Filter in QueryFormFilter)
                        {
                            Type tp = Filter.Value.GetType();
                            if (Filter.Key != "DataSource")
                            {
                                if (Filter.Key == "DataSourceOrder" ||
                                    Filter.Key == "DataSourceParams")
                                {
                                    continue;
                                }
                                if (tp == typeof(string))
                                {
                                    _Evaluator.Variables.Add(Filter.Key, (string)Filter.Value);
                                }
                                else if (tp == typeof(int) ||
                                         tp == typeof(decimal) ||
                                         tp == typeof(Single) ||
                                         tp == typeof(double) ||
                                         tp.IsEnum)
                                {
                                    _Evaluator.Variables.Add(Filter.Key, Convert.ToDecimal(Filter.Value));
                                }
                                else if (tp == typeof(bool))
                                {
                                    _Evaluator.Variables.Add(Filter.Key, (bool)Filter.Value);
                                }
                                else if (tp == typeof(DateTime))
                                {
                                    _Evaluator.Variables.Add(Filter.Key, (DateTime)Filter.Value);
                                }
                                else
                                {
                                    _Evaluator.ObjValues.Add(Filter.Key, Filter.Value);
                                }
                            }
                            else if (tp == typeof(string))
                            {
                                string SqlQuery = ((string)Filter.Value).Trim();
                                object SqlOrder;
                                if (QueryFormFilter.TryGetValue("DataSourceOrder", out SqlOrder))
                                {
                                    SqlQuery = string.Concat("SELECT * FROM (",
                                                             SqlQuery, ") x ORDER BY ", (string)SqlOrder);
                                }

                                if (SqlQuery.Length > 0)
                                {
                                    object p;

                                    QueryFormFilter.TryGetValue("DataSourceParams", out p);
                                    if (p != null)
                                    {
                                        List <FieldParam> ListParam = p as List <FieldParam>;
                                        if (ListParam != null)
                                        {
                                            _DataSource = _EntityForm.DataPersistance
                                                          .OpenDataTable(SqlQuery, ListParam);
                                        }
                                        else
                                        {
                                            _DataSource = _EntityForm.DataPersistance
                                                          .OpenDataTable(SqlQuery, p as FieldParam[]);
                                        }
                                    }
                                    else
                                    {
                                        _DataSource = _EntityForm.DataPersistance
                                                      .OpenDataTable(SqlQuery);
                                    }
                                }
                            }
                            else
                            {
                                _DataSource = Filter.Value;
                            }
                        }
                    }
                    xReport Rpt = new xReport(_Evaluator);
                    if (_DataSource != null)
                    {
                        if (_DataSource.GetType().Name == "DataTable")
                        {
                            Rpt.DataSource = _DataSource;
                        }
                        else
                        {
                            IList ds = _DataSource as IList;
                            if (ds == null)
                            {
                                ds = new BindingList <object>();
                                ds.Add(_DataSource);
                            }
                            Rpt.DataSource = ds;
                        }
                    }
                    if (ms != null)
                    {
                        Rpt.LoadLayout(ms);
                        //Rpt.ScriptReferences = new string[] { GetType().Assembly.Location };
                        printControl1.PrintingSystem = Rpt.PrintingSystem;
                        Rpt.CreateDocument();
                    }
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(ex.Message,
                                        "Error Baca Layout Laporan", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                }
            }
        }
Exemple #17
0
        private void OnCloseFile(object sender, EventArgs e)
        {
            if (xrDesignPanel1.ReportState == ReportState.Changed)
            {
                switch (XtraMessageBox.Show("Layout telah berubah, simpan Perubahan ?",
                                            "Konfirmasi Simpan Perubahan Layout", MessageBoxButtons.YesNoCancel,
                                            MessageBoxIcon.Question))
                {
                case System.Windows.Forms.DialogResult.Yes:
                    if (barEditItem3.EditValue.ToString() == strTanpaLayout)
                    {
                        XtraMessageBox.Show("(Tanpa Layout) tidak dapat disimpan !",
                                            "Error Simpan Layout",
                                            MessageBoxButtons.OK, MessageBoxIcon.Information);
                        CancelClose = true;
                        return;
                    }

                    using (new WaitCursor())
                    {
                        try
                        {
                            MemoryStream mst = new MemoryStream();
                            xrDesignPanel1.Report.SaveLayout(mst);

                            if (SaveEval)
                            {
                                Dictionary <string, object> Filter = new Dictionary <string, object>();

                                if (_Evaluator != null)
                                {
                                    foreach (KeyValuePair <string, object> Var in _Evaluator.Variables.VarDictionary)
                                    {
                                        Filter.Add(Var.Key, Var.Value);
                                    }
                                }

                                DocPrintBrowseLayout.SaveUpdateFreeLayout(LayoutHeader + RptName,
                                                                          barEditItem3.EditValue.ToString(), mst, Filter);
                            }
                            else
                            {
                                DocPrintBrowseLayout.SaveUpdateLayout(LayoutHeader + RptName,
                                                                      barEditItem3.EditValue.ToString(), mst);
                            }
                            xrDesignPanel1.ReportState = ReportState.Opened;
                            xrDesignPanel1.FileName    = string.Empty;
                        }
                        catch (Exception ex)
                        {
                            XtraMessageBox.Show(ex.Message, "Error Update Layout",
                                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                            CancelClose = true;
                            return;
                        }
                    }
                    break;

                case System.Windows.Forms.DialogResult.Cancel:
                    CancelClose = true;
                    break;
                }
            }
        }
        public void ShowForm2(EntityForm EntityForm,
                              string ReportName, string FreeFilter,
                              object TransStartDate, object TransEndDate,
                              object[] Parameters)
        {
            _ReportName = ReportName;
            _EntityForm = EntityForm;

            if (EntityForm.ModuleName.Length > 0 && BaseSecurity.CurrentLogin
                .CurrentRole.Length > 0)
            {
                ModuleAccess ma = BaseSecurity.GetModuleAccess(EntityForm.ModuleName);

                if (!ma.GetVariable <bool>(SecurityVarName.ReportDesignPrint, false))
                {
                    comboBoxEdit1.Properties.Buttons[2].Enabled = false;
                }
            }

            _Evaluator = BaseFactory.CreateInstance <Evaluator>();
            if (_ReportName.Contains("Laporan"))
            {
                Text = _ReportName;
            }
            else
            {
                Text = "Laporan " + _ReportName;
            }

            _FilterForm = BaseFactory.CreateInstance(
                _EntityForm.FilterFormType) as IFilterForm;
            if (_FilterForm == null)
            {
                XtraMessageBox.Show("Form Filter harus implement Interface IFilterForm !",
                                    "Error Filter", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
                return;
            }
            _ShowViewForm = _FilterForm as IShowView;
            if (_ShowViewForm == null)
            {
                XtraMessageBox.Show("Form Filter harus implement Interface IShowView !",
                                    "Error Filter", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
                return;
            }

            if (_EntityForm.FilterFormType == null || _FilterForm as ReportEntity != null)
            {
                splitContainerControl1.PanelVisibility = SplitPanelVisibility.Panel2;
            }
            else
            {
                XtraForm Frm = _FilterForm as XtraForm;
                if (Frm != null)
                {
                    InitFilterForm(Frm, xtraScrollableControl1,
                                   splitContainerControl1);
                }
                else
                {
                    QueryReportEntity(xtraScrollableControl1,
                                      splitContainerControl1);
                }
            }

            List <string> ListItems = DocPrintBrowseLayout
                                      .GetListLayout("F_" + _ReportName);

            if (ListItems.Count == 0)
            {
                if (re != null)
                {
                    Dictionary <string, object> Vars = new Dictionary <string, object>();
                    re.GetVariables(Vars);
                    SaveReportFromTemplateFolder("F_", ReportName,
                                                 ListItems, Vars);
                }
                else
                {
                    SaveReportFromTemplateFolder("F_", ReportName,
                                                 ListItems, _FilterForm != null ?
                                                 _FilterForm.FilterList : null);
                }
            }
            comboBoxEdit1.Properties.Items.AddRange(ListItems);

            string CurrBrowseLayoutId = string.Empty;
            bool   Tmp;

            DocDefault.GetDefaultLayout(_ReportName,
                                        out CurrBrowseLayoutId, out CurrPrintLayoutId, out Tmp);

            if (re != null)
            {
                ((IShowView)re).ShowView(Parameters);
            }
            else if (_ShowViewForm != null)
            {
                _ShowViewForm.ShowView(Parameters);
            }

            comboBoxEdit1.SelectedItem = CurrBrowseLayoutId;
            if (comboBoxEdit1.SelectedIndex < 0 && comboBoxEdit1.Properties.Items.Count > 0)
            {
                comboBoxEdit1.SelectedIndex = 0;
            }
            else
            {
                comboBoxEdit1_SelectedIndexChanged(null, null);
            }
            sbTotal.Caption = "Total Halaman: " +
                              printControl1.PrintingSystem.Pages.Count;
            ribbonStatusBar1.Refresh();
            printControl1.PrintingSystem.AfterChange += new DevExpress.XtraPrinting.ChangeEventHandler(PrintingSystem_AfterChange);
            Show();
            printControl1.Focus();
        }