未找到Laravel DomPDF错误行

时间:2017-10-17 18:50:04

标签: php laravel-5 dompdf

使用DOMPDF生成pdf时出现此错误

  The row #2 could not be found, please file an issue in the tracker wit

我可以在我的视图页面中将输出视为html。但是,我没有生成上述错误。我有两个数组用于表格标题和结果。我的代码如下:

我的代码:

<table width="100%"  class="fullwidth border">
    <thead>
        <tr>
            <th width="10%"></th>
            <th width="10%"></th>
            @foreach($selected_fields_top as $key => $value)                       
                <th>{{ $value }}</th>
             @endforeach
        </tr>

    </thead>
    <tbody>
            <table >
                <tbody>
                    @foreach($selected_fields_left as $key => $value)                      
                        <tr><td><b>{{ $value }}</b></td>
                            <!-- <td> -->
                            @foreach($resultListLeft as $left_key => $valueArr) 
                                @foreach($valueArr as $k => $v)
                                       @if($v)
                                        <table>
                                            <tbody>
                                                <!-- <tr> -->
                                                    @if($valueArr[$value])
                                                    <td width="10%">{{$valueArr[$value]}}</td>
                                                    @else
                                                     <td width="10%">Data not available</td>
                                                    @endif
                                                    @foreach($resultListTop as $key => $TopvalueArr)
                                                        @if($key==$left_key)    
                                                        @foreach($TopvalueArr as $top_key => $top_value)
                                                               @if($top_value)
                                                                 <td width="10%">{{$top_value}}</td>
                                                                 @else
                                                                 <td width="10%">Data not available</td>
                                                                @endif
                                                        @endforeach
                                                        @endif
                                                    @endforeach 
                                                <!-- </tr> -->
                                            </tbody>
                                        </table>
                                        @endif
                                @endforeach
                            @endforeach
                        <!-- </td> -->
                    @endforeach
                    </tr>
                </tbody>
            </table>

我想打印输出,如: -

                                  Top heading1   Topheading2


 Left heading 1  Left value       Top value      Top value
                 Left value       Top value      Top value
                 Left value       Top value      Top value
                 etc...           etc...         etc...


 Left heading 2  Left value       Top value      Top value
                 Left value       Top value      Top value
                 Left value       Top value      Top value
                 etc...           etc...         etc...

1 个答案:

答案 0 :(得分:0)

首先,如果变量包含这样的行,你必须对变量进行var_dump。