Exemplo n.º 1
0
        /// <summary>
        /// Reports the drill down ledger report.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="eParam">The e parameter.</param>
        private void ReportDrillDownLedgerReport(object sender, DrilldownReportParam eParam)
        {
            try
            {
                var pageIndex = ReportSharpTool.oPreviewForm.ReportViewer.PageIndex;
                ReportTool.DrillDownReport(sender, eParam);

                var zoom         = ReportSharpTool.PreviewForm.ReportViewer.Zoom;
                var templateFile = ReportSharpTool.ReportSlot.FilePath;
                ReportSharpTool.ReportSlot.FilePath = ReportSharpTool.ReportFileName;
                ReportSharpTool.ReportSlot.Document = ReportSharpTool.ReportSlot.LoadReport();

                ReportSharpTool.RefreshInfo(ReportSharpTool.ReportSlot.Document);

                ReportSharpTool.ReportSlot.FilePath = templateFile;
                ReportSharpTool.ReportSlot.SaveReport(ReportSharpTool.ReportSlot.Document);
                ReportSharpTool.ReportSlot.RenderDocument();



                ReportSharpTool.PreviewForm.ReportViewer.Actions["RefreshReport"].ExecuteAction();

                var reportFileName = ReportSharpTool.ReportFileName;
                ReportSharpTool.PreviewForm.Text = ReportSharpTool.ReportTitle + @"  [" + reportFileName.Substring((reportFileName.LastIndexOf("\\", StringComparison.Ordinal) + 1),
                                                                                                                   ((reportFileName.Length - reportFileName.LastIndexOf("\\", StringComparison.Ordinal)) - 1)) +
                                                   @"] - Xem báo cáo";
                ReportSharpTool.PreviewForm.ReportViewer.Zoom       = zoom;
                ReportSharpTool.oPreviewForm.ReportViewer.PageIndex = pageIndex;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Designs the report template.
 /// </summary>
 /// <param name="reportPathFile">The sreportpathfile.</param>
 /// ReSharper disable once UnusedMember.Local
 public void DesignReportTemplate(string reportPathFile)
 {
     try
     {
         ReportSharpTool.ReportFileName = reportPathFile;
         ReportSharpTool.DesignReport();
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }