我正在使用PHPEXcel来编写数据。正确生成了Excel表格,但问题是当我试图打印所有页面但分成两页时意味着一半页面打印在一页纸张和另一半正在打印到另一张纸上。我需要打印纸张,应该与我的excel相同。
任何人都可以建议我如何让我的Excel工作表打印出单列切割单吗?
像这是我的示例代码。
$objPHPExcel->getActiveSheet()->mergeCElls('A1:H5');
$objPHPExcel->getActiveSheet()->mergeCElls('A6:A37');
$sheet->getSheetView()->setZoomScale(300);
$objPHPExcel->getActiveSheet()
->getColumnDimension( 'B' )->setWidth('6');
$objPHPExcel->getActiveSheet()
->getColumnDimension( 'C' )->setWidth('6');
$objPHPExcel->getActiveSheet()
->getColumnDimension( 'D' )->setWidth('11');
$objPHPExcel->getActiveSheet()
->getColumnDimension( 'E' )->setWidth('30');
$objPHPExcel->getActiveSheet()
->getColumnDimension( 'F' )->setWidth('14');
$objPHPExcel->getActiveSheet()
->getColumnDimension( 'G' )->setWidth('18');
$objPHPExcel->getActiveSheet()
->getColumnDimension( 'H' )->setWidth('25');
$objPHPExcel->getActiveSheet()
->getRowDimension( '6' )->setRowHeight('39.36');
$sheet->setCellValue('F6','Invoice');
$objPHPExcel->getActiveSheet()->getStyle('F6')->applyFromArray($font_style);
$objPHPExcel->getActiveSheet()->getStyle('F6')->applyFromArray($hstyle);
$objPHPExcel->getActiveSheet()->mergeCells("F6:H6");
$objPHPExcel->getActiveSheet()->getStyle('B6:H6')->applyFromArray($Border_Style);
$sheet->setCellValue('B8',$invoice_info['site_name']);
$objPHPExcel->getActiveSheet()->mergeCells("B8:E8");
$sheet->setCellValue('B9',$invoice_info['address1']);
$objPHPExcel->getActiveSheet()->mergeCells("B9:E9");
$sheet->setCellValue('B10',$invoice_info['address2']);
$objPHPExcel->getActiveSheet()->mergeCells("B10:E10");
$sheet->setCellValue('B11',$invoice_info['address3']);
$objPHPExcel->getActiveSheet()->mergeCells("B11:E11");
$objPHPExcel->getActiveSheet()->getStyle('B10:E11')
->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->getStyle('B7:E11')->applyFromArray($BStyle);