jquery-table2excel icon indicating copy to clipboard operation
jquery-table2excel copied to clipboard

exclude_img: true — not working

Open AliveDD opened this issue 9 years ago • 17 comments

i use t2e with this settings:

    $("#restaurant_stat").table2excel({
        exclude: ".noExl",
        name: "SmartReserve",
        filename: xlsFilename,
        fileext: ".xls",
        exclude_img: true,
        exclude_links: true,
        exclude_inputs: true
    });

but image boxes are included:

screen shot 2016-06-29 at 12 14 17

whats wrong?

AliveDD avatar Jun 29 '16 09:06 AliveDD

i dont know how it resolve, i make some duct tape make shadow div, for temp table content

screen shot 2016-06-30 at 15 37 11

AliveDD avatar Jun 30 '16 12:06 AliveDD

If you can provide a jsFiddle example or such, I could check it out. Without seeing your markup, I can't really say what might be happening.

rainabba avatar Jun 30 '16 22:06 rainabba

im try today

AliveDD avatar Jul 04 '16 09:07 AliveDD

JSFIDDLE link

fileext, exclude_img, exclude_links — Not working

screen shot 2016-07-04 at 15 02 46

AliveDD avatar Jul 04 '16 12:07 AliveDD

fileext not work, but im rename extension manually to .xls for test

AliveDD avatar Jul 04 '16 12:07 AliveDD

try js file from dist instead of src. src does not include the exclude img functionality.

ubeyou avatar Aug 15 '16 05:08 ubeyou

dist file dont help us im edit /demo file, and include input, link, and img Exporting don't remove this

html: screen shot 2016-08-15 at 12 40 49

xls: screen shot 2016-08-15 at 12 41 25

AliveDD avatar Aug 15 '16 09:08 AliveDD

Sorry, this is the dist file you need. https://github.com/rainabba/jquery-table2excel/blob/8bbfca41abf4457200bca96134d8b756d3d56837/dist/jquery.table2excel.js

Apparently the latest commit removed the exclude feature.

ubeyou avatar Aug 15 '16 09:08 ubeyou

with this .js app totally doesnt work see link

AliveDD avatar Aug 15 '16 10:08 AliveDD

set the extension of the excel to .xls instead of .xlsx should works.

ubeyou avatar Aug 15 '16 10:08 ubeyou

with .xlsx we are get error screen shot 2016-08-15 at 14 17 38

AliveDD avatar Aug 15 '16 11:08 AliveDD

I'm using the last dist file and I have changed this lines:

$(o).find("tr").not(e.settings.exclude).each(function (i,o) { tempRows += "<tr>" + $(o).html() + "</tr>"; });

for: $(o).find("tr").not(e.settings.exclude).each(function (i,o) { if(e.settings.exclude_img){ $(o).find('img').remove(); } if(e.settings.exclude_links){ $(o).find('a').contents().unwrap(); } tempRows += "<tr>" + $(o).html() + "</tr>"; });

That solves the problem with images and links.

ezequielprieto avatar Sep 16 '16 19:09 ezequielprieto

It did not work for me :(

mparini2107 avatar Sep 17 '16 17:09 mparini2107

@mparini2107 you can download my whole file from here: https://raw.githubusercontent.com/ezequielprieto/jquery-table2excel/master/dist/jquery.table2excel.js

ezequielprieto avatar Sep 19 '16 13:09 ezequielprieto

@ezequielprieto 404 not found

mparini2107 avatar Sep 24 '16 19:09 mparini2107

@rainabba - Me too having issue with including/displaying images on my table to an excel. I am using dist ver 1.1.1. Do you have demos or examples how to do this? Thanks!

rdmordido avatar Jan 19 '18 02:01 rdmordido

@mparini2107 sorry for the delay here is a pastebin of the correct file https://pastebin.com/M5EAGTYd

@rdmordido this fix works fine for me.

ezequielprieto avatar Jan 19 '18 15:01 ezequielprieto