예제 #1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmBillOfLadingReport objBillOfLadingReportForm;
            LocalReport           objLocalReport;

            ReportParameter[] objParameterArray;


            mstrbldrErrors.Clear();
            this.ValidateChildren();
            if (mstrbldrErrors.Length > 0)
            {
                return;
            }

            objBillOfLadingReportForm = new frmBillOfLadingReport();
            objBillOfLadingReportForm.rptViewer.ProcessingMode        = Microsoft.Reporting.WinForms.ProcessingMode.Local;
            objBillOfLadingReportForm.rptViewer.ShowDocumentMapButton = false;

            objLocalReport            = objBillOfLadingReportForm.rptViewer.LocalReport;
            objLocalReport.ReportPath = "ReportTemplates\\BillOfLading.rdlc";

            objBillOfLadingReportForm.rptViewer.SetDisplayMode(DisplayMode.PrintLayout);

            objParameterArray    = new ReportParameter[9];
            objParameterArray[0] = new ReportParameter("CarrierDescription", ((ComboBoxItem)cboCarrier.SelectedItem).Text);
            objParameterArray[1] = new ReportParameter("FreightCharges", ((ComboBoxItem)cboFreightCharges.SelectedItem).Text);
            objParameterArray[2] = new ReportParameter("TotalCharges", "");
            objParameterArray[3] = new ReportParameter("PalletCount", txtPalletCt.Text);
            objParameterArray[4] = new ReportParameter("GrossWeight", txtGrossWgt.Text);
            objParameterArray[5] = new ReportParameter("ShipClassification", ((ComboBoxItem)cboShipClass.SelectedItem).Text);
            objParameterArray[6] = new ReportParameter("Notes", txtNotes.Text);
            objParameterArray[7] = new ReportParameter("CustomerAddress", txtAddress.Text);
            objParameterArray[8] = new ReportParameter("CustomerOrderNumber", txtOrder.Text);
            objLocalReport.SetParameters(objParameterArray);

            objBillOfLadingReportForm.ShowDialog();

            btnCancel.Text = "Finish";
        }
예제 #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            frmBillOfLadingReport objBillOfLadingReportForm;
            LocalReport objLocalReport;
            ReportParameter[] objParameterArray;

            mstrbldrErrors.Clear();
            this.ValidateChildren();
            if (mstrbldrErrors.Length > 0)
                return;

            objBillOfLadingReportForm = new frmBillOfLadingReport();
            objBillOfLadingReportForm.rptViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
            objBillOfLadingReportForm.rptViewer.ShowDocumentMapButton = false;

            objLocalReport = objBillOfLadingReportForm.rptViewer.LocalReport;
            objLocalReport.ReportPath = "ReportTemplates\\BillOfLading.rdlc";

            objBillOfLadingReportForm.rptViewer.SetDisplayMode(DisplayMode.PrintLayout);

            objParameterArray = new ReportParameter[9];
            objParameterArray[0] = new ReportParameter("CarrierDescription", ((ComboBoxItem)cboCarrier.SelectedItem).Text);
            objParameterArray[1] = new ReportParameter("FreightCharges", ((ComboBoxItem)cboFreightCharges.SelectedItem).Text);
            objParameterArray[2] = new ReportParameter("TotalCharges", "");
            objParameterArray[3] = new ReportParameter("PalletCount", txtPalletCt.Text);
            objParameterArray[4] = new ReportParameter("GrossWeight", txtGrossWgt.Text);
            objParameterArray[5] = new ReportParameter("ShipClassification", ((ComboBoxItem)cboShipClass.SelectedItem).Text);
            objParameterArray[6] = new ReportParameter("Notes", txtNotes.Text);
            objParameterArray[7] = new ReportParameter("CustomerAddress", txtAddress.Text);
            objParameterArray[8] = new ReportParameter("CustomerOrderNumber", txtOrder.Text);
            objLocalReport.SetParameters(objParameterArray);

            objBillOfLadingReportForm.ShowDialog();

            btnCancel.Text = "Finish";
        }