2016-12-24 15 views
0

"atom"という名前のReporticoプロジェクトと "Receipts"というレポートを作成し、ReportControllerでaction = receiptsを作成しました。 Thisは私が続くチュートリアルです:Reportico:yii2リンクを埋め込む方法は?

コントローラーコード:

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

私は私が得たそれをしようとすると、私のコードは

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

を開く必要があり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> 

を作成しました付属の写真のように

enter image description here

config.phpにパスワードを入力しても表示されません。define('SW_ADMIN_PASSWORD','1234');何も表示されません。

パスワードを入力する必要はありません。

と私は、基準入力モードでレポートを埋め込む必要があります。 enter image description here

答えて

0

関連アクションを設定すべきである可能性がありconfig.phpファイルからプロジェクト設定オプションを使用して空白にしてください。それを保持したい場合は(実行呼び出しの前に)コードに追加してください

$engine->initial_project_password = "1234";

第2に、私はあなたが空白になっているのを助けてくれないと思います。上記のオプションの1つを試して、パスワードプロンプトを消してから動作するかどうか確認してください。まだ空白がある場合は、ajax呼び出しを調べる必要があります。あなたのWebブラウザのデバッグネットワークタブにアクセスできず、何かを押すと、サーバーに送信されたリンクをメモし、応答を確認できますか?

+0

私はconfig.phpからそれを削除し、まだ私は空白のページを持っている!依然としてパスワードを要求しています。 –

+0

私は 'http://localhost/Atom/backend/web/index.php?r = reportico'を開くとパスワードが消えてしまいました。パスワードなしでダッシュボードを開きます。 –

+0

私は解決策を得ました:それはプロジェクトの設定でした..私はホスト名を追加するのを忘れました。またはIP。 –

0

あなたは

use yii\helpers\Url; 


echo '<a href="' . Url:to(['/report/receipts']) . 
       '" type="button" class="btn btn-block btn-default">Receipts</a>'; 
URLヘルパーを使用することができ、あなたが、その後パスワードを取り出し、パスワードの入力を要求したくない場合はまず

$engine->initial_report = Url:to(['/report/receipts']);  // Name of report to run 
+0

ええ、リンクは正常に動作しますが、ページは完全には機能しません。レポートは作成されましたが、リンクが動作していません。もっと写真を追加します。 –

+0

あなたのコメントをより良く説明してください。 "彼は私が仕事を作ったと言っていますが、リンクが動作していないとはどういう意味ですか?"関連するコードと適切な情報で質問を更新してください – scaisEdge

+0

Repoticoをインストールした後、ダッシュボードのようなものがあります。プロジェクトやレポートを作成してテストすることができます。プロジェクトやレポートを作成してダッシュボードでテストします。私が何をしたのかを報告している埋め込みレポートがあります。報告する埋め込みリンクがあります。これは私の問題です。何もありません。 –

関連する問題