/// <summary> /// Alias of <see cref="getFilenameExtension(reportOutputFormatName)"/> /// </summary> /// <param name="outputFormat"></param> /// <returns></returns> public static String getDefaultExtension(this reportOutputFormatName outputFormat) { return(outputFormat.getFilenameExtension()); }
/// <summary> /// Gets the out file path using template /// </summary> /// <param name="context">The context.</param> /// <param name="content">The content.</param> /// <param name="pc">The pc.</param> /// <param name="format">The format.</param> /// <param name="dir">The dir.</param> /// <returns></returns> public string getOutFilePath(IRenderExecutionContext context, IMetaContentNested content, PropertyCollection pc, reportOutputFormatName format = reportOutputFormatName.none, DirectoryInfo dir = null) { if (pc == null) { pc = new PropertyCollection(); } if (content == null) { content = context.scope as IMetaContentNested; } if (dir == null) { dir = context.directoryScope; } if (format == reportOutputFormatName.none) { if (!pc.ContainsKey("ext")) { pc.Add("ext", ""); } else { pc["ext"] = "txt"; } } else { if (!pc.ContainsKey("ext")) { pc.Add("ext", format.getFilenameExtension()); } else { pc["ext"] = format.getFilenameExtension(); } } if (content != null) { if (!pc.ContainsKey("name")) { pc.Add("name", content.name.getFilename()); } else { pc["name"] = content.name.getFilename(); } //pc.Add("name", content.name); } string path = filenameTemplate.applyToContent(false, pc); if (outputpath != null) { if (!outputpath.directoryPath.isNullOrEmpty()) { path = outputpath.directoryPath.add(path, "\\"); } } path = dir.FullName.add(path, "\\"); return(path); }