Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    rhmnmbr83
    @rhmnmbr83
    guys how to break page?
    const doc = new jsPDF();
                    doc.text(7, 15, "Daftar SP2D dengan Status Sudah Cair");
                    doc.autoTable(this.getColumns(), datacair, {
                        startY: 20,
                        margin: { horizontal: 7 },
                        styles: { columnWidth: 'wrap' },
                        columnStyles: {
                            text: { columnWidth: 'auto' },
                            nil: { halign: 'right' },
                            tgl: { halign: 'right' }
                        },
                        headerStyles: { halign: 'center' },
                        theme: 'grid'
                    });
    
                    doc.text("Daftar SP2D dengan Status Proses Pencairan", 7, doc.autoTable.previous.finalY + 10);
    its typescript on angular
    brahimkraiem
    @brahimkraiem
    try to add
    overflow: 'linebreak',
    Mahesh Ruparel
    @maheshruparel
    With jsPDF-AutoTable, we can give custom styling to a specific column, but how can I give custom styling to header column of that specific column ? Is it possible ?
    pookdeveloper
    @pookdeveloper
    I can use this in node js?
    Josef Unger
    @Dshosev
    Hej, i got the following question, how can i achieve, that the linebreak in my body does not break in the words but after complete words? So that it is not breaking "Hello World" to "Hell" in one line and the next line "o World"? Thanks for your help guys! :)
    janardan
    @janardan96
    Hi i am using jspdf-autotable in my project. I don't know how to use colspan and rowspan in head section. I tried but it's not working properly for me.
    desertrose16
    @desertrose16
    Hi
    desertrose16
    @desertrose16
    Hi I am using jspdf-auto table. I have used it to generate table from mysql. The table has dates in first column which are displayed properly in the results in dev tools console but in the generated pdf it shows only years and those are also from 1990 to 2015, though i have data for only last two months. Dates have apparently been converted to years in some weird way. I have tried looking for it but it seems no one ever faced this problem before this.
    michaelcmelton
    @michaelcmelton
    Hello all, hopefully, someone can help. I'm using autotable to generate a pdf with a table that has styling applied to it through css. How do I persist that css to the autotable plugin?
    karthiktanj
    @karthiktanj
    hi
    I am new to the angular. Trying to add the header and footer in the Autotable . Anyone help me to add the header image and footer pagenumber. I saw the above email but i dont which code new to apply
    Amina Mahmoud
    @AminaMahmoud_gitlab
    hii i'm trying to write arabic data in pdf using jspdf auto table how to do it ?
    Shivashankarn26
    @Shivashankarn26
    Hi Simon, Thanks for the plugin, it works great with limited number of columns.
    Is there any way to overflow columns to next page after some number of columns? For example i have 15 columns and i want to show first 10 columns in first page and then remaining 5 columns in next page. If the rows are more than page size then the next set of rows should split in 3rd and 4th page and continues on.
    CRYZAL
    @midhulms

    how to change a background color of a row which contain a specific word please help i am beginner //alert("hai");
    var enhance = true;
    var currentRow;
    doc.autoTableSetDefaults({
    tableWidth: '160',
    theme:'striped',
    margin: {horizontal: 7},
    bodyStyles: {valign: 'top'},
    styles: {cellWidth: 'auto', overflow: 'linebreak',fillColor:[208,223,241]},
    columnWidth: 'auto',
    // showHeader: 'firstPage',
    font: "sans-serif",
    fontStyle: 'bold',
    headerStyles: {fillColor: [147,87,176],fontSize: 10, textColor: [249,249,249]}, // Purple
    margin: {top: 40},
    didParseCell: enhance ? enhanceWordBreak : null,

            addPageContent: function(data) 
            {
                // FOOTER
                var str = "Page " + doc.page;
                if (typeof doc.putTotalPages === 'function') {
                                        str = str + " of " + totalPagesExp;
                }
                var xOffset = (doc.internal.pageSize.width); 
                doc.setFontSize(8);
                doc.setFontStyle('normal');
                if(y=="l")
                doc.text(str,xOffset-120,120);
                else if(y=="p")
                doc.text(str,xOffset-120,120);
                                doc.text('Printed Date: '+today, 45,120);
                doc.page ++;
            }
        }); 
    } 
        var res = doc.autoTableHtmlToJson(document.getElementById(m));
                //console.log("res",res);
                var clength=res.columns.length;
        //console.log("columns.length:",clength);
                var fsize;
                if(clength>13)
                     {fsize=10;}
                else  if(clength>10) 
                     {fsize=10;}
                else  if(clength>7) 
                     {fsize=10;}
                else  if(clength<6) 
                     {fsize=10;}
                if(PdfType=='Flexible')
                     {fsize=7.5;}
              //  console.log("res.columns:", res.columns, "res.data:", res.data, res);
                doc.autoTable(res.columns, res.data, {margin: {top: vy+25},pageBreak: 'auto',styles: {cellPadding: 1.5,fontSize:fsize , },fontStyle: 'bold',drawRow: function (row, data) {
                currentRow = row;
                        currentRow.height =30;
                        var test1=String(currentRow.cells[1].raw);
                        if (test1 == "undefined")
                        {
                                  /* count++;
                                   if(count==1)
                                    {
                                      for(var i=0;i<res.columns.length;i++)
                                       {
                                         currentRow.cells[i].styles.fillColor = [255,227,185];
                                        }
                                     }
                                     if(count==2)
                                      {
                                        for(var i=0;i<res.columns.length;i++)
                                         {
                                            currentRow.cells[i].styles.fillColor = [255,193,160];
                                           } 
                                          count=0;
                                        }*/
    
                if((currentRow.cells[0].text[0].includes('Total')) || (currentRow.cells[0].text[0].includes('Average of'))||(currentRow.cells[0].text[0].includes('Minimum of'))||(currentRow.cells[0].text[0].includes('Maximum of'))||(currentRow.cells[0].text[0].includes('Count of')))
        {
                        for(var i=0;i<res.columns.length;i++)
                        {                  
                                doc.setFontSize(10);
                                doc.setFontStyle('bold');
                                doc.setTextColor(0, 0, 0);
                                doc.setFillColor(255,227,185);
                                doc.rect(data.settings.margin.left, row.y, data.table.width, row.height, 'F');
                                var dataval = ($.trim(currentRow.cells[0].raw.innerText).replace(/,/g, " "));

    //console.log("current text in if part ie sum of etc dataval: ", dataval, row.max

    @simonbengtsson please help
    CRYZAL
    @midhulms
    hello
    CRYZAL
    @midhulms

    here currentRow is row which given in auto table

    var res1 = doc.autoTableHtmlToJson(document.getElementById(m));
    var idmm=document.getElementById(n);

            var clength=res1.columns.length;
             var crow=res1.rows.length;
    
     doc.autoTable(res1.columns, res1.data, {margin: {top: vy+25},pageBreak: 'auto',styles: {cellPadding: 1.5,fontSize:fsize , },fontStyle: 'bold',drawRow: function (row, data) {
            currentRow1 = row;
                    currentRow1.height =30;

    if((currentRow1.cells[0].text[0].includes('Total')) || (currentRow1.cells[0].text[0].includes('Avg'))||(currentRow1.cells[0].text[0].includes('count'))||(currentRow1.cells[0].text[0].includes('Min'))||(currentRow1.cells[0].text[0].includes('Max')))

    { 1 for(var i=0;i<res1.columns.length;i++) {

                              currentRow1.cells[i].styles.fontStyle = "bold";
                              currentRow1.cells[i].styles.font = "sans-serif" ; 
                              currentRow1.cells[i].styles.fillColor = [243,205,204];                 
                              currentRow1.cells[1].styles.columnWidth="wrap";
                              currentRow1.cells[1].styles.FontSize=30;
    
                              }

    }

    },columnStyles: {0: {columnWidth: columnwidthrgroup},},});

    got it
    i just take all cell in that row thats easy
    CRYZAL
    @midhulms
    how to do row grouping with out group last 4 rows which shows total max avg but in my code group entire table include these rows .please help how to group only my datatable rows ?
    Dibakar
    @dibakargithub48
    Hi Simon, Is it possible to add bold and normal text in single cell using autotable?
    Mahmoud Alaskalany
    @mhmoudalaskalany

    hi people
    i have used jspdf to create table with dynamic columns

    some rows are split on 2 pages

    how to set page limit for this or how to solve it

    Ankit Jaishwal
    @jaishwal25_gitlab
    Hey, Can anyone tell me how can change style of a column depending upon the value of another column of the same row?
    Ivyrose Ruiz
    @spectraliruiz
    image.png
    Hi Simon, It is possible to add progresss/status bar in jspdf autotable ?
    Maxy74
    @Maxy74
    image.png
    Help me please, is it possible to remove this white space in the picture?
    Maxy74
    @Maxy74
    Hashim Sayyid
    @Sayyiditow
    hi guys.
    Wondering if the didDrawPage function can allow html content for the header, so I can pass some html formatted text in stead of image/ normal text. Is that even possible?
    Been doing the doc.html(HTMLElement) func but this needs you to handle the callback to get the pdf with the html, and it also only displays on the first page.
    Stevin
    @stvinz
    Hello, is this chat room active?
    Well, in any case, I was wondering if there is a good way to set columnwidth as percentage.
    simongbe
    @simongbe:matrix.org
    [m]
    @stvinz: You cannot specify the column width in percentage, but you should be able to calculate it yourself with the help of the page width