private void Generate3() { mReportForM12 master = (mReportForM12)this.Master; string unitType = ddlUnitType.SelectedValue; int companyId = Convert.ToInt32(hdfCompanyId.Value); FlM1ReportTDS flM1ReportTDS = new FlM1ReportTDS(); // Get Data LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM1Report flM1Report = new LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM1Report(flM1ReportTDS); LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM12Report flM2Report = new LiquiForce.LFSLive.BL.CWP.FullLengthLining.FlM12Report(flM1ReportTDS); GetM1Data(flM1Report, unitType, companyId); GetM2Data(flM2Report, unitType); // ... set properties to master page //FlM1ReportTDS dataSet = new FlM1ReportTDS(); //dataSet.M1ReportByClient.Merge(flM1Report, true); //dataSet.M2_SECTION.Merge(flM2Report, true); master.Data3 = flM1ReportTDS; master.Table1 = flM1Report.TableName; master.Table2 = flM2Report.TableName; // Get report if (flM2Report.Table.Rows.Count > 0 || flM1Report.Table.Rows.Count > 0) { if (master.Format3 == "pdf") { master.Report3 = new FlM12Report(); if (ddlClient.SelectedValue != "-1") { // ... for client int currentClientId = Int32.Parse(ddlClient.SelectedValue); CompaniesGateway companiesGateway = new CompaniesGateway(); companiesGateway.LoadByCompaniesId(currentClientId, companyId); master.SetParameter3("Client", companiesGateway.GetName(currentClientId)); } else { master.SetParameter3("Client", "All"); } if (ddlProject.SelectedValue != "-1") { // ... for project int currentProjectId = Int32.Parse(ddlProject.SelectedValue); ProjectGateway projectGateway = new ProjectGateway(); projectGateway.LoadByProjectId(currentProjectId); string name = projectGateway.GetName(currentProjectId); master.SetParameter3("Project", name); } else { master.SetParameter3("Project", "All"); } master.SetParameter3("UnitType", unitType); int loginId = Convert.ToInt32(Session["loginID"]); LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadByLoginId(loginId, companyId); string user = loginGateway.GetLastName(loginId, companyId) + " " + loginGateway.GetFirstName(loginId, companyId); master.SetParameter3("User", user.Trim()); } else { //master.Report2 = new FlM12ReportExport(); } } }
/// <summary> /// InitData /// </summary> protected override void InitData() { _data = new FlM1ReportTDS(); }