Example #1
0
        /// <summary>
        /// Prints the preview report.
        /// </summary>
        /// <param name="frmParent">The FRM parent.</param>
        /// <param name="reportId">The s report identifier.</param>
        /// <param name="isPint">if set to <c>true</c> [is pint].</param>
        public void PrintPreviewReport(XtraForm frmParent, string reportId, bool isPint)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                _reportListModel = ReportLists.Find(item => item.ReportID == reportId);
                if (_reportListModel == null)
                {
                    return;
                }
                _frmParentForm = frmParent;
                var reportListSource = GetDataSource(frmParent, _reportListModel);
                if (reportListSource == null)
                {
                    return;
                }
                if (reportListSource.Count <= 0)
                {
                    XtraMessageBox.Show("Dữ liệu lấy lên báo cáo Không có bản ghi nào.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (!string.IsNullOrEmpty(_reportListModel.TableName))
                {
                    DataMember = _reportListModel.TableName.Trim();
                }
                DisplayReport(ref reportListSource, _reportListModel, false, frmParent, false, isPint, DateTime.MinValue);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #2
0
        /// <summary>
        /// Prints the preview report by report.
        /// </summary>
        /// <param name="frmParent">The FRM parent.</param>
        /// <param name="param">The e parameter.</param>
        /// <param name="isPrint">if set to <c>true</c> [is print].</param>
        public void PrintPreviewReportByReport(XtraForm frmParent, DrilldownReportParam param, bool isPrint)
        {
            try
            {
                Cursor.Current   = Cursors.WaitCursor;
                _reportListModel = ReportLists.Find(item => item.ReportID == param.ArgParameter[0].ToString());
                if (_reportListModel == null)
                {
                    return;
                }
                _frmParentForm = frmParent;

                var reportListSource = GetDrillDownDataSource(frmParent, _reportListModel, param.ArgParameter);
                if (reportListSource == null || reportListSource.Count <= 0)
                {
                    return;
                }
                if (reportListSource.Count > 0)
                {
                    if (!string.IsNullOrEmpty(_reportListModel.TableName))
                    {
                        DataMember = _reportListModel.TableName.Trim();
                    }
                    DisplayReport(ref reportListSource, _reportListModel, false, frmParent, false, isPrint, DateTime.MinValue);
                }
                else
                {
                    XtraMessageBox.Show("Không có bản ghi nào", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #3
0
 public void ExtractXMLKhoBac(string reportId)
 {
     _reportListModel = ReportLists.Find(item => item.ReportId == reportId);
     if (!string.IsNullOrEmpty(_reportListModel.InputTypeName))
     {
         var type   = Assembly.GetExecutingAssembly().GetType(GetType().Namespace + "." + "ExportXML");
         var target = (BaseReport)Activator.CreateInstance(type);
         if (!string.IsNullOrEmpty(_reportListModel.ProcedureName))
         {
             var args       = new object[] { ReportParameter, _rsTool, null, false };
             var dataSource = (IList)(type.InvokeMember(_reportListModel.FunctionReportName + "XML", BindingFlags.InvokeMethod, null, target, args));
         }
     }
 }