/// <summary>
		/// Cunstructs the instance.
		/// </summary>
		/// <param name="module">Module containing report viewer component.</param>
		/// <exception cref="ArgumentNullException">Whem <paramref name="module"/> is null.</exception>
		public WebsitePanelModuleResourceStorage(WebsitePanelModuleBase module)
		{
			if (module == null)
			{
				throw new ArgumentNullException("module");
			}

			this.module = module;
		}
Beispiel #2
0
        /// <summary>
        /// Cunstructs the instance.
        /// </summary>
        /// <param name="module">Module containing report viewer component.</param>
        /// <exception cref="ArgumentNullException">Whem <paramref name="module"/> is null.</exception>
        public WebsitePanelModuleResourceStorage(WebsitePanelModuleBase module)
        {
            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            this.module = module;
        }
		/// <summary>
		/// Loads embedded report file.
		/// </summary>
		/// <param name="assembly"><see cref="Assembly"/> containing the report file.</param>
		/// <param name="embeddedReportName">Name of the report in format {default namespace}.{folder structure inside assembly}.{file name with extension}</param>
		/// <param name="embeddedReportResourceId">Resource identifier of a report being loaded.</param>
		/// <param name="module">Instance of a module containing the ReportViewer component.</param>
		/// <returns><see cref="TextReader"/> containing the localized report file.</returns>
		/// <exception cref="ArgumentNullException">When <paramref name="assembly"/>, <paramref name="embeddedReportName"/> or <paramref name="module"/> is null.</exception>
		public static TextReader LoadReportFileFromAssembly(Assembly assembly, string embeddedReportName, string embeddedReportResourceId, WebsitePanelModuleBase module)
		{
			if (assembly == null)
			{
				throw new ArgumentNullException("assembly");
			}
			if (String.IsNullOrEmpty(embeddedReportName))
			{
				throw new ArgumentNullException("embeddedReportName");
			}
			if (module == null)
			{
				throw new ArgumentNullException("module");
			}

			return new EmbeddedReportLocalizer(
					assembly
					, embeddedReportName
					, embeddedReportResourceId
					, new WebsitePanelModuleResourceStorage(module)
				).GetLocalizedReportStream();
		}
		/// <summary>
		/// Load report from file on disk.
		/// </summary>
		/// <param name="reportPath">Path to the report file.</param>
		/// <param name="reportResourceId">Resource id of a report inside resource file.</param>
		/// <param name="module">Instance of a module containing the ReportViewer component.</param>
		/// <returns><see cref="TextReader"/> containing the localized report file.</returns>
		/// <exception cref="ArgumentNullException">When <paramref name="reportPath"/> or <paramref name="module"/> is null.</exception>
		public static TextReader LoadReportFromFile(string reportPath, string reportResourceId, WebsitePanelModuleBase module)
		{
			if (String.IsNullOrEmpty(reportPath))
			{
				throw new ArgumentNullException("reportPath");
			}
			if (module == null)
			{
				throw new ArgumentNullException("module");
			}

			return new FileSystemReportLocalizer(
						  reportPath
						, reportResourceId
						, new WebsitePanelModuleResourceStorage(module)
					).GetLocalizedReportStream();
		}
Beispiel #5
0
        /// <summary>
        /// Load report from file on disk.
        /// </summary>
        /// <param name="reportPath">Path to the report file.</param>
        /// <param name="reportResourceId">Resource id of a report inside resource file.</param>
        /// <param name="module">Instance of a module containing the ReportViewer component.</param>
        /// <returns><see cref="TextReader"/> containing the localized report file.</returns>
        /// <exception cref="ArgumentNullException">When <paramref name="reportPath"/> or <paramref name="module"/> is null.</exception>
        public static TextReader LoadReportFromFile(string reportPath, string reportResourceId, WebsitePanelModuleBase module)
        {
            if (String.IsNullOrEmpty(reportPath))
            {
                throw new ArgumentNullException("reportPath");
            }
            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            return(new FileSystemReportLocalizer(
                       reportPath
                       , reportResourceId
                       , new WebsitePanelModuleResourceStorage(module)
                       ).GetLocalizedReportStream());
        }
Beispiel #6
0
        /// <summary>
        /// Loads embedded report file.
        /// </summary>
        /// <param name="assembly"><see cref="Assembly"/> containing the report file.</param>
        /// <param name="embeddedReportName">Name of the report in format {default namespace}.{folder structure inside assembly}.{file name with extension}</param>
        /// <param name="embeddedReportResourceId">Resource identifier of a report being loaded.</param>
        /// <param name="module">Instance of a module containing the ReportViewer component.</param>
        /// <returns><see cref="TextReader"/> containing the localized report file.</returns>
        /// <exception cref="ArgumentNullException">When <paramref name="assembly"/>, <paramref name="embeddedReportName"/> or <paramref name="module"/> is null.</exception>
        public static TextReader LoadReportFileFromAssembly(Assembly assembly, string embeddedReportName, string embeddedReportResourceId, WebsitePanelModuleBase module)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException("assembly");
            }
            if (String.IsNullOrEmpty(embeddedReportName))
            {
                throw new ArgumentNullException("embeddedReportName");
            }
            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            return(new EmbeddedReportLocalizer(
                       assembly
                       , embeddedReportName
                       , embeddedReportResourceId
                       , new WebsitePanelModuleResourceStorage(module)
                       ).GetLocalizedReportStream());
        }