Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Use sheet position in tFileInputExcel

Hello,
I want to import only the first sheet of an Excel file by using the position of the sheet (0 or 1). So I disable "All sheets" and enter the position in the column "Sheet (name or position)". This gives an error "The method addSheetName(String, Boolean) in the type ExcelReader is not applicable for the arguments (int, boolean)". Tried to use "0" but then the sheet with the name "0" is not found.
Am I doing something wrong or is this a bug? How can I import only the first sheet without using the name?
Thanks for any suggestions!
0683p000009ME8w.png
Labels (2)
26 Replies
Anonymous
Not applicable
Author

What setting did you use for the Sheet name or position on the tFileInputExcel? Ok, replied to quickly. See it.
If I use 0 for input, I get this error.
0683p000009MERH.png 0683p000009MERI.png
Anonymous
Not applicable
Author

Hi,
What's your whole workflow? only tfileinputexcel-->output? What's your JDK version?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
What is the value of your context variable which is used in file name?
Whether the file is available at respective location?
Thanks
Vaibhav
Anonymous
Not applicable
Author

Hi Sabrina,
If I setup a test like you did, it works fine. I'm using JDK 1.7.
I've added the complete workflow of the job with this weird behavior. The steps before opening the Excel sheet are as follows:
1. I'm loading the context from a file with the use of a subjob (LibContextreader). It will determine on which OS the job is running and load the context file from the correct location (development on Windows, production on Linux).
2. In the context there's a variable with the id of the file to load. The file names are in a MySQL database table and I'm getting the name from the table. The file itself isn't stored in the database, but on the file system. So I'm only getting the name of the file and set the complete path (which differs on development and production) in the context (context.fileToImport).
3. The tFileInputExcel is then opening the file and processes it. If I use the sheet name, it works fine.
0683p000009MER8.png 0683p000009MERM.png 0683p000009MEET.png
Anonymous
Not applicable
Author

Hi Vaibhav,
Thanks for your reply. The context variable with the file name is correct and the file is present since everything works if I use the name of the sheet in tFileInputExcel in stead of 0. It's something with the method being called to open the sheet, not the file itself. The method doesn't accept integer input for whatever reason.
Regards,
Pierre
Anonymous
Not applicable
Author

Hi Sabrina,
Do you have any suggestions on how to solve this or work around it? Do you need more information?
Regards,
Pierre
Anonymous
Not applicable
Author

Problem solved, although it's a small bug in Open Studio. This is how I reproduced this behavior.
I've setup a new test set and added all parts step by step to see if I could reproduce this behavior. It occurred again when I set the property type of the tInputFileExcel component to "Repository", select the correct file from the repository and then edit the File Name/Input Stream to "context.fileToImport".
When trying to edit this property, Open Studio provides a pop-up with the options to either "Change to built-in property" or "Update repository connection". I've chosen to revert back to the built-in property and the changed the "Sheet (name or position)" to 0.
Now when I run the job the error about the int input is shown and the job won't run.
So, I removed the component form the job, add it again and set all settings (with "Sheet (name or position)" to 0) and it works. Just don't touch the "Property Type" and I'm fine...
Thanks for the fast replies and your help!
Regards,
Pierre
Anonymous
Not applicable
Author

Hi Pierre,
Would you mind opening a jira issue of DI project on Talend Bug Tracker, our developer will check if it is a bug. Many thanks.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Sabrina,
Just tried to reproduce the error again to provide the steps for the Jira issue, but the error doesn't occur anymore?! So didn't add the issue yet, will do so if it occurs again and I can reproduce.
Regards,
Pierre
Anonymous
Not applicable
Author

Hi,
Thanks for your feedback. Feel free to let us know if there is any further help we can give.
Best regards
Sabrina