代码拉取完成,页面将自动刷新
/**
* Copyright (c) 2017-2024 Nop Platform. All rights reserved.
* Author: canonical_entropy@163.com
* Blog: https://www.zhihu.com/people/canonical-entropy
* Gitee: https://gitee.com/canonical-entropy/nop-entropy
* Github: https://github.com/entropy-cloud/nop-entropy
*/
package io.nop.report.demo;
import io.nop.api.core.annotations.autotest.NopTestConfig;
import io.nop.autotest.junit.JunitBaseTestCase;
import io.nop.core.lang.eval.IEvalScope;
import io.nop.core.resource.IResource;
import io.nop.core.resource.tpl.ITemplateOutput;
import io.nop.core.resource.tpl.ITextTemplateOutput;
import io.nop.report.core.XptConstants;
import io.nop.report.core.engine.IReportEngine;
import io.nop.xlang.api.XLang;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import jakarta.inject.Inject;
@Disabled
@NopTestConfig(localDb = true)
public class TestReportSpeed extends JunitBaseTestCase {
@Inject
IReportEngine reportEngine;
@Test
public void testRenderHtml() {
String path = "/nop/report/demo/performance/测试同比环比.xpt.xlsx";
ITextTemplateOutput output = reportEngine.getHtmlRenderer(path);
IEvalScope scope = XLang.newEvalScope();
IResource resource = getTargetResource("/test-speed-result.xpt.html");
System.out.println("output path:" + resource.toFile());
for (int i = 0; i < 100; i++) {
System.out.println("i="+i);
output.generateToResource(resource, scope);
}
}
@Test
public void testRenderXlsx() {
// 生成的Excel中包含12000条结果记录。报表展开时执行大量分组、汇总、比较的计算。
String path = "/nop/report/demo/performance/测试同比环比.xpt.xlsx";
ITemplateOutput output = reportEngine.getRenderer(path, XptConstants.RENDER_TYPE_XLSX);
IEvalScope scope = XLang.newEvalScope();
IResource resource = getTargetResource("/test-speed-result.xlsx");
System.out.println("output path:" + resource.toFile());
for (int i = 0; i < 100; i++) {
output.generateToResource(resource, scope);
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。