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.
private StiReport Report = new StiReport();
protected override async Task OnInitializedAsync()
{
var reportStream = await FileSystem.OpenAppPackageFileAsync("SimpleList.mrt");
Report.Load(reportStream);
}private async Task ExportDocument(StiExportFormat format, string fileName, bool shareFile = false)
{
await Task.Run(() => Report.Render());
var filePath = Path.Combine(FileSystem.Current.CacheDirectory, fileName);
using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
{
Report.ExportDocument(StiExportFormat.Pdf, fileStream);
}
if (shareFile)
{
var file = new ShareFile(filePath);
await Share.Default.RequestAsync(new ShareFileRequest(fileName, file));
}
else
{
var file = new ReadOnlyFile(filePath);
await Launcher.OpenAsync(new OpenFileRequest(filePath, file));
}
}FileSystem.OpenAppPackageFileAsync reads the template shipped with the app, Report.Render() builds the document, and Report.ExportDocument writes it to the device. The rendered file is then opened with Launcher or handed to Share.Default for the platform share sheet.