/// <summary>Fetches the contents of a report file.</summary>
        /// <param name="reportFile">The completed report file to download.</param>
        public void Run(File reportFile)
        {
            Console.WriteLine("=================================================================");
            Console.WriteLine("Retrieving and printing a report file for report with ID {0}", reportFile.ReportId);
            Console.WriteLine("The ID number of this report file is {0}", reportFile.Id);
            Console.WriteLine("=================================================================");

            string url = reportFile.Urls.ApiUrl;
            using (var stream = new MemoryStream())
            {
                new MediaDownloader(service).Download(url, stream);
                stream.Position = 0;

                StreamReader reader = new StreamReader(stream);
                string report = reader.ReadToEnd();
                Console.WriteLine(report);
            }
        }
Esempio n. 2
0
        /// <summary>Fetches the contents of a report file.</summary>
        /// <param name="reportFile">The completed report file to download.</param>
        public void Run(File reportFile)
        {
            Console.WriteLine("=================================================================");
            Console.WriteLine("Retrieving and printing a report file for report with ID {0}", reportFile.ReportId);
            Console.WriteLine("The ID number of this report file is {0}", reportFile.Id);
            Console.WriteLine("=================================================================");

            string url = reportFile.Urls.ApiUrl;

            using (var stream = new MemoryStream())
            {
                new MediaDownloader(service).Download(url, stream);
                stream.Position = 0;

                StreamReader reader = new StreamReader(stream);
                string       report = reader.ReadToEnd();
                Console.WriteLine(report);
            }
        }