Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NET 6.0/Creating Report at Runtime/Data/Demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"ContactTitle" : "Sales Representative",
"Address" : "Obere Str. 57",
"City" : "Berlin",
"Region" : null,
"Region" :null,
"PostalCode" : "12209",
"Country" : "Germany",
"Phone" : "030-0074321",
Expand Down
11 changes: 1 addition & 10 deletions NET 6.0/Creating Report at Runtime/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,62 +19,53 @@ 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";
headerText.HorAlignment = StiTextHorAlignment.Center;
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()}";
footerText.HorAlignment = StiTextHorAlignment.Right;
footerText.Name = "FooterText";
footerText.Brush = new StiSolidBrush(System.Drawing.Color.LightGreen);
footerBand.Components.Add(footerText);

report.ShowWithWpf();
}
}
Expand Down