public IActionResult GetReport(int id = 1) { // Create the report object var report = new StiReport(); // Load report switch (id) { // Load report snapshot case 1: report.LoadDocument(StiNetCoreHelper.MapPath(this, "Reports/SimpleList.mdc")); break; // Load report template case 2: report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt")); break; // Load compiled report class case 3: report = new StiMasterDetail(); break; // Load compiled report class case 4: report = new StiParametersSelectingCountryReport(); break; } // Load data from JSON file for report template if (!report.IsDocument) { var data = StiJsonToDataSetConverterV2.GetDataSetFromFile(StiNetCoreHelper.MapPath(this, "Data/Demo.json")); report.Dictionary.Databases.Clear(); report.RegData(data); } return(StiNetCoreViewer.GetReportResult(this, report)); }
private void ButtonJSON_Click(object sender, RoutedEventArgs e) { var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile(@"Data\Demo.json"); ShowReport(dataSet); }
private void buttonCreate_Click(object sender, EventArgs 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.Show(); }