Hello,
I have previously asked a question about exporting to PDF because of the difference in display of the CSV file. Roland told me that an update of this component will come out to export XLSX, so maybe the things I needed are then available.
The update is out, and you can export als XLSX, but how do I change certain things? LIke how large a specific field must be, or the border color? Where can i do that?
- Huubss
- RO CSVI
- Friday, 01 July 2022
- Subscribe via email
0
Accepted Answer
Accepted Answer
Pending Moderation
Hello,
There seems to be some misunderstanding. Roland did not mentioned that it is possible to style the export XLSX file in the topic here.
We use an external library to generate XLSX file. I doubt if you can edit the code. The RO CSVI helper code is in administrator/components/com_csvi/helper/file/export/xlsx/csvimproved.com. There is no code for designing in CSVI helper but that is the place where the library methods are used to generate XLSX data. The library files are in folder administrator/components/com_csvi/vendor/phpoffice/phpspreadsheet. Remember that if you edit any of the core files an update to RO CSVI will overwrite the changes.
Hm thats weird that Roland then told me this.
There seems to be some misunderstanding. Roland did not mentioned that it is possible to style the export XLSX file in the topic here.
Is it possible to change the core code?
So that maybe in the core code of the XLSX generation I can set certain values?
We use an external library to generate XLSX file. I doubt if you can edit the code. The RO CSVI helper code is in administrator/components/com_csvi/helper/file/export/xlsx/csvimproved.com. There is no code for designing in CSVI helper but that is the place where the library methods are used to generate XLSX data. The library files are in folder administrator/components/com_csvi/vendor/phpoffice/phpspreadsheet. Remember that if you edit any of the core files an update to RO CSVI will overwrite the changes.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- more than a month ago
- RO CSVI
- # Permalink
Accepted Answer
Pending Moderation
Hello,
We only support the export to XLSX file but not the design of fields in XLSX file. So there is no option in RO CSVI to specify the design of export file.
The update is out, and you can export als XLSX, but how do I change certain things? LIke how large a specific field must be, or the border color? Where can i do that?
We only support the export to XLSX file but not the design of fields in XLSX file. So there is no option in RO CSVI to specify the design of export file.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hello,
The update is out, and you can export als XLSX, but how do I change certain things? LIke how large a specific field must be, or the border color? Where can i do that?
We only support the export to XLSX file but not the design of fields in XLSX file. So there is no option in RO CSVI to specify the design of export file.
Hm thats weird that Roland then told me this. Is it possible to change the core code?
So that maybe in the core code of the XLSX generation I can set certain values?
Accepted Answer
Pending Moderation
Hello,
Hm thats weird that Roland then told me this.
There seems to be some misunderstanding. Roland did not mentioned that it is possible to style the export XLSX file in the topic here.
Is it possible to change the core code?
So that maybe in the core code of the XLSX generation I can set certain values?
We use an external library to generate XLSX file. I doubt if you can edit the code. The RO CSVI helper code is in administrator/components/com_csvi/helper/file/export/xlsx/csvimproved.com. There is no code for designing in CSVI helper but that is the place where the library methods are used to generate XLSX data. The library files are in folder administrator/components/com_csvi/vendor/phpoffice/phpspreadsheet. Remember that if you edit any of the core files an update to RO CSVI will overwrite the changes.
Thanks very helpful. I think I can tinker away with this now.
Accepted Answer
Pending Moderation
Hello,
I have some questions about the export. I have added column widths, borders, all kinds of stuff, so I am very glad with that.
But is there some sort of function to get the contents from the export? For example, I want to add a border to a row or rows where the ID of the exported row is the same. But I'm nto sure how to do that.
Also I am now setting the column widths manually, i do this in the _construct of the csvimproved in the xlsx folder:
But is there a way to do this programmatically? For example loop through all the header rows and then set the width based on the name of the column?
I have some questions about the export. I have added column widths, borders, all kinds of stuff, so I am very glad with that.
But is there some sort of function to get the contents from the export? For example, I want to add a border to a row or rows where the ID of the exported row is the same. But I'm nto sure how to do that.
Also I am now setting the column widths manually, i do this in the _construct of the csvimproved in the xlsx folder:
$this->spreadSheet->setActiveSheetIndex(0)->getDefaultColumnDimension()->setWidth(12);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension(A)->setWidth(20);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension(B)->setWidth(20);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension(C)->setWidth(20);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension(D)->setWidth(4);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension(E)->setWidth(4);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension(F)->setWidth(20);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension(G)->setWidth(8);
$this->spreadSheet->setActiveSheetIndex(0)->freezePane('B1');
But is there a way to do this programmatically? For example loop through all the header rows and then set the width based on the name of the column?
Accepted Answer
Pending Moderation
Hello,
In the csvimproved helper file in xlsx folder look for method prepareContent, you get the export data in that function. You can modify the code in that method as per your need.
Below is the code to run a loop for columns from A to Z. $letter variable gets the column name, you can set the width based on $letter variable.
I have some questions about the export. I have added column widths, borders, all kinds of stuff, so I am very glad with that.
But is there some sort of function to get the contents from the export? For example, I want to add a border to a row or rows where the ID of the exported row is the same. But I'm nto sure how to do that.
In the csvimproved helper file in xlsx folder look for method prepareContent, you get the export data in that function. You can modify the code in that method as per your need.
But is there a way to do this programmatically? For example loop through all the header rows and then set the width based on the name of the column?
Below is the code to run a loop for columns from A to Z. $letter variable gets the column name, you can set the width based on $letter variable.
for($i = 0; $i <= 26; $i++)
{
$numeric = $i % 26;
$letter = chr(65 + $numeric);
$this->spreadSheet->setActiveSheetIndex(0)->getColumnDimension($letter)->setWidth(20);
}
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »