public IActionResult GetReport(string reportPath, string dataKey = null) { if (!string.IsNullOrWhiteSpace(reportPath)) { EnsureAllowAccess(reportPath); var report = new StiReport(); string contentRootPath = _hostingEnvironment.ContentRootPath; Stimulsoft.Base.StiLicense.LoadFromFile(contentRootPath + "/Stimulsoft/license.key"); var fullReportPath = StiNetCoreHelper.MapPath(this, reportPath); report.Load(fullReportPath); // report.Dictionary.Variables["OrganizationName"].Value = "AwroNore"; // report.Dictionary.Variables["OrganizationLogo"].Value = $"{Request.Scheme}://{Request.Host}{""}"; if (!string.IsNullOrWhiteSpace(dataKey)) { var reportDatasource = _context.HttpContext.Session.Get <List <ReportDatasourceModel> >(dataKey); foreach (var item in reportDatasource) { report.RegData(item.Name, item.Name, item.Value); } report.Render(); } return(StiNetCoreViewer.GetReportResult(this, report)); } else { //Raise error path is empty; return(null); } }
public IActionResult GetReport() { // Loading the report template var reportPath = StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt"); var report = new StiReport(); report.Load(reportPath); // Deleting connections in the report template report.Dictionary.Databases.Clear(); // Loading data from the XML file var dataPath = StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml"); var data = new DataSet(); data.ReadXml(dataPath); // Registering data in the report report.RegData(data); // Syncing the data structure, if required //report.Dictionary.Synchronize(); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport(string id) { // Create the report object StiReport 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 report snapshot default: report.LoadDocument(StiNetCoreHelper.MapPath(this, "Reports/SimpleList.mdc")); break; } // Load data from XML file for report template if (!report.IsDocument) { DataSet data = new DataSet("Demo"); data.ReadXml(StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml")); report.RegData(data); } return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport(int id = 1) { // Create the report object StiReport report = new StiReport(); switch (id) { // Dynamic sorting case 1: report.Load(StiNetCoreHelper.MapPath(this, "Reports/Sorting.mrt")); break; // Drill down case 2: report.Load(StiNetCoreHelper.MapPath(this, "Reports/ListOfProducts.mrt")); break; // Collapsing case 3: report.Load(StiNetCoreHelper.MapPath(this, "Reports/GroupWithCollapsing.mrt")); break; // Bookmarks case 4: report.Load(StiNetCoreHelper.MapPath(this, "Reports/ParametersSelectingCountry.mrt")); break; // Parameters case 5: report.Load(StiNetCoreHelper.MapPath(this, "Reports/InteractiveCharts.mrt")); break; } return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { StiReport report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "reports/13contest.mrt")); return(StiNetCoreViewer.GetReportResult(this, report)); }
public ActionResult GetReport() { // Cria o relatório StiReport report = new StiReport(); // Carrega o arquivo de relatório da pasta Reports do projeto report.Load(StiNetCoreHelper.MapPath(this, "Reports/relatorio_dados.mrt")); // Criar DataSet com o mesmo nome usado no editor de relatórios DataSet dataSet = new DataSet("dataSet"); // Criar DataTable com o mesmo nome usado para o DataSource // no editor de relatórios DataTable dataTable = new DataTable("Gastos"); // Instrução sql que retorna os dados // com formatação para Data e Moeda string sql = @"select CONVERT(VARCHAR(10),Data,103) as Data ,Area ,FORMAT(VALOR, 'c', 'pt-BR') as Valor from Gastos"; // Preenchendo o DataTable com os dados // trazidos do banco de dados Sql Server dataTable = data.retornaDataTable <SqlConnection>(sql); // Adicionando o DataTable ao DataSet dataSet.Tables.Add(dataTable); // Adicionando o DataSet ao relatório // Informando nome e alias report.RegData("dataSet", "dataSet", dataSet); // retorna o relatório com dados para o Visualizador return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport(string id) { // Create the report object and load data from xml file var report = new StiReport(); // Load report from MDZ document file // If not found - load from MRT template switch (id) { // Interactive Reports case "DrillDownSorting": // Parameters case "ParametersDetailedCategories": case "ParametersDetailedOrders": case "ParametersHighlightCondition": case "ParametersSelectingCountry": case "ParametersInvoice": // {Today} function is used case "MultiColumnListContainers": var data = new DataSet("Demo"); data.ReadXml(StiNetCoreHelper.MapPath(this, "Data/Demo.xml")); report.Load(StiNetCoreHelper.MapPath(this, "ReportTemplates/" + id + ".mrt")); report.RegData(data); break; default: report.LoadPackedDocument(StiNetCoreHelper.MapPath(this, "ReportSnapshots/" + id + ".mdz")); break; } return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { StiReport report = new StiReport(); report.LoadDocument(StiNetCoreHelper.MapPath(this, "Reports/SimpleList.mdc")); return StiNetCoreViewer.GetReportResult(this, report); }
public IActionResult PrintB() { StiReport sti = new StiReport(); sti.Load(StiNetCoreHelper.MapPath(this, "wwwroot/Report/address.mrt")); //var ppp = _context.Factor1 // .Include(f => f.IdfactorstateNavigation) // .Include(a => a.IdproductaddressNavigation) // .FirstAsync(); var addres = _context.Productaddresses.ToList(); sti.Dictionary.Variables["variableName"].Value = "Yar"; var report = StiReport.CreateNewReport(); var path = StiNetCoreHelper.MapPath(this, "wwwroot/Report/address.mr"); report.Load(path); return(StiNetCoreReportResponse.ResponseAsPdf(report)); //sti.RegData("st", addres); return(StiNetCoreViewer.GetReportResult(this, sti)); }
public IActionResult GetReport(string id) { var report = StiReport.CreateNewDashboard(); report.Load(StiNetCoreHelper.MapPath(this, "/Dashboards/" + id + ".mrt")); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport(string id) { var report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, $"Dashboards/{id}.mrt")); return(StiNetCoreViewer.GetReportResult(this, report)); }
private StiReport LoadReport() { StiReport report = new StiReport(); StiNetCoreViewer.GetReportResult(this, report); return(report); }
public IActionResult GetReport() { // Create the report object var report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt")); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { // You can use report string or path to report template MRT file or document MDC file string reportString = System.IO.File.ReadAllText(_hostEnvironment.WebRootPath + "\\reports\\SimpleList.mrt"); return(StiNetCoreViewer.GetReportResult(this, reportString)); //return StiNetCoreViewer.GetReportResult(this, _hostEnvironment.WebRootPath + "\\reports\\SimpleList.mrt"); }
public IActionResult GetReport(string id = "SimpleList") { // Create the report object var report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "/Reports/" + id + ".mrt")); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReportIEnumerable() { StiReport report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "Reports/BusinessObjects_IEnumerable.mrt")); report.RegData("EmployeeIEnumerable", CreateBusinessObjectsIEnumerable.GetEmployees()); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { var report = new StiReport(); var path = StiNetCoreHelper.MapPath(this, "Reports/Report.mrt"); report.Load(path); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReportITypedList() { var report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "Reports/BusinessObjects_ITypedList.mrt")); report.RegData("EmployeeITypedList", CreateBusinessObjectsITypedList.GetEmployees()); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { StiReport report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "Reports/payments-preset.mrt")); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult PrintPerople() { StiReport report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "wwwroot/Reports/Report2.mrt")); var persons = _context.GetDatas.First(); report.RegData("dt", persons); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { // Create the report object var report = new StiReport(); // Load report snapshot report.LoadDocument(StiNetCoreHelper.MapPath(this, "Reports/SimpleList.mdc")); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReportIEnumerableBO() { var report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "Reports/BusinessObjects_IEnumerable_BO.mrt")); report.RegBusinessObject("EmployeeIEnumerable", CreateBusinessObjectsIEnumerable.GetEmployees()); report.Dictionary.SynchronizeBusinessObjects(2); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { getsession(); var report = new StiReport(); var path = StiNetCoreHelper.MapPath(this, "Reports\\Report_Drowmoney.mrt"); report.Load(path); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport(string id) { // Create the report object var report = new StiReport(); // Load dashboard template report.Load(StiNetCoreHelper.MapPath(this, "Dashboards/DashboardChristmas.mrt")); // Return template to the Viewer return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult Print() { StiReport rep = new StiReport(); var id = HttpContext.Session.GetString("idfactor"); rep.Load(StiNetCoreHelper.MapPath(this, "wwwroot/Report/ReportTest.mrt")); rep["@id"] = Guid.Parse(id); return(StiNetCoreViewer.GetReportResult(this, rep)); }
public async Task <IActionResult> GetReport() { var type = TempData["type"]; var report = new StiReport(); if (type.Equals("CMR")) { ApplicationConfigurationViewModel appConfig = null; appConfig = await appConfigRepo.GetAppConfigByName("MRXPassword", "Y"); if (appConfig != null && appConfig.AppConfigValue != null) { var path = Path.Combine(_hostingEnvironment.WebRootPath, "reports/EquipmentConditionMonitoring.mrx"); report.LoadEncryptedReport(path, appConfig.AppConfigValue); } else { throw new CustomException("Unable to Load Data, Please Contact Support!!!, Please provide a valid password to read the Report Template.", "Error", true, "Unable to Load Data, Please Contact Support!!!, Please provide a valid password to read the Report Template."); } } else if (type.Equals("SR")) { ApplicationConfigurationViewModel appConfig = null; appConfig = await appConfigRepo.GetAppConfigByName("MRXPassword", "Y"); if (appConfig != null && appConfig.AppConfigValue != null) { var path = Path.Combine(_hostingEnvironment.WebRootPath, "reports/SummaryReport.mrx"); report.LoadEncryptedReport(path, appConfig.AppConfigValue); } else { throw new CustomException("Unable to Load Data, Please Contact Support!!!, Please provide a valid password to read the Report Template.", "Error", true, "Unable to Load Data, Please Contact Support!!!, Please provide a valid password to read the Report Template."); } } string newConnectionString = Configuration.GetConnectionString("SKF.Master"); report.Dictionary.Databases.Clear(); report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("C2Maintenance", newConnectionString)); if (type.Equals("CMR")) { report.Dictionary.Variables["@JobEquipmentId"].ValueObject = TempData["jeId"]; } else if (type.Equals("SR")) { report.Dictionary.Variables["@JobId"].ValueObject = TempData["jId"]; report.Dictionary.Variables["@ClientSiteId"].ValueObject = TempData["cId"]; } report.Dictionary.Variables["@LanguageId"].ValueObject = TempData["lId"]; return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport(string id = "DashboardChristmas") { // Create the dashboard object var report = StiReport.CreateNewDashboard(); // Load dashboard template report.Load(StiNetCoreHelper.MapPath(this, $"Dashboards/{id}.mrt")); // Return template to the Viewer return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { string reportString = System.IO.File.ReadAllText(_hostEnvironment.WebRootPath + "\\reports\\ParametersSelectingCountry.mrt"); // The parameter name must match the variable name in the report var reportParameters = new Hashtable(); reportParameters["AllCountries"] = false; reportParameters["SelectedCountry"] = "USA"; return(StiNetCoreViewer.GetReportResult(this, reportString, reportParameters)); }
// --- private IActionResult GetReportResult() { var dataSet = new DataSet(); dataSet.ReadXml(StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml")); var report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt")); report.RegData(dataSet); return(StiNetCoreViewer.GetReportResult(this, report)); }
public IActionResult GetReport() { // Create the report object StiReport report = new StiReport(); report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt")); // Load data from XML file for report template DataSet data = new DataSet("Demo"); data.ReadXml(StiNetCoreHelper.MapPath(this, "Reports/Data/Demo.xml")); report.RegData(data); return(StiNetCoreViewer.GetReportResult(this, report)); }