FineReport 帆软报表

下载

安装

  • 除了安装位置外,其他选项默认即可
文件夹 说明
.install4j Java 程序安装工具文件夹
bin 可执行程序文件夹
iisFilter IIS 相关文件夹
jre JRE 文件夹
lib 库文件夹
logs 日志文件夹
plugins 插件文件夹
server 服务端:Tomcat 文件夹
uninstall.exe 卸载程序
webapps 部署在 Tomcat 上的应用:可直接将此文件夹复制到 任意 Tomcat 中部署

首次使用

  • 首次使用时,请在浏览器配置数据库
    • 初始化地址:http://localhost:8075/webroot/decision/login/initialization
      • 如果安装时,勾选了 演示产品,会自动打开此地址
    • 首先配置管理员账户与密码
    • 其次是配置数据库,个人开发使用推荐使用内置数据库
  • 首次打开帆软设计器时,需要登录账户才能使用
    • 推荐使用 手机号 + 短信验证码 登录
  • 未购买授权,仅支持 2 个并发

快速体验






全局匿名访问

  • 访问 http://localhost:8075/webroot/decision/

使用 数字签名认证 访问

  • 访问 http://localhost:8075/webroot/decision/

  • 创建 数字签名 Java 示例

    1. 依赖
     <dependencies>
    
    	<!-- https://mvnrepository.com/artifact/com.auth0/java-jwt -->
    	<dependency>
    		<groupId>com.auth0</groupId>
    		<artifactId>java-jwt</artifactId>
    		<version>4.5.0</version>
    	</dependency>
    
    	<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
    	<dependency>
    		<groupId>org.junit.jupiter</groupId>
    		<artifactId>junit-jupiter-api</artifactId>
    		<version>5.12.0</version>
    		<scope>test</scope>
    	</dependency>
     </dependencies>
    
    1. 代码
    package cn.com.xuxiaowei;
    
    import com.auth0.jwt.JWT;
    import com.auth0.jwt.algorithms.Algorithm;
    import org.junit.jupiter.api.Test;
    
    import java.time.Instant;
    import java.time.temporal.ChronoUnit;
    
    class DemoApplicationTests {
    
        @Test
        void contextLoads() {
            //数字签名有效时长
            long seconds = 60 * 60;
    
            // 数字签名内容,以访问资源的相对路径作为内容
            // 修改为需要进行数字签名认证的模板路径,相对路径,例如 doc/xx.cpt
            String path = "GettingStarted.cpt";
    
            // URL 模板
            String urlTemplate = "http://localhost:8075/webroot/decision/view/report?viewlet=%s&fine_digital_signature=%s";
    
            // 数字签名密钥,可以自定义
            String key = "1234567890123456";
            // 生成 fine_digital_signature
            String fineDigitalSignature = createJwt(null, null, path, seconds, key);
            // 输出 fine_digital_signature URL
            String url = String.format(urlTemplate, path, fineDigitalSignature);
            System.out.println(url);
        }
    
        /**
         * 生成 JWT
         *
         * @param jwtId   JWT ID,可以为空
         * @param issuer  JWT 颁发机构,可以为空
         * @param subject JWT 主题,可以为空
         * @param seconds 有效期,单位:秒
         * @param secret  数字签名密钥
         * @return 返回 String 类型 JWT
         */
        private static String createJwt(String jwtId, String issuer, String subject, long seconds, String secret) {
            // 创建 HMAC256 算法实例
            Algorithm algorithm = Algorithm.HMAC256(secret);
            // 创建一个新的JWT实例
            return JWT.create()
                    // 设置JWT的唯一标识符
                    .withJWTId(jwtId)
                    // 设置JWT的发行者
                    .withIssuer(issuer)
                    // 设置JWT的主题
                    .withSubject(subject)
                    // 设置JWT的签发时间,当前时间
                    .withIssuedAt(Instant.now())
                    // 设置JWT的过期时间,当前时间加上指定的秒数
                    .withExpiresAt(Instant.now().plus(seconds, ChronoUnit.SECONDS))
                    // 使用指定的算法对JWT进行签名,并返回签名后的JWT
                    .sign(algorithm);
    
        }
    
    }
    
  • 将生成的 URL 复制到浏览器中访问即可