private void btnPriview_Click(object sender, EventArgs e) { if (IsSelValid()) { string[,] param = { { "FromTxDate", this.dtpTrnFromTime.Value.ToString(DateTimeHelper.GetDateFormat()) }, { "ToTxDate", this.dtpTrnToTime.Value.ToString(DateTimeHelper.GetDateFormat()) }, { "TOPNumber", this.txtTopVipSpendingNumber.Text.Trim() }, { "SalesAmount", this.txtSalesAmountOver.Text.Trim() }, { "BRAND", SelectedList(this.lvVendorList, 2) }, { "PrintedOn", DateTime.Now.ToString(DateTimeHelper.GetDateTimeFormat()) }, { "CompanyName", SystemInfoEx.CurrentInfo.Default.CompanyName } }; RT2020.Controls.Reporting.Viewer view = new RT2020.Controls.Reporting.Viewer(); view.Datasource = BindData(); view.ReportDatasourceName = "RT2020_Controls_Reporting_DataSource_vwVIP_TopSpending"; view.ReportName = "RT2020.Member.Reports.VipVendorSpendingFormRdl.rdlc"; view.Parameters = param; if (SelectedList(this.lvVendorList, 2).Length > 0) { view.Show(); } else { MessageBox.Show(String.Format("Must select at least one {0}!", SystemInfoHelper.Settings.GetSystemLabelByKey("CLASS1")), "Please Select"); view.Close(); } } }
private void DoPreview() { string DatasourceName = string.Empty; string reportName = string.Empty; string StartOn = string.Empty; if (rbSunday.Checked) { //StartOn = "SU"; DatasourceName = "RT2020_Controls_Reporting_DataSource_vwRptPurchaseWeeklyExpectedReceivingSummaryStartOnSunday"; reportName = "RT2020.Purchasing.Reports.Receiving.Reports.WeeklyExpectedReceivingSummary_SundayRdl.rdlc"; } else if (rbMonday.Checked) { //StartOn = "MO"; DatasourceName = "RT2020_Controls_Reporting_DataSource_vwRptPurchaseWeeklyExpectedReceivingSummaryStartOnMonday"; reportName = "RT2020.Purchasing.Reports.Receiving.Reports.WeeklyExpectedReceivingSummary_MondayRdl.rdlc"; } string[,] param = { { "DateBegin", this.dtDateFrom.Value.ToString(DateTimeHelper.GetDateFormat()) }, { "DateEnd", this.dtDateTo.Value.ToString(DateTimeHelper.GetDateFormat()) }, { "SupplierCodeFrom", this.cboSupplierFrom.Text.Trim() }, { "SupplierCodeTo", this.cboSupplierTo.Text.Trim() }, { "STKCODEFrom", this.cboStockCodeFrom.Text.Trim() }, { "STKCODETo", this.cboStockCodeTo.Text.Trim() }, { "StartOn", StartOn.ToString() }, { "SelectedWorkplaceCode", this.SelectedWorkplaceList().ToString().Trim(',') }, { "CompanyName", SystemInfoEx.CurrentInfo.Default.CompanyName } }; RT2020.Controls.Reporting.Viewer viewer = new RT2020.Controls.Reporting.Viewer(); //viewer.Datasource = SqlHelper.ExecuteDataSet("apRptPurchaseWeeklyExpectedReceivingSummary",obj).Tables[0]; viewer.Datasource = BindData(); viewer.ReportDatasourceName = DatasourceName; viewer.ReportName = reportName; viewer.Parameters = param; if ((SelectedWorkplaceList().Length != 0) && (rbMonday.Checked || rbSunday.Checked)) { viewer.Show(); } else { MessageBox.Show("Location和WeekdayStart中任何一项不能为空!", "请选值!"); viewer.Close(); } }
private void btnPriview_Click(object sender, EventArgs e) { if (IsSelValid()) { string[,] param = { { "PrintedOn", DateTime.Now.ToString(DateTimeHelper.GetDateTimeFormat()) } }; RT2020.Controls.Reporting.Viewer view = new RT2020.Controls.Reporting.Viewer(); view.Datasource = BindData(); view.ReportDatasourceName = "RT2020_Controls_Reporting_DataSource_vwVIP_TopSpending"; #region ReportName if (rbtnLayout_1.Checked) { //print Address District Country if (rbtnVIP_L001.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L001ADCRdl.rdlc"; } else if (rbtnVIP_L002.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L002ADCRdl.rdlc"; } else if (rbtnVIP_L003.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L003ADCRdl.rdlc"; } else if (rbtnVIP_L004.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L004ADCRdl.rdlc"; } } else if (rbtnLayout_2.Checked) { //print Country District Address if (rbtnVIP_L001.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L001CDARdl.rdlc"; } else if (rbtnVIP_L002.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L002CDARdl.rdlc"; } else if (rbtnVIP_L003.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L003CDARdl.rdlc"; } else if (rbtnVIP_L004.Checked) { view.ReportName = "RT2020.Member.Reports.VipMLblBySpendingForm_L004CDARdl.rdlc"; } } #endregion view.Parameters = param; if (SelectedList(this.lvVendorList, 2).Length > 0) { view.Show(); } else { MessageBox.Show("Must Select At least One of BRAND!", "Please Select"); view.Close(); } } }