Cloud
Cloud-Dienstleistung für schnelle und effektive Analyse und Visualisierung von Daten für Ihr Business ohne eigene Applikationen zu erstellen oder zu programmieren.
Adding Components from Code/Controllers/FormsController.cs shows the component hierarchy and the properties assigned to each new control:static FormsController()
{
}
[HttpPost]
public IActionResult Action()
{
try
{
var data = JObject.Parse(this.HttpContext.Request.Form["data"]);
var action = data["action"].ToString();
switch (action)
{
case "Initialize":
var initData = StiWebForm.Initialize(data, Initialize(data));
return Json(initData.Content);
default:
var result = StiWebForm.ProcessRequest(data);
return result.ContentType switch
{
"application/pdf" => new FileContentResult(result.Content as byte[], result.ContentType),
_ => Json(result.Content),
};
}
}
catch (Exception e)
{
return new ContentResult()
{
Content = e.Message,
ContentType = "text/plain"
};
}
}
private Hashtable Initialize(JObject data)
{
var form = new StiForm();
form.Load(@"Data\SoftwareEvaluationSurvey.mrt");
AddLogoAndCompanyName(form);
var options = new Hashtable
{
["form"] = Convert.ToBase64String(Encoding.UTF8.GetBytes(form.SaveToString()))
};
return options;
}
private void AddLogoAndCompanyName(StiForm form)
{
var image = new StiImageElement()
{
Geometry = new Stimulsoft.Form.Properties.StiRectangleGeometry(0, 0, 200, 100),
Image = System.IO.File.ReadAllBytes(@"Data\Logo.png")
};
var companyName = new StiLabelElement()
{
Geometry = new Stimulsoft.Form.Properties.StiRectangleGeometry(0, 20, 400, 70),
};
companyName.Text.Expression = "Company Name";
companyName.Text.Font = new System.Drawing.Font("Arial", 22);