Example #1
0
        private void ReportButtonClick(object sender, EventArgs e)
        {
            var report             = new Report();
            var piluleDataProvider = new FakeDataProvider();
            var piluleData         = piluleDataProvider.GetData(null);

            var applicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            var piluleDataPath      = Path.Combine(applicationDataPath, "Pilule");

            if (!Directory.Exists(piluleDataPath))
            {
                Directory.CreateDirectory(piluleDataPath);
            }

            var reportPath = Path.Combine(piluleDataPath, "PiluleReport.frx");

            if (!File.Exists(reportPath))
            {
                report.Save(reportPath);
            }

            report.Load(reportPath);
            report.RegisterData(piluleData, "PD");

            if (this.DesignModeCheckBox.Checked)
            {
                report.Design(false);
            }
            else
            {
                report.Show(false);
            }
        }