DataTable export the pdf compressing the columns
DataTable export the pdf compressing the columns
allanguersoni
Posts: 4Questions: 0Answers: 0
I'm doing a report where I have about 140 columns and several rows.
In the CSV DataTable export properly in PDF already compress it the columns to fit the A4, already tried to make it just decrease the text or even break to the next page, but without success.
someone could help me? ;)
[code]
$monitorTable = $('#table').dataTable( {
"bProcessing": true,
"iDisplayLength": 50,
"bPaginate": true,
"bScrollCollapse": true,
"sScrollY": 250,
"sScrollX": "100%",
"bPaginate": true,
"bLengthChange": true,
"bFilter": true,
"bSort": false,
"bInfo": false,
"bAutoWidth": false,
// "aoColumnDefs":[
// { "sType":"title-numeric", "aTargets":[ 3 ] },
// { "sType":"title-numeric", "aTargets":[ 7 ] },
// { "bSortable":false, "aTargets":[ 0 ] },
// { "bSortable":false, "aTargets":[ 8 ] },
// { "bSortable":false, "aTargets":[ 9 ] },
// { "sClass":"center", "aTargets":[ 2, 3, 4, 5, 6, 7 ] }
// ],
//"aoColumns": [{ "sWidth": "5%" }, { "sWidth": "5%" }, { "sWidth": "5%" }, { "sWidth": "15%" }, { "sWidth": "10%" }],
"bServerSide": false,
//"sAjaxSource": 'ajax/arrays.txt',
"aaData": <?=json_encode($resultVolumes)?>,
"sDom": 'T<"clear">lfrtip',
"fnCalcColRatios": function ( oConfig )
{
var
aoCols = this.s.dt.aoColumns,
aColumnsInc = this._fnColumnTargets( oConfig.mColumns ),
aColWidths = [],
iWidth = 0, iTotal = 0, i, iLen;
for ( i=0, iLen=aColumnsInc.length ; i
In the CSV DataTable export properly in PDF already compress it the columns to fit the A4, already tried to make it just decrease the text or even break to the next page, but without success.
someone could help me? ;)
[code]
$monitorTable = $('#table').dataTable( {
"bProcessing": true,
"iDisplayLength": 50,
"bPaginate": true,
"bScrollCollapse": true,
"sScrollY": 250,
"sScrollX": "100%",
"bPaginate": true,
"bLengthChange": true,
"bFilter": true,
"bSort": false,
"bInfo": false,
"bAutoWidth": false,
// "aoColumnDefs":[
// { "sType":"title-numeric", "aTargets":[ 3 ] },
// { "sType":"title-numeric", "aTargets":[ 7 ] },
// { "bSortable":false, "aTargets":[ 0 ] },
// { "bSortable":false, "aTargets":[ 8 ] },
// { "bSortable":false, "aTargets":[ 9 ] },
// { "sClass":"center", "aTargets":[ 2, 3, 4, 5, 6, 7 ] }
// ],
//"aoColumns": [{ "sWidth": "5%" }, { "sWidth": "5%" }, { "sWidth": "5%" }, { "sWidth": "15%" }, { "sWidth": "10%" }],
"bServerSide": false,
//"sAjaxSource": 'ajax/arrays.txt',
"aaData": <?=json_encode($resultVolumes)?>,
"sDom": 'T<"clear">lfrtip',
"fnCalcColRatios": function ( oConfig )
{
var
aoCols = this.s.dt.aoColumns,
aColumnsInc = this._fnColumnTargets( oConfig.mColumns ),
aColWidths = [],
iWidth = 0, iTotal = 0, i, iLen;
for ( i=0, iLen=aColumnsInc.length ; i
This discussion has been closed.
Replies
http://www.yiigo.com/guides/csharp/how-to-process-pdf.shtml
I wonder if someone already succeeded in printing PDF dataTable with more than 100 columns.
By dataTable I added a custom button .
[code]
. DTTT_container {
border : 0px solid # 455 ;
width: auto ;
}
. DTTT_button {
margin- top: 7px ;
border : 0px solid # 465 ;
}
. DTTT_button_link {
width: 47px ;
height: 32px ;
display: block ;
border : 0px solid # 444 ;
background-color : transparent ;
background-image : url ( ' img / back -button- pdf.png ' ) ;
background-repeat : no-repeat ;
background-position : center center ;
float: left ;
text-align : center;
padding- top: 13px ;
margin- top: - 1px ;
cursor : pointer; cursor : hand ;
}
. DTTT_button_link : hover {
width: 47px ;
height: 32px ;
display: block ;
border : 0px solid # 444 ;
background-color : transparent ;
background-image : url ( ' img / button- back- pdf - hover.png ' ) ;
background-repeat : no-repeat ;
background-position : center center ;
float: left ;
text-align : center;
padding- top: 13px ;
margin- top: - 1px ;
}
TableTools.BUTTONS.gotoURL = {
" sAction " : "text " ,
" sFieldBoundary " : " " ,
" sFieldSeperator " : " \ t " ,
" sNewLine " : "
"
" sToolTip " : " " ,
" sButtonClass ": " DTTT_button_link "
" sButtonClassHover " : " " ,
" sButtonText " : "Go to URL " , / / default , change When initiating
" sGoToURL " : " " , / / default , change When initiating
" mColumns " : "all" ,
" bHeader " : true ,
" bFooter " : true ,
" fnMouseover " : null ,
" fnMouseout " : null ,
" fnClick " : function ( nButton , oConfig ) {
/ / location.href = oConfig.sGoToURL ;
location.href = oConfig.sGoToURL ;
/ / alert ( oConfig.sGoToURL ) ;
}
" fnSelect " : null ,
" fnComplete " : null ,
" fnInit " : null
} ;
$ (document ) . ready (function ( ) {
" oTableTools " : {
" sSwfPath " : " swf / copy_csv_xls_pdf.swf "
" aButtons " : [
{
" sExtends ": " gotoURL "
" sButtonText " , " PDF " ,
" sGoToURL " : " gerarPDF.php " , / / page in domPDF
}
"print "
" csv "
] ........
[/code ]
Could treat my columns in a personalized way.
Here i got a code for Pdf:
using System.IO;
using System.Drawing.Printing;
using RasterEdge.Imaging;
using RasterEdge.Imaging.Codec.Compression;
using RasterEdge.Imaging.PDF;
DocumentCompression.infile(@"C:\1.pdf");
DocumentCompression.Outfile(@"C:\2.pdf");
DocumentEncoder = DocumentEncoder.Group3Encoding
RasterEdgeImaging Document = new RasterEdgeDocumentg();
Image. DocumentCompression(@"C:\1.pdf", "C:\2.pdf", DocumentEncoder DocumentEncoder.Group3Encoding);
http://www.rasteredge.com/how-to/csharp-imaging/pdf-compressing/
You can have a try.