/// <summary> /// Set company logo path parameter /// </summary> /// <param name="reportDocument">reportDocument</param> /// <param name="report">report</param> private void SetLogoPath(ReportDocument reportDocument, Sage.CA.SBS.ERP.Sage300.Common.Models.Reports.Report report) { var hasLogo = reportDocument.ParameterFields.Find("LogoPath", ""); if (hasLogo != null) { var logoPath = GetLogoUri(report); reportDocument.SetParameterValue("LogoPath", logoPath); } }
/// <summary> /// This method does the processing after the report is generated. /// </summary> /// <param name="report">Report</param> private static void Process(Sage.CA.SBS.ERP.Sage300.Common.Models.Reports.Report report) { if (string.IsNullOrEmpty(report.TypeName) || string.IsNullOrEmpty(report.AssemblyName)) { return; } var qualified = string.Format("{0}, {1}", report.TypeName, report.AssemblyName); var processService = Type.GetType(qualified, true); var processObject = Activator.CreateInstance(processService, new object[] { report.Context }); var mi = processService.GetMethod("Process"); mi.Invoke(processObject, new object[] { report.ReportModel }); }
/// <summary> /// Get blob uri with SAS token /// </summary> /// <param name="report">report</param> /// <returns></returns> private string GetLogoUri(Sage.CA.SBS.ERP.Sage300.Common.Models.Reports.Report report) { var service = report.Context.Container.Resolve <ICompanyProfileService <CompanyProfile> >(new ParameterOverride("context", report.Context)); return(service.GetCompanyLogoUri()); }