eramge11 Posted February 22, 2015 Share Posted February 22, 2015 I have a data textbox area that our employees type an incident report into. When we hit print, it generates a PDF report including other information and the text field (the report). The only problem is if the report is lenghty it will shift the entire text area to a seperate page leaving a good portion of the first page blank. I have attached a report showing what I'm talking about. Is this something that can be fixed by adding something to the code? I really would like to keep a portion of the narritave on one page and have it flow to the second page. ANYONE who can figure out a way to do this please let me know! StundentFinalView.pdf Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 22, 2015 Share Posted February 22, 2015 Where's the code to build the page? Quote Link to comment Share on other sites More sharing options...
eramge11 Posted February 26, 2015 Author Share Posted February 26, 2015 What do you need? The PHP side for the PDF generator or the PHP/HTML side that controls the text field boxes? Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted February 26, 2015 Share Posted February 26, 2015 We would need to see the code where it adds the report to the PDF file. Quote Link to comment Share on other sites More sharing options...
eramge11 Posted March 7, 2015 Author Share Posted March 7, 2015 Here is the code: <style> table{ display: table; border-collapse: collapse; border:1.5px solid #74b9f0; font-size: 12.5px; width:100%; } .no_border tr,td{ border:none; border:hidden; /* background:none; */ border:1.5px solid white; } table tr:nth-child(even) { /*(even) or (2n 0)*/ background: #f1f6ff; } table tr:nth-child(odd) { /*(odd) or (2n 1)*/ background: white; } th{text-align:left;font-weight:normal;color:#990a10;width:110px;border:0.4px solid #74b9f0;height:24px;} .title{color:black;} td{border:0.4px solid #74b9f0;height:24px;} .label{text-align:left;font-weight:normal;color:#990a10;width:110px;height:24px;} </style> <?php $StudentInfo = StudentInfo::model()->findByPk($student_transaction[0]->student_transaction_student_id); $AcademicTermPeriod = AcademicTermPeriod::model()->findByPk($student_transaction[0]->academic_term_period_id); $AcademicTerm = AcademicTerm::model()->findByPk($student_transaction[0]->academic_term_id); if($student_transaction[0]->student_transaction_nationality_id != null) $Nationality = Nationality::model()->findByPk($student_transaction[0]->student_transaction_nationality_id); else $Nationality = new Nationality; $Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id); $Course = Course::model()->findByPk($student_transaction[0]->course_id); if($student_transaction[0]->student_transaction_languages_known_id != null) $LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id); if($student_transaction[0]->student_transaction_student_address_id != null) $StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id); else $StudentAddress = new StudentAddress; if($student_transaction[0]->student_transaction_parent_id != null || $student_transaction[0]->student_transaction_parent_id != 0) $parent = ParentLogin::model()->findByPk($student_transaction[0]->student_transaction_parent_id); else $parent = new ParentLogin; ?> <h3 class="title">CALL RECORDS SUMMARY</h3> <table class="no_border"> </table> <h4 class="title">ADMINISTRATIVE</h4> <table> <tr> <td class="label">DATE</label></td><td><?php echo $StudentInfo->student_adm_date;?></td> <td class="label">DISPATCH TIME</label></td><td><?php echo $StudentInfo->student_guardian_qualification;?></td> </tr> <tr> <td class="label">ARRIVAL TIME</label></td><td><?php echo $StudentInfo->student_guardian_relation;?></td> <td class="label">CLEARANCE</label></td><td><?php echo $StudentInfo->student_guardian_occupation;?></td> </tr> <tr> </tr> </table> <h4 class="title">INCIDENT</h4> <table> <tr> <td class="label">TYPE OF INCIDENT</td><td><?php if($Nationality) echo $Nationality->nationality_name; else echo ""; ?> <td class="label">REPORT NUMBER</label></td><td><?php echo $StudentInfo->student_guardian_name;?></td> </tr> <tr> <td class="label">PRIMARY OFFICER</label></td><td><?php echo $StudentInfo->student_guardian_home_address;?></td> <td class="label">JUVENILE Y/N</td><td><?php echo $StudentInfo->emergency_cont_no;?></td> </tr> <!--tr> <!--td class="label">Semester</td><td><?php echo (empty($AcademicTerm->academic_term_name) ? "Not Set" : $AcademicTerm->academic_term_name);?></td> </tr--> </table> </br></br> <h4 class="title">INCIDENT ADDRESS</h4> <table> <tr> <td class="label">STREET</td><td colspan="3"><?php echo $StudentAddress->student_address_p_line1;?></td> <td class="label">APT/LOCATION</td><td colspan="3"><?php echo $StudentAddress->student_address_p_line2;?></td> </tr> <tr> <td class="label">CITY</td><td colspan="3"><?php echo $StudentAddress->student_p_house_no;?></td> <td class="label">ZIP CODE</td><td colspan="3"><?php echo $StudentAddress->student_address_p_pin;?></td> </tr> </table> <h4 class="title">REPORT COMPLAINANT</h4> <table> <tr> <td class="label">COMPLAINANT</td><td colspan="3"><?php echo $StudentAddress->student_c_house_no;?></td> <td class="label">PHONE NUMBER</td><td colspan="3"><?php echo $StudentAddress->student_address_c_phone;?></td> </tr> </table> <h4 class="title">REPORT NARRATIVE</h4> <table> <tr> <td colspan="3"><?php echo nl2br($StudentInfo->student_guardian_occupation_address);?></td> </tr> </table> </br></br> <?php echo "</br></br>"; ?> <h4 class="title">DOCUMENTS ATTACHED TO REPORT</h4> <?php $k=0; if ($student_docs != null){ ?> <table> <tr> <th> LOCAL NUMBER </th> <th> TITLE </th> <th> DOCUMENT CATEGORY </th> <th width="70px"> DESCRIPTION </th> <th> DATE SUBMITTED </th> </tr> <?php foreach($student_docs as $m=>$v) { $StudentDocs = StudentDocs::model()->findByPk($v['student_docs_trans_stud_docs_id']); ?> <tr> <td> <?php echo ++$k; ?> </td> <td> <?php echo $StudentDocs->title;?> </td> <td> <?php echo DocumentCategoryMaster::model()->findByPk($StudentDocs->doc_category_id)->doc_category_name; ?> </td> <td width="70px"> <?php echo $StudentDocs->student_docs_desc; ?> </td> <td> <?php $docdate = date_create($StudentDocs->student_docs_submit_date); echo date_format($docdate,'d-m-Y');?> </td> </tr> <?php }// end for loop ?> </table> <?php } else echo "NO DOCUMENTS AVAILABLE"; ?> Quote Link to comment Share on other sites More sharing options...
eramge11 Posted March 8, 2015 Author Share Posted March 8, 2015 Is the code above what was needed? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.