Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Programatically Export Report
posted

Hi,

I am trying to programatically export a report based on the documentation.  The following code works when a connection string is set in my config file, but I'm wondering how I can set the connection string at run time (and set any report parameters) before calling export?

static void Main(string[] args)
        {
            var uri = new Uri("InfragisiticsReportingTrial.Reports;component/SalesReport.igr"UriKind.Relative);
            
            using (var exporter = ServerExporterFactory.CreateExporter(uri))
            {
                using (var fs = new System.IO.FileStream(@"c:\temp\igsalesreport.pdf"FileMode.Create))
                {
                    exporter.Export(fs, "PDF");
                }
            }
 
        }