예제 #1
0
        private void PrintStickersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (documentListDataGridView.Rows.Count < 1)
            {
                MessageBox.Show(WindowMessages.NO_DATA_AVAILABLE_FOR_PRINT, WindowMessages.WARNING_TITLE);
                return;
            }

            if (new PrintStickersSelectionForm(this).ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var allRows         = documentListDataGridView.Rows.Cast <DataGridViewRow>().Select(r => r.DataBoundItem).Cast <UPNDocument>().ToList();
            var stickersDataSet = allRows.Where(upn => upn.Selected).Select(upn => upn.Member).ToList();

            for (var i = 0; i < stickersToSkip; i++)
            {
                stickersDataSet.Insert(0, new Member());
            }

            var form = ReportViewerForm.GetInstance();

            form.SetReport(
                stickerFormat,
                new ReportDataSource("DataSet1", stickersDataSet),
                new List <ReportParameter>()
                );
        }
예제 #2
0
        private void showReportButton_Click(object sender, EventArgs e)
        {
            var selectedStat = (Report)reportsListBox.SelectedItem;

            var form = ReportViewerForm.GetInstance();

            //form.SetReport(selectedStat.ReportPath, selectedStat.DataSource, selectedStat.Parameters);

            form.SetReport(
                selectedStat.ReportPath,
                selectedStat.GetDataSource(GetQueryParameterValues()),
                GetReportParameterValues()
                );
        }
        private void PrintPaymentsListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (paymentsDataGridView.Rows.Count < 1)
            {
                MessageBox.Show(WindowMessages.NO_DATA_AVAILABLE_FOR_PRINT, WindowMessages.WARNING_TITLE);
                return;
            }

            //new ReportViewerForm(GetReportDefinition(), GetDataSource(), new List<ReportParameter>()).Show();

            var form = ReportViewerForm.GetInstance();

            form.SetCustomReport(
                GetReportDefinition(),
                GetDataSource(),
                new List <ReportParameter>()
                );
        }
        private void PrintButton_Click(object sender, EventArgs e)
        {
            if (paymentDebtsDataGridView.Rows.Count < 1)
            {
                MessageBox.Show(WindowMessages.NO_DATA_AVAILABLE_FOR_PRINT, WindowMessages.WARNING_TITLE);
                return;
            }

            //new ReportViewerForm(REPORT_NAME, GetReportDataSet(), new List<ReportParameter>()).Show();

            //form.SetReport(selectedStat.ReportPath, selectedStat.DataSource, selectedStat.Parameters);

            ReportViewerForm.GetInstance().SetReport(
                REPORT_NAME,
                GetReportDataSet(),
                new List <ReportParameter>()
                );
        }