Ejemplo n.º 1
0
 public frmReport(DataTable dt, DataTable dtSub, string ReportName, string ReportSub, string[] FieldSub)
 {
     InitializeComponent();
     try
     {
         oBReport = new cBHT_Report();
         if (oBReport.LoadReport(c1r, ReportName, Application.StartupPath) == true)
         {
             C1.Win.C1Report.C1Report c1rSub = new C1.Win.C1Report.C1Report();
             if (oBReport.LoadReport(c1rSub, ReportSub, Application.StartupPath) == true)
             {
                 c1rSub.DataSource.RecordSource = "";
                 if (dtSub != null)
                 {
                     c1rSub.DataSource.Recordset = dtSub;
                 }
                 foreach (string str in FieldSub)
                 {
                     c1r.Fields[str].Subreport = c1rSub;
                 }
             }
             c1r.DataSource.RecordSource = "";
             c1r.DataSource.Recordset    = dt;
             if (c1r.Fields.Count > 0)
             {
                 c1PrintPreview.Document = c1r.Document;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
        public frmDevReport(DataTable dtMain, DataTable dtSub, string ReportMainName, string ReportSubName,
                            string[] FieldSubReport, string[] FieldFormatNumberMain, string[] FieldFormatNumberSub, string WaterMark)
        {
            InitializeComponent();
            rpt         = new XtraReport();
            oBHT_Report = new cBHT_Report();

            oBHT_Report.LoadXtraReport(rpt, ReportMainName, dtMain, Application.StartupPath, FieldFormatNumberMain, "");

            XtraReport rptSub = new XtraReport();

            oBHT_Report.LoadXtraReport(rptSub, ReportSubName, dtSub, Application.StartupPath, FieldFormatNumberSub, "");

            if (FieldSubReport != null)
            {
                foreach (string str in FieldSubReport)
                {
                    XRSubreport xrs = (XRSubreport)rpt.FindControl(str, true);
                    if (xrs != null)
                    {
                        xrs.ReportSource = rptSub;
                    }
                }
            }
            rpt.Watermark.Text           = WaterMark;
            printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument();
        }
Ejemplo n.º 3
0
        public frmDevReport(DataTable dtMain, DataTable dtSub, int IDHT_ReportMain, string WaterMark)
        {
            InitializeComponent();
            rpt         = new XtraReport();
            oBHT_Report = new cBHT_Report();

            oBHT_Report.LoadXtraReports(rpt, IDHT_ReportMain, dtMain, dtSub, Application.StartupPath);
            rpt.Watermark.Text = WaterMark;

            printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument();
        }
Ejemplo n.º 4
0
        public frmDevReport(DataTable dt, string ReportName, string[] FieldFormatNumber, string FormatType, string WaterMark)
        {
            InitializeComponent();
            rpt         = new XtraReport();
            oBHT_Report = new cBHT_Report();

            oBHT_Report.LoadXtraReport(rpt, ReportName, dt, Application.StartupPath, FieldFormatNumber, FormatType);

            rpt.Watermark.Text           = WaterMark;
            printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument();
        }
Ejemplo n.º 5
0
        public frmDevReport(DataTable dt, string ReportName, string[] FieldFormatNumber, string FormatType, string GroupBandName, string GroupFieldName)
        {
            InitializeComponent();
            rpt         = new XtraReport();
            oBHT_Report = new cBHT_Report();

            oBHT_Report.LoadXtraReport(rpt, ReportName, dt, Application.StartupPath, FieldFormatNumber, FormatType);

            GroupHeaderBand groupBand  = (GroupHeaderBand)rpt.Bands[GroupBandName];
            GroupField      groupField = new GroupField(GroupFieldName);

            groupBand.GroupFields.Add(groupField);

            printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument();
        }
Ejemplo n.º 6
0
 public frmReport(DataTable dt, string ReportName)
 {
     InitializeComponent();
     try
     {
         oBReport = new cBHT_Report();
         if (oBReport.LoadReport(c1r, ReportName, Application.StartupPath) == true)
         {
             c1r.DataSource.RecordSource = "";
             c1r.DataSource.Recordset    = dt;
             if (c1r.Fields.Count > 0)
             {
                 c1PrintPreview.Document = c1r.Document;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }