授權

Evaluation Version Limitation

Aspose.Slides for JasperReports 的評估版(未指定授權)會匯出報表的每一頁,但會在每張投影片或頁面的中心加入評估水印,四種輸出格式(PPT、PPTX、PDF 與 HTML)皆如此,如下圖所示。詳情請參閱Evaluate Aspose.Slides。

The evaluation watermark at the center of an exported slide

Applying a License

有多種方式可套用授權,取決於您是使用 JasperReports 還是 JasperServer。

Applying a License for JasperReports

呼叫 License 類別的 setLicense 方法,傳入讀取授權檔的串流,如同 Aspose.Slides for Java:

import java.io.FileInputStream;

import com.aspose.slides.jasperreports.License;

public class ApplyLicense {
    public static void main(String[] args) {
        try {
            // 建立包含授權檔案的串流物件。
            FileInputStream fstream = new FileInputStream("Aspose.Slides.JasperReports.Developer.lic");

            // 實例化 License 類別。
            License license = new License();

            // 透過串流物件設定授權。
            license.setLicense(fstream);
        } catch (Exception ex) {
            System.out.println(ex.toString());
        }
    }
}

或者,將授權檔的路徑傳給匯出器的 ASExporterParameters.PPT_LICENSE 參數。在此範例中,jasperPrint 為已填寫的報表,參考Your first export:

ASPptExporter exporter = new ASPptExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "report.ppt");
exporter.setParameter(ASExporterParameters.PPT_LICENSE, "Aspose.Slides.JasperReports.Developer.lic");
exporter.exportReport();

Applying a License on JasperServer

在 applicationContext.xml 中將 pptExportParameters bean 的 licenseFile 屬性設為授權檔的路徑,如同Integration with JasperServer 所示。