Esempio n. 1
0
        private void showReport(DataSet ds)
        {
            CrystalReportViewer   reportViewer = new CrystalReportViewer();
            InvoiceWithoutPicture invoiceWithoutPictureReport = new InvoiceWithoutPicture();

            invoiceWithoutPictureReport.SetDataSource(ds);
            //invoiceWithPictureReport.SetDataSource(ds.Tables[1]);
            //invoiceWithPictureReport.SetDataSource(ds.Tables[0]);
            List <string> customerList = getCustomerDetailByID();

            if (customerList.Count > 0)
            {
                CrystalDecisions.CrystalReports.Engine.TextObject txtCustomerName    = (CrystalDecisions.CrystalReports.Engine.TextObject)invoiceWithoutPictureReport.Section1.ReportObjects["txtName"];
                CrystalDecisions.CrystalReports.Engine.TextObject txtCustomerAddress = (CrystalDecisions.CrystalReports.Engine.TextObject)invoiceWithoutPictureReport.Section1.ReportObjects["txtAddress"];
                txtCustomerName.Text    = customerList[0];
                txtCustomerAddress.Text = customerList[1];
            }
            CrystalDecisions.CrystalReports.Engine.TextObject txtInvoiceType = (CrystalDecisions.CrystalReports.Engine.TextObject)invoiceWithoutPictureReport.Section1.ReportObjects["txtInvoiceType"];
            if (rdoOriginal.Checked)
            {
                txtInvoiceType.Text = rdoOriginal.Text;
            }
            else
            {
                txtInvoiceType.Text = rdoDuplicate.Text;
            }

            reportViewer.crystalReportViewer1.ReportSource = invoiceWithoutPictureReport;
            reportViewer.crystalReportViewer1.Refresh();
            reportViewer.Visible = true;
        }
Esempio n. 2
0
        private void showPhotoReport(DataSet ds)
        {
            CrystalReportViewer           reportViewer       = new CrystalReportViewer();
            StockSummaryReportWithPicture stockSummaryReport = new StockSummaryReportWithPicture();

            stockSummaryReport.SetDataSource(ds.Tables[0]);
            CrystalDecisions.CrystalReports.Engine.TextObject txtReportDate = (CrystalDecisions.CrystalReports.Engine.TextObject)stockSummaryReport.Section1.ReportObjects["txtReportDate"];
            txtReportDate.Text = txtReportDate.Text + dtDate.Value.ToShortDateString();
            reportViewer.crystalReportViewer1.ReportSource = stockSummaryReport;
            reportViewer.crystalReportViewer1.Refresh();
            reportViewer.Visible = true;
        }