Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

CSV and Excel content display issue using CSV Macro

Arya Banerjee July 23, 2014

The CSV macro needs to be fixed so that when the CSV file is associated to it it doesnot load in one horizontal line and if a excel file is associated with it, the mashup of text to junk display doesnot happen.

Issue with the CSV plugin implementation:-
1. Insert an attachment to a confluence page :




2. Select the CSV macro


3. Refer the attachment from the page (other options are also there)






4. Preview or save the page and have a check. The output is attached


5. If we repeat the same with CSV as we did with XLSX file above, we would get the entire mashed up content in a single line.

Please let me know if you have any questions.

4 answers

1 accepted

0 votes
Answer accepted
Arya Banerjee August 11, 2014

Hi Bob,

Thanks for your response. I have opened an issue : TBL-352.

As per my analysis, the problem might be with the negative currency field which is causing the issue. I have attached the faulty CSV file and it seems that the issue is happening with all the CSV files having negative currency field.

Regards,

Arya

0 votes
Marco Graf
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 12, 2019

To simply include a csv as table with no formatting or whatsoever you can use javascript:

<div id="dvCSV">
Here comes the CSV content from the CSV-to-HTML-JavaScript
</div>

<script type="text/javascript">
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "/download/attachments/82776943/The_CSV_FILE.txt", true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4 && txtFile.status === 200) {
text = txtFile.responseText;

var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.csv|.txt)$/;

var table = document.createElement("table");
table.style.border = "1px solid";
var rows = text.split("\n");
for (var i = 0; i < rows.length; i++) {
var cells = rows[i].split("\t");
if (cells.length > 1) {
var row = table.insertRow(-1);
for (var j = 0; j < cells.length; j++) {
var cell = row.insertCell(-1);
cell.style.border = "1px solid black";
cell.innerHTML = cells[j];
}
}
}
}
table.style.border = "1px solid black";
table.style.borderCollapse = "collapse";
var dvCSV = document.getElementById("dvCSV");
dvCSV.innerHTML = "";
dvCSV.appendChild(table);
}
txtFile.send()
</script>
0 votes
Arya Banerjee July 29, 2014

Thanks a lot Bob. This answers my question. When would we be able to show xlsx data using Excel Macro? Do we need to follow XL-58?

Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2014

Yes, just follow the issue.

Arya Banerjee August 11, 2014

Hi Bob,

Thanks for your response. Okay, I have been able to replicate the issue with the CSV inclusion within a Confluence page. We have purchased a 500-user commercial license, Enterprise, expires Jun 17, 2015 for our Confluence instance. But it seems that the CSV macro is displaying all the CSV files in an all - horizontal manner.

Do you want me to open an issue on this?

I tested and found that the CSV file is having no issues and is behaving normally in other Confluence instances. Please help us with this and let me know if you need any further information.

Regards,
Arya

Arya Banerjee August 11, 2014

Hi Bob,

If you want me to open an issue on this, I would be attaching the csv file also which is causing the problem.

Please confirm.

Regards,

Arya

Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 11, 2014

Yes, open an issue if it appears not to be working as expected. Make sure it is a valid CSV file.

0 votes
Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2014

Please open an issue and attach the specific files that are causing you problems. Note that in order to use the CSV Macro with Excel data, you need to export from Excel as CSV.

Arya Banerjee July 24, 2014

Hi Bob,

I would be opening an issue in the link provided by you. Before that, I just want to confirm one thing: Can Xlsx files be uploaded via CSV macro without changing the format to csv? Or is it mandatory to convert the excel files to csv first and then use the CSV macro for including the same in the team pages?

Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2014

It is required to convert to csv. The csv macro ONLY does csv. If you want to view Excel files without conversion, then you need Excel for Confluence and the Excel Macro. However, for xlsx support you will need to wait for XL-58. An alternative is the Office Connector macro for excel.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events