sigedi/jasper-report-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sigedi/jasper-report-bundle

最新稳定版本:2.0.1

Composer 安装命令:

composer require sigedi/jasper-report-bundle

包简介

Symfony 6 / Symfony Flex Bundle integrating the Jaspersoft REST v2 client (jaspersoft/rest-client)

README 文档

README

Requirements

Packagist PHP Version Packagist Dependency Version

The JasperReportBundle requires jaspersoft/rest-client and provides an JasperReport-Client as service in the Symfony service container.

Installation
Basic Usage
Additional configuration options

Installation

1 Add bundle to composer.json:

    composer require sigedi/jasper_report_bundle

2 The Bundle will be registred automatically and by executing the recipe the configuration file jasper-report.yaml will be created in the config/packages directory and the corresponding entries in the .env file will be made

3 Change the standard setting in the file jasper-report.yaml

    sigedi_jasper_report:
        host:      'http://localhost:8080/jasperserver'
        username:  '%env(SIGEDI_JASPER_REPORT_USERNAME)%'
        password:  '%env(SIGEDI_JASPER_REPORT_PASSWORD)%'
        org_id:    '%env(SIGEDI_JASPER_REPORT_ORGID)%'

and in the .env file

SIGEDI_JASPER_REPORT_USERNAME=jasperadmin
SIGEDI_JASPER_REPORT_PASSWORD=jasperadmin
SIGEDI_JASPER_REPORT_ORGID=

Basic Usage in Symfony

The bundle supports autowiring, so you can access the report-service directly in your controller, e.g.

    use Symfony\Component\HttpFoundation\Request;
    use Sigedi\JasperReportBundleReportService;

    public function reportAction(Request $request, ReportService $reportService)
    {
        $report = $reportService->runReport('/reports/TestReport', 'pdf');

        $response = new Response($report);
        $response->headers->set('Content-type', 'application/pdf');
        $response->headers->set('Content-Disposition', 'inline; filename=Report.pdf');
        $response->headers->set('Cache-Control', 'must-revalidate');

        return $response;
    }

Additional Configuration Options

    sigedi_jasper_report:
        host:      'http://localhost:8080/jasperserver'
        username:  '%env(SIGEDI_JASPER_REPORT_USERNAME)%'
        password:  '%env(SIGEDI_JASPER_REPORT_PASSWORD)%'
        org_id:    '%env(SIGEDI_JASPER_REPORT_ORGID)%'
        timeout:   50

timeout: timeout for REST-request (in seconds)

统计信息

  • 总下载量: 10.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-16