KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Data Tables Exporting #2754

Open iWorQ Systems opened this topic on on Jul 6, 2022 - 5 comments

iWorQ Systems commented on Jul 6, 2022

I am using a datatable that has the buttons, PDF, EXCEL, and CSV on them. When I export those, I get the name csv.csv, or pdf.pdf, xlsx.xlsx.

I was just wondering where I can change the name of the download file for those buttons. Hopefully that makes sense, and I hear from you soon.

Sebastian Morales commented on Jul 8, 2022

There's a "title" property for the buttons:

        "buttons" => [
            [
                "extend" => "excelHtml5",
                "title" => "Data export"
            ],

Let us know the result. Tks,

iWorQ Systems commented on Jul 8, 2022

That did not seem to want to work, this is what my code looks like for my table:

DataTables::create(array(
                "dataStore" => $this->dataStore("typeStatusTable"),
                "plugins" => ["Buttons", "FixedColumns", "FixedHeader", "KeyTable", "Responsive", "RowReorder", "Scroller", "SearchPanes"],
                "options" => array(
                    "dom" => 'Blfrtip',
                    "buttons" => [
                        [
                            "title" => "Entity Report",
                            "extend" => 'pdfHtml5',
                            "orientation" => "landscape",
                            "pageSize" => "A6",
                            "extend" => "excelHtml5",
                        ],
                        "copy", "csv", "excel", "print", "colvis"
                    ],
                    "searching" => true,
                    "paging" => true
                ),
                "columns" => array(
                    "Entity #",
                    "Status",
                    "Applied Date",
                    "Renewal Date",
                    "Issued Date",
                    "Expired Date",
                    "Description",
                ),
                "cssClass" => array(
                    "table" => "table table-bordered table-striped table-hover"
                )
            ));
Sebastian Morales commented on Jul 11, 2022

Ok, pls try "text" => "Entity Report" to see if it makes any difference. Tks,

iWorQ Systems commented on Jul 11, 2022

ah I figured out the issue, and it is working great now, thank you!

AhmedHaroon commented on Mar 1, 2023

@iWorQ Systems

i knew this topic is old to comment here (more than 7 months old the last comment), just want you to can you please help others too what you have figured out and what you have done to work it great?

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

DataGrid