Cloud
Облачный сервис для быстрого и эффективного анализа и визуализации данных для вашего бизнеса без необходимости создания своих приложений и программирования.
private void buttonExport_Click(object sender, EventArgs e)
{
var report = new StiReport();
report.Load(@"Reports\TwoSimpleLists.mrt");
report.Render();
...
...
var stream = new MemoryStream();
switch (comboBoxFormat.Text)
{
case "PDF":
report.ExportDocument(StiExportFormat.Pdf, stream);
saveFileDialog.DefaultExt = ".pdf";
break;
case "Word":
report.ExportDocument(StiExportFormat.Word2007, stream);
saveFileDialog.DefaultExt = ".docx";
break;
case "Excel":
report.ExportDocument(StiExportFormat.Excel2007, stream);
saveFileDialog.DefaultExt = ".xlsx";
break;
case "Text":
report.ExportDocument(StiExportFormat.Text, stream);
saveFileDialog.DefaultExt = ".txt";
break;
case "Image":
report.ExportDocument(StiExportFormat.ImagePng, stream);
saveFileDialog.DefaultExt = ".png";
break;
}
saveFileDialog.FileName = report.ReportName;
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
// Save to Local Storage
using (var fileStream = File.Create(saveFileDialog.FileName))
{
stream.Seek(0, SeekOrigin.Begin);
stream.CopyTo(fileStream);
}
}
MessageBox.Show("The export action is complete.", "Export Report");