【Stimulsoft Reports Flex教程】在Designer中编辑报表

下载Stimulsoft Reports Flex最新版本

要从代码创建和显示设计器,您需要调用StiDesignerFx.initialize() 静态方法。在应用程序的initialize事件中调用此方法:

<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    minWidth="1024" minHeight="768" backgroundColor="#e8e8e8"
    initialize="onInitialize()" xmlns:viewer="stimulsoft.viewer.*">
 
private function onInitialize(): void
{
    StiDesignerFx.initialize();
 
    ...
}

要在设计器中编辑报表,您需要加载报表文件,例如将其分配给 reportString变量。然后,您需要创建StiReport对象,并使用loadReportFromString()方法从此字符串加载一个变量的报表。完成这些操作后,您可以使用design()方法在设计器中编辑报表:

private function onDesignReportClick(): void
{
    // Create new report object
    var report: StiReport = new StiReport();
    // Load report from XML string
    report.loadReportFromString(reportString);
    // Design report in Designer
    report.design();
}

您还可以将报表设计器显示为对话框窗口。只需将design()方法更改为designDialog()方法,所有其他操作都是相同的:

private function onDesignInDialogWindowClick(): void
{
    // Create new report object
    var report: StiReport = new StiReport();
    // Load report from XML string
    report.loadReportFromString(reportString);
    // Design report in dialog window
    report.designDialog();
}

下面的屏幕截图中,您可以看到示例代码的结果。

Stimulsoft

下载示例

猜你喜欢

转载自blog.csdn.net/xiaochuachua/article/details/85229333
今日推荐