此示例项目显示如何在查看器窗口中编辑呈现的报表的文本单元格。要启用此功能,您需要在报表模板中将所需的文本字段标记为可编辑。其他一切都将自动完成。显示报表时,要进行编辑,应单击查看器工具栏上的“Edit ”按钮:
public MainPage()
{
InitializeComponent();
// Custom Color
Stimulsoft.Report.StiOptions.Viewer.HighlightShowBorderColor = Colors.Orange;
Stimulsoft.Report.StiOptions.Viewer.HighlightActiveBorderColor = Colors.Green;
var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(
"EditableReport.EditableReport.mdc");
if (stream != null)
{
Stimulsoft.Report.StiReport report = new Stimulsoft.Report.StiReport();
report.LoadDocument(stream);
stream.Close();
stream.Dispose();
stream = null;
viewer.Report = report;
}
}
下面的屏幕截图中,您可以看到示例代码的结果。