How to get "messageTop" to work with excelHtml5
How to get "messageTop" to work with excelHtml5
I need to place a message into the body of an exported excel document and I'm not having any luck. The data table exports just fine, but I don't see the message.
I've tried this.
buttons: [
{
extend: 'excelHtml5',
messageTop:'This is a test'
}
]
I've also tried this.
buttons: [
{
extend: 'excelHtml5',
exportOptions:
{
messageTop: 'Another test'
}
}
]
What am I doing wrong? How to I get message text to appear above the exported table?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Does this example work for you:
https://datatables.net/extensions/buttons/examples/html5/titleMessage.html
Kevin
@kthorngren -- I've already tried the example from the page you cite. I don't see any message. Even extending 'excel' instead of 'excelHtml5' has the same result. No message.
The example works for me. Maybe try a different browser to test?
What browser are you using?
Kevin
Let me clarify: when I go to the cited page, I can print from that table and see the message.
However, then I take the same code from that page and apply it to my code, it doesn't work. Neither do I get any console errors.
Make sure you are using Buttons 1.5 or newer for
messageTop
.Allan
@Allan -- How to I tell what version of Buttons I have?
-- Disregard. I found the GitHub package and downloaded the zip file.
Even after replacing all my Buttons js files, I'm still unable to see any messageTop content.
For good measure, I even made sure the rest of my Data Tables js files were updated. I'm still not seeing messageTop. No console error, Chrome isn't seeing anything it doesn't like.
Lacking any other option, I shut down my computer and restarted it. Now I'm seeing a the messageTop.
Now it's working, but I find it hard to believe that restarting my computer was the solution.
Sounds like a cache issue. The browser probably had an old version cached and restarting the machine cleared the cache.
Allan
Hi
your code is ok please check your jquery and related .js file version like
Use same version its working properly.