【问题标题】:Laravel DomPDF error row not found未找到 Laravel DomPDF 错误行
【发布时间】:2017-10-19 14:46:59
【问题描述】:

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

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

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

我的代码:

<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...

【问题讨论】:

  • 请分享您的源代码。
  • 我能得到任何帮助吗..?
  • 在视图中能够看到表格中的页面。但是在生成 PDF td 时,tr 中断。没有占用我在 html 页面中给出的全部宽度。有什么想法可以分享请帮忙。 .谢谢

标签: php laravel-5 dompdf


【解决方案1】:

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

【讨论】:

  • 在视图中能够看到表格中的页面。但是在生成 PDF td 时,tr 中断。没有占用我在 html 页面中给出的全部宽度。有什么想法可以分享请帮忙。 .谢谢
  • 你用过文本标签吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-20
  • 1970-01-01
  • 2020-03-07
  • 1970-01-01
相关资源
最近更新 更多