public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { HghlyRqstdCtgryRprt rpt = new HghlyRqstdCtgryRprt(); rpt.Site = this.Site; return(rpt); }
private void LoadPrintableReports() {//EMthod to add data to the request table,it also avoids the database loginig in prompt try { ReportsRequest reportJobRequests = new ReportsRequest(); ProfitableClientsReport profitableClientsReport = new ProfitableClientsReport(); PlacementByLabourer placementByLabourerReport = new PlacementByLabourer(); HghlyRqstdCtgryRprt hghlyRqstdCtgryReport = new HghlyRqstdCtgryRprt(); reportJobRequests.SetDatabaseLogon($"{Database.serverLoginName}", $"{Database.serverLoginPass}", $"{Database.serverName}", $"{Database.databaseName}"); profitableClientsReport.SetDatabaseLogon($"{Database.serverLoginName}", $"{Database.serverLoginPass}", $"{Database.serverName}", $"{Database.databaseName}"); placementByLabourerReport.SetDatabaseLogon($"{Database.serverLoginName}", $"{Database.serverLoginPass}", $"{Database.serverName}", $"{Database.databaseName}"); hghlyRqstdCtgryReport.SetDatabaseLogon($"{Database.serverLoginName}", $"{Database.serverLoginPass}", $"{Database.serverName}", $"{Database.databaseName}"); // reportJobRequests.Load(@"C:\Users\T4NY4\source\repos\iJob2019\PROJECT BACKUP\iJob2019 08_05_2019\ReportJobRequests.rpt"); reportViewerJobR.ReportSource = reportJobRequests; reportViewerJobR.Refresh(); JobPlacementRprtVwr.ReportSource = placementByLabourerReport; JobPlacementRprtVwr.Refresh(); ProfitabelClientViewer2.ReportSource = profitableClientsReport; ProfitabelClientViewer2.Refresh(); RqstPerLabourersReportViewer.ReportSource = hghlyRqstdCtgryReport; RqstPerLabourersReportViewer.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }