Reportico : yii2 如何嵌入链接? [英] Reportico : yii2 How to embed Links?

查看:21
本文介绍了Reportico : yii2 如何嵌入链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为atom"的 Reportico 项目和一个名为Receipts"的报告,然后我在 ReportController 中创建了 action=receipts.

当我在 config.php 中输入密码时 define('SW_ADMIN_PASSWORD','1234'); 什么也没显示.

我不需要强迫用户输入密码!

并且我需要在 Criteria Entry Mode 中嵌入报告.

解决方案

首先如果不想提示输入密码,则从 config.php 文件中取出密码或者使用项目配置选项将其清空.如果你想保留它然后添加到代码中(在执行调用之前)

$engine->initial_project_password = "1234";

其次,我认为这无济于事,因为您看到的是空白...您可以尝试上述选项之一来摆脱密码提示,然后看看它是否有效.如果您仍然得到空白,那么我们需要调查 ajax 调用.您是否无法进入您的 Web 浏览器调试网络选项卡并在按下某些按钮时,注意发送到服务器的链接并查看响应?

I have created a Reportico Project named "atom" and a Report called "Receipts" and then I created action=receipts in ReportController. This is the tutorial I followed:

Controller code :

public function actionReceipts()
{
  return $this->render('receipts');
}

I created receipts.php

<?php

use yii\helpers\Html;
use yii\helpers\Url;

$this->title = Yii::t('app', 'Reports');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="report-index">



<div class="container">
<div class="row">
     <div class="col-sm-1">
     </div>
    <div class="col-sm-11">


     <?php 
       $reportico = \Yii::$app->getModule('reportico');
    $engine = $reportico->getReporticoEngine();        // Fetches reportico engine
    $engine->access_mode = "ONEREPORT";                // Allows access to single specified report
    $engine->initial_execute_mode = "PREPARE";         // Starts user in report criteria selection mode
    $engine->initial_project = "atom";            // Name of report project folder
    $engine->initial_report = "receipts";           // Name of report to run
    $engine->bootstrap_styles = "3";                   // Set to "3" for bootstrap v3, "2" for V2 or false for no bootstrap
    $engine->force_reportico_mini_maintains = true;    // Often required
    $engine->bootstrap_preloaded = true;               // true if you dont need Reportico to load its own bootstrap
    $engine->clear_reportico_session = true;           // Normally required
    $engine->execute();  
    ?>
    </div>

</div>

</div>
</div>

my code should open

http://localhost/Atom/backend/web/index.php?r=report%2Freceipts 

when i try it i got like the pic i attached

when i type the password that in config.php define('SW_ADMIN_PASSWORD','1234'); nothing showing .

i don't need to force user to type a password !

and i need to embed the report in Criteria Entry Mode .

解决方案

Firstly if you dont want to prompt for a password, then take out the password from the config.php file or use the project configuration option to blank it.If you want to keep it then add into the code (before the execute call)

$engine->initial_project_password = "1234";

Secondly i think this wont help as you are seeing blank... can you try one of the above options to get rid of the password prompt and then see if it works. If you still get blanks then we need to investigate the ajax calls. Are yo unable to go into your web browser debug network tab and on pressing something, note the link sent to server and see response?

这篇关于Reportico : yii2 如何嵌入链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