【仅供内部供应商使用,不提供对外解答和培训】

Page tree

【仅供内部供应商使用,不提供对外解答和培训】

Skip to end of metadata
Go to start of metadata

同步视频地址(视频部分操作可能已经过时):

1、介绍FineReport V8.0插件开发的基础知识,包括搭建环境,构建插件,上传插件,合作开发代码等等

http://video.finereport.com/plugin/less1.mp4(右击“另存为”,可保存到本地)

2、如何编译、调试

http://video.finereport.com/plugin/less2.mp4 

了解FineReport插件

FineReport下载地址:http://www.finereport.com/products/trial

基本工具准备

工具名下载地址说明
JDKhttp://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html下载Windows或者Mac版
IntelliJ IDEAhttps://www.jetbrains.com/idea/download/可使用迅雷下载Windows或者Mac版
Anthttp://download.csdn.net/download/lablenet/8952705Windows和Mac下都是通用的
Tomcathttp://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.0.35/bin/apache-tomcat-8.0.35.zip可以自己下载,也可以使用start下的

Git

https://git-scm.com/

 

Windows上才需要下载,Mac系统自

带有Git,不需要下载安装

开发目录

假设我们在D:/develop/finereport目录下存储开发工程和代码,如果没有,则自己新建一个这样的目录(当然位置和名字随意),下面这个目录都以~/finereport表示。

克隆代码

名称地址说明
designhttps://git.oschina.net/fanruan/design.git
设计器的核心代码库,包含各个基本模块。(注意切换到8.0分支,master分支已经是9.0版本)
envhttps://git.oschina.net/fanruan/env.git
环境,该包下包含WebReport 目录。
libhttps://git.oschina.net/fanruan/lib.git
设计器依赖的各种java库。
pluginshttps://git.oschina.net/fanruan/plugins.git
内置了两个插件例子。(注意例子可能有报错,不影响启动)
projecthttps://git.oschina.net/fanruan/project.git整合模块的用于IntelliJ  IDEA工具的工程目录。
scriptshttps://git.oschina.net/fanruan/scripts.git内置插件商城脚本。
serverhttps://git.oschina.net/fanruan/server.git服务器模块,就是一个免安装的tomcat-8.0.33 服务器。

在进入~/finereport后,执行克隆命令

git clone https://git.oschina.net/fanruan/design.git

按照同样的方法,把其他几个子模块也克隆下来,全部完成之后,在文件夹中就是这样的:

切换开发分支

在帆软开发进入8、9两个版本并存的阶段中,使用代码构建传统的开发环境的开发者需要切换design的分支到8.0,进入~/finereport/design后,执行下面的命令

git checkout 8.0

打开工程

在克隆好代码后,打开已经安装好的IntelliJ IDEA,Open工程配置目录~/finereport/project即可

打开工程以后,就可以直接启动设计器了

启动项类别

在启动设计器的地方,我们可以看到有一个向下拉的三角,我们点开以后,可以看到三种启动方式

分别是:直接启动设计器(Designer),启动设计器界面调试(Designer4Debug),直接启动服务器(tomcat)。

其中直接启动设计器没什么好说的,就是常规的设计器启动主函数。

启动设计器界面调试时为了方便的根据设计器上的组件找到对应的代码,具体可参见这里

直接启动tomcat则用于真实的服务器环境调试。

注意: 设计器同时只能打开一个, 如果代码启动, 没看到设计器界面出来, 就退出了, 有可能是exe没关掉.

更新开发工程

因为源代码是跟随着帆软的开发,实时更新的,所以在插件开发的时候,也最好做到经常更新开发工程。

更新开发工程需要做两个事情,而且这两步总是需要同时进行的,否则会造成很多必要的麻烦。

更新源码

更新源码比较简单,进入~/finereport的子目录下,我们以design目录为例:

进入~/finereport/design目录,执行命令

git pull

即可更新最新的代码。

更新依赖jar包

同时,我们需要访问ftp服务器https://install-resources.fanruan.com/finereport/8.0/stable/finereport8.0_jar.zip中的jar包更新到~/finereport/lib/report中,需要更新的jar包括:

fr-core-8.0.jar

fr-chart-8.0.jar

fr-report-8.0.jar

fr-platform-8.0.jar

fr-performance-8.0.jar

fr-third-8.0.jar

