diff --git a/NET 6.0/Creating Report at Runtime/Data/Demo.json b/NET 6.0/Creating Report at Runtime/Data/Demo.json index 5098d2b..46a954f 100644 --- a/NET 6.0/Creating Report at Runtime/Data/Demo.json +++ b/NET 6.0/Creating Report at Runtime/Data/Demo.json @@ -48,7 +48,7 @@ "ContactTitle" : "Sales Representative", "Address" : "Obere Str. 57", "City" : "Berlin", - "Region" : null, + "Region" :null, "PostalCode" : "12209", "Country" : "Germany", "Phone" : "030-0074321", diff --git a/NET 6.0/Creating Report at Runtime/MainWindow.xaml.cs b/NET 6.0/Creating Report at Runtime/MainWindow.xaml.cs index aeacebb..758bea9 100644 --- a/NET 6.0/Creating Report at Runtime/MainWindow.xaml.cs +++ b/NET 6.0/Creating Report at Runtime/MainWindow.xaml.cs @@ -19,27 +19,23 @@ public MainWindow() //Stimulsoft.Base.StiLicense.LoadFromStream(stream); InitializeComponent(); + } private void Button_Click(object sender, RoutedEventArgs e) { var report = new StiReport(); - // Add data to datastore var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile(@"Data\Demo.json"); report.RegData(dataSet); - // Fill dictionary report.Dictionary.Synchronize(); - var page = report.Pages[0]; - // Create HeaderBand var headerBand = new StiHeaderBand(); headerBand.Height = 0.5; headerBand.Name = "HeaderBand"; page.Components.Add(headerBand); - // Create text on header var headerText = new StiText(new RectangleD(0, 0, 5, 0.5)); headerText.Text = "CompanyName"; @@ -47,26 +43,22 @@ private void Button_Click(object sender, RoutedEventArgs e) headerText.Name = "HeaderText"; headerText.Brush = new StiSolidBrush(System.Drawing.Color.LightGreen); headerBand.Components.Add(headerText); - // Create Databand var dataBand = new StiDataBand(); dataBand.DataSourceName = "Customers"; dataBand.Height = 0.5; dataBand.Name = "DataBand"; page.Components.Add(dataBand); - // Create text var dataText = new StiText(new RectangleD(0, 0, 5, 0.5)); dataText.Text = "{Line}.{Customers.CompanyName}"; dataText.Name = "DataText"; dataBand.Components.Add(dataText); - // Create FooterBand var footerBand = new StiFooterBand(); footerBand.Height = 0.5; footerBand.Name = "FooterBand"; page.Components.Add(footerBand); - // Create text on footer var footerText = new StiText(new RectangleD(0, 0, 5, 0.5)); footerText.Text = "Count - {Count()}"; @@ -74,7 +66,6 @@ private void Button_Click(object sender, RoutedEventArgs e) footerText.Name = "FooterText"; footerText.Brush = new StiSolidBrush(System.Drawing.Color.LightGreen); footerBand.Components.Add(footerText); - report.ShowWithWpf(); } }