为什么我的代码出现致命错误错误:未捕获异常'DOMPDF_Exception',消息'在cellmap中找不到框架 [英] Why is my code getting an error of Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Frame not found in cellmap
问题描述
当记录很多并且需要在pdf的第二页上打印时我遇到了这个错误
When the records are many and it needs to be print on second page of the pdf I have encounter this error
致命错误:强>未捕获的异常 'DOMPDF_Exception' 与消息 '框架在cellmap未发现' 在
C:\xampp\htdocs\pdf_dompdf\dompdf\include\cellmap.cls.php :244堆栈
迹:#0
C:\xampp\htdocs\pdf_dompdf\dompdf\include\table_cell_renderer.cls.php(50):
Cellmap-> get_spanned_cells(对象(Table_Cell_Frame_Decorator))#1
C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(287):
Table_Cell_Renderer->渲染(对象(Table_Cell_Frame_Decorator))#2
C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(107):
渲染 - > _ render_frame('表-cell',
Object(Table_Cell_Frame_Decorator))#3
C:\ xampp\htdocs \pdf_dompdf \\ dompdf\include\renderer.cls.php(190):
Renderer->渲染(对象(Table_Cell_Frame_Decorator))#4
C:\xampp\htdocs\pdf_dompdf\dompdf\\ \\include\renderer.cls.php(190):
Renderer->渲染(对象(Table_Row_Frame_Decorator))#5
C:\xampp\htdocs\pdf_dompdf\dompdf\include \renderer.cls.php(190):
Renderer->渲染(对象(Table_Row_Group_Frame_Decorator))#6
C:\xampp\htdocs\pdf_dompdf\dompdf\include\ renderer.cls.php(190):
Renderer->呈现
C:上线244 <\xampp\htdocs\pdf_dompdf\dompdf\include\cellmap.cls.php / p>
Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Frame not found in cellmap' in C:\xampp\htdocs\pdf_dompdf\dompdf\include\cellmap.cls.php:244 Stack trace: #0 C:\xampp\htdocs\pdf_dompdf\dompdf\include\table_cell_renderer.cls.php(50): Cellmap->get_spanned_cells(Object(Table_Cell_Frame_Decorator)) #1 C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(287): Table_Cell_Renderer->render(Object(Table_Cell_Frame_Decorator)) #2 C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(107): Renderer->_render_frame('table-cell', Object(Table_Cell_Frame_Decorator)) #3 C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(190): Renderer->render(Object(Table_Cell_Frame_Decorator)) #4 C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(190): Renderer->render(Object(Table_Row_Frame_Decorator)) #5 C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(190): Renderer->render(Object(Table_Row_Group_Frame_Decorator)) #6 C:\xampp\htdocs\pdf_dompdf\dompdf\include\renderer.cls.php(190): Renderer->render in C:\xampp\htdocs\pdf_dompdf\dompdf\include\cellmap.cls.php on line 244
<div class="ORMExSum">
<h1 align="center">ORM Executive Summary Report</h1>
<table cellpadding="0" cellspacing="0" border="1" width="100%">
<caption style="text-align:left; padding-bottom: 10px;">Keyword: <?php echo 'Juan dela Cruz, Juan Cruz'; ?></caption>
<thead class="theader">
<tr><th colspan="<?php echo 3+$rtweekly; ?>">Weekly Rankings</th></tr>
<tr>
<th width="10%">Location</th>
<th width="40%">Negative Snippet</th>
<th width="10%">Previous Ranking</th>
<?php while($rw1<$rtweekly): ?>
<th width="8%">
<?php echo date('M. d', strtotime (mysql_result($tweekly,$rw1,"WeeklyRank"))); $rw1++; ?>
</th>
<?php endwhile; ?>
</tr>
</thead>
<tbody>
<?php $x='a';while($rw2<$rsummary): $rw3 = 0;?>
<tr>
<td rowspan="<?php echo $cnt[$x]+1;$x++;?>">
<?php echo mysql_result($summary,$rw2,"Location"); ?>
</td>
<?php for ($i=0; $i < 2+$rtweekly; $i++): ?>
<td></td>
<?php $cnt++; endfor;?>
</tr>
<?php while($rw3<$rsnippet): $rw4 = 0;?>
<?php if(mysql_result($snippet,$rw3,"SummaryID") == mysql_result($summary,$rw2,"LocationID")): ?>
<tr>
<td style="font-size:11px;">
<?php echo mysql_result($snippet,$rw3,"NegativeSnippet"); ?>
</td>
<td>
<?php echo mysql_result($snippet,$rw3,"PreviousRank"); ?>
</td>
<?php while($rw4<$rtweekly): $rw5 = 0;?>
<td>
<?php while($rw5<$rweekly): ?>
<?php if(mysql_result($weekly,$rw5,"SummaryID") == mysql_result($summary,$rw2,"LocationID") && mysql_result($weekly,$rw5,"SnipPrevID") == mysql_result($snippet,$rw3,"NSPID") && mysql_result($tweekly,$rw4,"WeeklyRank") == mysql_result($weekly,$rw5,"WeeklyRank")): ?>
<?php echo mysql_result($weekly,$rw5,"Rank"); ?>
<?php endif;?>
<?php $rw5++; endwhile; ?>
</td>
<?php $rw4++; endwhile; ?>
<?php endif;?>
</tr>
<?php $rw3++; endwhile; ?>
<?php $rw2++; endwhile; ?>
</tbody>
</table>
</div>
推荐答案
我遇到了同样的问题。
I had the same issues.
我用X行修复它..强行打破页面。
I've fix it with X row.. force to break-page.
这只是因为pdf尝试输出很多行而他不能跳转到下一页。
it's just because the pdf try to output a lot of row and he can't jump to the next page.
在你的情况下,尝试放置:
In your case, try to place an :
page-break-after: always;
在第一个tr ..
<tbody>
<?php $x='a';while($rw2<$rsummary): $rw3 = 0;?>
<tr style="page-break-after: always;">
或者你可以在X行后制作一个php来做。
or you can make a php to do that after X line.
我希望这对某人有用。
祝你好运,
=====
编辑
=====
此外,删除边框折叠你的桌子。
Also, remove the "border-collapse" on your table.
这篇关于为什么我的代码出现致命错误错误:未捕获异常'DOMPDF_Exception',消息'在cellmap中找不到框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!