Steps to reproduce -- windows
0) Ensure pinning is enabled
1) File > Options > Results > Grid Results > "Specify View as Spreadsheet Directory" specify a directory value
2) Execute a query such as:
select * from Customer --customerid --firstname where FirstName='Luis' --group by --company go
3) The tab name is the sql query
4) Choose "View as spreadsheet". You'll see an error in the log file:
java.io.FileNotFoundException: C:\Users\Administrator\Downloads\sa@SQLServer1 (Untitled 3) - select _ from Customer --customerid --firstname where FirstName='Luis' --group by --company.xlsx (The filename, directory name, or volume label syntax is incorrect)
Fix:
1) Enhance our algorithm which removes invalid characters to generate a compliant OS name for the file. We should cap the maximum filename as well.
2) Instead of using the grid result tab name, we could use the QA window name. However, this has its drawbacks when users have multiple pinned tabs and are using the rename functions.
Fixed:
SVN r43696/16.0.4-4
SVN r43698/17.0.0-dev-20
The root cause of this problem is there are newline characters embedded in the filename. Fixed the problem by modifying AQFileUtils.safeFileName(String filename, char replacement)
so that if finename
contains non-printable characters, then replace non-printable characters by replacement
.
1) Enhance our algorithm which removes invalid characters to generate a compliant OS name for the file. We should cap the maximum filename as well.
The excel filename generation logic does handle these requirements, see this link for details.
2) Instead of using the grid result tab name, we could use the QA window name. However, this has its drawbacks when users have multiple pinned tabs and are using the rename functions.
The logic to generate excel filename is not modified.
------
By the way, I ran the following query using head of 16.0.0 branch and head of trunk. Comments embedded in query are completely replaced with newline characters in the generated filename which is different than the one logged by Sachin.
SELECT * FROM bi_test_654
--customerid
--firstname
WHERE c_text_1='v11'
--group by
--company
GO
<2015-04-23 14:41:54,819> ERROR [AWT-EventQueue-0] <com.common.export.excel.ExcelView>
java.io.FileNotFoundException: C:\tmp\test-ads-13268\root@MySQL-5.5-Localhost-test-db (Untitled 7) - SELECT _ FROM bi_test_654
WHERE c_text_1='v11'.xlsx (The filename, directory name, or volume label syntax is incorrect)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:122)
Issue #13268 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 16.0.4-4/17.0.0-dev-20 |
No time estimate |
1 issue link |
relates to #13598
Issue #13598File > Options > Results > Grid Results > "Specify View as Spreadsheet Directory" not working for Stored Procedure. |
Fixed:
SVN r43696/16.0.4-4
SVN r43698/17.0.0-dev-20
The root cause of this problem is there are newline characters embedded in the filename. Fixed the problem by modifying
AQFileUtils.safeFileName(String filename, char replacement)
so that iffinename
contains non-printable characters, then replace non-printable characters byreplacement
.The excel filename generation logic does handle these requirements, see this link for details.
The logic to generate excel filename is not modified.
------
By the way, I ran the following query using head of 16.0.0 branch and head of trunk. Comments embedded in query are completely replaced with newline characters in the generated filename which is different than the one logged by Sachin.
SELECT * FROM bi_test_654
--customerid
--firstname
WHERE c_text_1='v11'
--group by
--company
GO
<2015-04-23 14:41:54,819> ERROR [AWT-EventQueue-0] <com.common.export.excel.ExcelView>
java.io.FileNotFoundException: C:\tmp\test-ads-13268\root@MySQL-5.5-Localhost-test-db (Untitled 7) - SELECT _ FROM bi_test_654
WHERE c_text_1='v11'.xlsx (The filename, directory name, or volume label syntax is incorrect)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:122)