Example #1
0
        private void OnLoadTemplateClick(object sender, RoutedEventArgs e)
        {
            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            FileVersionInfo            fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);
            string version = fvi.FileVersion;


            var template = m_Reporter.Templater.LoadTemplate(TemplateSelection.SelectedValue.ToString());

            var sampleTbl  = SampleDataGenerator.GenerateSampleTable();
            var reportData = new SimpleReportData
            {
                TemplateData = template,
                ContentData  = new SimpleContentData
                {
                    ListOfTexts = new Dictionary <string, string> {
                        { "appVersion", version }
                    },
                    ListOfTables = new List <SimpleTableData>
                    {
                        new SimpleTableData
                        {
                            Table = sampleTbl,
                        },
                    },
                },
            };

            var printData = m_Reporter.CreateReport(reportData);

            m_ReportViewer.LoadReport(printData);
        }