Exemple #1
0
 protected virtual void OnPrint()
 {
     if (m_report != null)
     {
         var previewDlg = new rptPreview();
         previewDlg.mRpt = m_report;
         previewDlg.ShowDialog();
         //rpt.Run();
         m_report.Clean();
         m_report.Dispose();
     }
 }
Exemple #2
0
        protected override void OnPrint()
        {
            //get selected record
            var rows = m_dataPanel.m_dataGridView.SelectedRows;

            if (rows.Count > 0)
            {
                var     row = rows[0];
                DataRow dr  = ((DataRowView)row.DataBoundItem).Row;
                m_rptAsst.setData(dr);
                var dt = m_rptAsst.getData();

                var rpt = new lBillReport();
                rpt.rptAsst = m_rptAsst;

                var previewDlg = new rptPreview();
                previewDlg.mRpt = rpt;
                previewDlg.ShowDialog();
                rpt.Clean();
                rpt.Dispose();
            }
        }
Exemple #3
0
        private void PrintBtn_Click(object sender, EventArgs e)
        {
            lBaseReport rpt = null;

            if (paymentRadio.Checked)
            {
                switch (paymentRptType.SelectedIndex)
                {
                case (int)receiptsRptType.byDays:
#if true
                    //rpt = new lDaysReport(startDate.Value, endDate.Value);
                    rpt = new lPaymentDays(startDate.Value, endDate.Value);
#else
                    rpt = new lSqlDaysReport(startDate.Value, endDate.Value);
#endif
                    break;

                case (int)receiptsRptType.byWeek:
#if true
                    rpt = new lWeekReport(startDate.Value, endDate.Value);
#else
                    rpt = new lSqlWeekReport(startDate.Value, endDate.Value);
#endif
                    break;

                case (int)receiptsRptType.byMonth:
#if true
                    rpt = new lMonthReport(startDate.Value, endDate.Value);
#else
                    rpt = new lSqlMonthReport(startDate.Value, endDate.Value);
#endif
                    break;
                }
            }
            else if (buildingRadio.Checked)
            {
                rpt = new lBuildingReport(buildingCmb.Text, startDate.Value, endDate.Value);
            }
            else if (constrorgRadio.Checked)
            {
                rpt = new lConstrorgReport(constrorgCmb.Text, startDate.Value, endDate.Value);
            }
            else if (daysumRd.Checked)
            {
                rpt = new lDaysumReport(startDate.Value, endDate.Value);
            }
            else if (rptRcptRad.Checked)
            {
                rpt = new lReceiptsDays(startDate.Value, endDate.Value);
            }
            if (rpt != null)
            {
                var previewDlg = new rptPreview();
                previewDlg.mRpt = rpt;
                previewDlg.ShowDialog();
                //rpt.Run();
                rpt.Clean();
                rpt.Dispose();
            }
#if return_main
            Close();
#endif
        }