切记注意,只需要更新这6个jar包,其他的任何包额外放入~/finereport/lib/report中可能引起开发工程启动异常。

  • No labels

27 Comments

  1. Anonymous

    大神,你好,我是静听禅鸣,在查看该文档的时候,发现了一处错误,

    原文是:直接启动tomcat则用于真是的服务器环境调试。

    改文是:直接启动tomcat则用于真实的服务器环境调试。

    改动原因:是真实而不是真是,谢谢大神的文档分享

     

  2. Anonymous

    你好,为什么会报在designer下面找不到stable的错呢,我看源码里也没有这个文件夹啊

    1. 依赖的fr-core.jar里的, 你没更新.

  3. Anonymous

    大神,lib切换成了dev切换不回来怎么办,它始终提示:

    Your local changes to the following files would be overwritten by checkout:
    report/fr-chart-8.0.jar
    report/fr-core-8.0.jar
    report/fr-performance-8.0.jar
    report/fr-platform-8.0.jar
    report/fr-report-8.0.jar
    Please, commit your changes or stash them before you can switch branches.
    Aborting

  4. Anonymous

    Please tell me who you are.

    Run

    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

    to set your account's default identity.
    Omit --global to set the identity only in this repository.

    fatal: unable to auto-detect email address (got 'unicom@unicom-PC.(none)')
    Cannot save the current index state

    unicom@unicom-PC MINGW32 /f/develop/finereport/lib (dev)
    $

    (手动捂额)

  5. Anonymous

    大神,我的分支切换过去切换不回来了怎么办啊,你说执行git stash,然后他就返回了我一堆这个:

    *** Please tell me who you are.

    Run

    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

    to set your account's default identity.
    Omit --global to set the identity only in this repository.

    fatal: unable to auto-detect email address (got 'unicom@unicom-PC.(none)')
    Cannot save the current index state

    1. Anonymous

      你git还没配置把

  6. Anonymous

    提个建议,那几个jar包要放到webroot\lib目录下,这个也应该写在教程里面吧

  7. Anonymous

    什么时候改用MAVEN啊

     

  8. 现在这份文档不能用了吗?为啥我安装上面的操作clone下来后,启动不了,各种jar缺失

    1. Anonymous

      加群帆软二次开发群432886175

      1. 禁止交流报表使用问题

        怎么回答?

      2. 禁止交流报表使用问题

  9. 文章最后处,有一个

    更新依赖jar包

    ftp服务器ftp://env.finedevelop.com/report/stable 现在这个网址已不能访问了,希望能改成正确的网址

  10. Anonymous

    按照步骤,在eclipse中搭建,成功启动设计器!

  11. Anonymous

    ftp服务器ftp://env.finedevelop.com/report/stable 现在这个网址已不能访问了

  12. 软件启动了,选择文件 和 新建报错

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at com.fr.design.parameter.ParameterDefinitePane.getPreferredSize(ParameterDefinitePane.java:176)
    at com.fr.design.gui.icontainer.UIModeControlContainer.<init>(UIModeControlContainer.java:52)
    at com.fr.design.mainframe.JWorkBook$1.<init>(JWorkBook.java:108)
    at com.fr.design.mainframe.JWorkBook.createCenterPane(JWorkBook.java:108)
    at com.fr.design.mainframe.JWorkBook.createCenterPane(JWorkBook.java:80)
    at com.fr.design.mainframe.JTemplate.<init>(JTemplate.java:102)
    at com.fr.design.mainframe.JTemplate.<init>(JTemplate.java:87)
    at com.fr.design.mainframe.JWorkBook.<init>(JWorkBook.java:91)
    at com.fr.start.Designer.createNewTemplate(Designer.java:347)
    at com.fr.design.mainframe.DesignerFrame.addAndActivateJTemplate(DesignerFrame.java:716)
    at com.fr.design.file.NewTemplatePane.mousePressed(NewTemplatePane.java:82)
    at java.awt.Component.processMouseEvent(Component.java:6530)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

    1. 不建议在8.0下开发插件

    2. 8.0产品本身已经停止维护啦

      1. 10.0开发的插件 8.0可以使用吗?

      2. 这个问题我已经解决了,可以新建项目了。

        1. Anonymous

          遇到了相同问题,请问你最后是怎么解决的呢?