namespace GB5Shared.Export.HybridReport { /// /// Resolves the bundled default report templates (default.txt, pivot-report.html, /// headerhtml.html, footer.html, Unisoft1.png), independent of OS or deployment folder. /// Path is derived from the running assembly's own directory (AppContext.BaseDirectory), /// same fix class as ChromiumResolver — these files travel with the build output instead /// of needing to be hand-placed at a machine-specific absolute path (PDFEXPORT config). /// public static class ReportTemplateResolver { private static string TemplatesDir => Path.Combine(AppContext.BaseDirectory, "Templates"); public static string DefaultView => Resolve("default.txt"); public static string PivotView => Resolve("pivot-report.html"); public static string HeaderHtml => Resolve("headerhtml.html"); public static string FooterHtml => Resolve("footer.html"); public static string LogoPath => Resolve("Unisoft1.png"); private static string Resolve(string fileName) { var path = Path.Combine(TemplatesDir, fileName); if (!File.Exists(path)) { throw new FileNotFoundException( $"Bundled report template '{fileName}' not found at: {path}. " + $"Verify the host's .csproj copies GB5Shared/Export/HybridReport/Templates/** into its output/publish directory."); } return path; } } }