public void PreviewBudgetDetails(int budID, string wbs) { FPreviewAR pv = new FPreviewAR(); rprtBudgetDetail rprt = new rprtBudgetDetail(); DataSet ds; CBBudget bud = new CBBudget(); CBProject proj = new CBProject(); CBCustomer cust = new CBCustomer(); CBLocation loc = new CBLocation(); CBState state = new CBState(); bud.Load(budID); proj.Load(bud.ProjectID); cust.Load(proj.CustomerID); loc.Load(proj.LocationID); state.Load(loc.StateID); ds = CBBudget.GetBudgetDetailsForReport(budID, wbs); if (proj.BusinessUnit() == 1) { rprt.MainReportTitle = "Staffing Estimate Loaded Details"; } if (proj.BusinessUnit() == 2) { rprt.MainReportTitle = "Engineering Estimate Loaded Details"; } if (proj.BusinessUnit() == 3) { rprt.MainReportTitle = "Pipeline Services Estimate Loaded Details"; } if (proj.BusinessUnit() == 4) { rprt.MainReportTitle = "Program Management Estimate Loaded Details"; } if (proj.BusinessUnit() == 5) { rprt.MainReportTitle = "EPC Estimate Loaded Details"; } pv.projNumber = proj.Number; //***************************Added 6/25/15 // MessageBox.Show(pv.projNumber); rprt.SetTitles(cust.Name + " / " + loc.City + "," + state.Abbrev, proj.Description, proj.Number, bud.GetNumber(), wbs); rprt.DataSource = ds; rprt.DataMember = "Table"; pv.Title = rprt.MainReportTitle; //************************Added 10/1/2015 pv.ViewReport(rprt); pv.ShowDialog(); }
private GrapeCity.ActiveReports.Document.Section.PagesCollection CreatePagesBudgetDetails(int budID, string wbs) { rprtBudgetDetail rprt = new rprtBudgetDetail(); DataSet ds; CBBudget bud = new CBBudget(); CBProject proj = new CBProject(); CBCustomer cust = new CBCustomer(); CBLocation loc = new CBLocation(); CBState state = new CBState(); bud.Load(budID); proj.Load(bud.ProjectID); cust.Load(proj.CustomerID); loc.Load(proj.LocationID); state.Load(loc.StateID); ds = CBBudget.GetBudgetDetailsForReport(budID, wbs); if (proj.BusinessUnit() == 1) { rprt.MainReportTitle = "Staffing Estimate Loaded Details"; } if (proj.BusinessUnit() == 2) { rprt.MainReportTitle = "Engineering Estimate Loaded Details"; } if (proj.BusinessUnit() == 3) { rprt.MainReportTitle = "Pipeline Services Estimate Loaded Details"; } if (proj.BusinessUnit() == 4) { rprt.MainReportTitle = "Program Management Estimate Loaded Details"; } if (proj.BusinessUnit() == 5) { rprt.MainReportTitle = "EPC Estimate Loaded Details"; } rprt.SetTitles(cust.Name + " / " + loc.City + "," + state.Abbrev, proj.Description, proj.Number, bud.GetNumber(), wbs); rprt.DataSource = ds; rprt.DataMember = "Table"; rprt.Run(false); return(rprt.Document.Pages); }
public void Show_BudgetDetails(int budID, string wbs) //**************************Added 6/22/15 { FPreviewAR pv = new FPreviewAR(); rprtBudgetDetail rprt = new rprtBudgetDetail(); DataSet ds; CBBudget bud = new CBBudget(); CBProject proj = new CBProject(); CBCustomer cust = new CBCustomer(); CBLocation loc = new CBLocation(); CBState state = new CBState(); bud.Load(budID); proj.Load(bud.ProjectID); cust.Load(proj.CustomerID); loc.Load(proj.LocationID); state.Load(loc.StateID); ds = CBBudget.GetBudgetDetailsForReport(budID, wbs); if (proj.BusinessUnit() == 1) { rprt.MainReportTitle = "Staffing Estimate Loaded Details"; } if (proj.BusinessUnit() == 2) { rprt.MainReportTitle = "Engineering Estimate Loaded Details"; } if (proj.BusinessUnit() == 3) { rprt.MainReportTitle = "Pipeline Services Estimate Loaded Details"; } if (proj.BusinessUnit() == 4) { rprt.MainReportTitle = "Program Management Estimate Loaded Details"; } if (proj.BusinessUnit() == 5) { rprt.MainReportTitle = "EPC Estimate Loaded Details"; } rprt.SetTitles(cust.Name + " / " + loc.City + "," + state.Abbrev, proj.Description, proj.Number, bud.GetNumber(), wbs); rprt.DataSource = ds; rprt.DataMember = "Table"; //pv.ViewReport(rprt); //pv.ShowDialog(); GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport PDFEx = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport(); pv.Title = rprt.MainReportTitle; //************************Added 10/1/2015 rprt.Run(); SaveFileDialog sv1 = new SaveFileDialog(); sv1.Filter = "PDF Files | *.pdf"; sv1.DefaultExt = "pdf"; //PDFEx.FileFormat = GrapeCity.ActiveReports.Export.Pdf.Section.FileFormat.Xlsx; if (sv1.ShowDialog() == DialogResult.OK) { // ee.ExportBudgetForPrimavera(saveFileDialog1.FileName, moPCN.ID); PDFEx.Export(rprt.Document, sv1.FileName); } }