许可证

调用setLicense

将许可证下载到计算机并复制到适当的文件夹(例如应用程序文件夹或JasperReports\lib)。 将以下代码添加到您的项目:

import com.aspose.cells.jasperreports.*;

// Create a stream object containing the license file

FileInputStream fstream = new FileInputStream("C:\\Aspose.Cells.JasperReports.lic");

// Set the license through the stream object

License license = new License();

license.setLicense(fstream);

在applicationContext.xml中设置licenseFile导出器参数

  1. Download the license to your computer and copy it to the <InstallDir>\apache-tomcat\webapps\jasperserver\WEB-INF folder, where <InstallDir> stands for the JasperServer installation directory.
  2. Locate the <InstallDir>\apache-tomcat\webapps\jasperserver\WEB-INF\applicationContext.xml file and add the following lines:

XML

  <bean id="excelACExportParameters" class="com.aspose.cells.jasperreports.ACXlsExportParametersBean">

    <property name="licenseFile" value="C:/jasperserver-3.0/apache-tomcat/webapps/jasperserver/WEB-INF/Aspose.Cells.JasperReports.lic"/>

</bean>

验证许可证是否生效

将任何报表导出为XLS格式并检查报表是否包含评估消息。如果没有评估消息,则证书正常工作。

Aspose.Cells for JasperReports 在评估模式下注入评估工作表

todo:image_alt_text

当使用有效许可证时,没有评估工作表

todo:image_alt_text