7 Replies Latest reply on Dec 2, 2014 9:09 PM by kumar.c

    How to edit connection from tabcmd

    kumar.c

      Hi,

      I have a .twb file that points to MS-Excel later i want to edit connection and point out to the SQL Server, can it be done through command prompt, if so how to do it step by step and also is it possible to Edit connection in tableau server (Excel to Server) ??

       

      Thanks in advance.

        • 1. Re: How to edit connection from tabcmd
          Vladislav Grigorov

          Kumar,

          for changing the datasource type (e.g. excel to SQL) you will need to use replace datasource, from within Tableau Desktop. If you are using a datasource published on Tableau Server, you could alter some of the connection properties - e.g. server, database, login info, but that's it. I do not know of a way that you could do this by tabcmd.

           

          Hope this helps,

           

          Vlad

          • 2. Re: How to edit connection from tabcmd
            Michel Roberge

            No, you cannot do it from TabCmd.

             

            You technically could parse your TWB file (which is Xml) and remap to a SQL Server connection. Depending on the complexity of your data structure, it could be quite challenging. 

             

            As Vladislav Grigorov pointed out, the best option is to open the workbook in Desktop, add your connection to SQL Server, and use the "Replace Connection".

             

            Concerning the 2nd part of your question, if you used Desktop, you can re-publish your workbook and override it. If you want to make it programmatically, you'd need to download the workbook, update the connection (manually with desktop, or programmatically through Xml parsing), and use TabCmd to re-publish your workbook.

             

            Cheers,

             

            Michel

            • 3. Re: How to edit connection from tabcmd
              kumar.c

              Hi Michel,

              Thanks for the info.

              I just wanted to know if i connected Live via in Tableau to different excel files, how to automate the process after publishing it to Tableau server, so whenever the data changes in Excel it will effect in workbook in tableau server.

              also locally i connected to SQL server in local machine via live connection in tableau later i want to do it in virtual machine, so can i only edit the connection in XML after copying the workbook to virtual machine and change the database connections via XML?? is it the solution or any other workaround is there when i dont have tableau desktop in virtual machine..

               

              pls help. thanks

              • 4. Re: How to edit connection from tabcmd
                Michel Roberge

                Kumar,

                 

                This is a quite different need than the original questions.

                 

                You might be interested in this article: Automatically Updating Data in a Tableau Server Workbook That Uses a Live Connection to Excel | Tableau Software

                The idea is you make a live connection to a file accessible by Tableau Server (on the network). Whenever there is new data in the file, refreshing the data will show the new records.

                 

                As for SQL Server, you can edit the connection on the server if the datasource is published:

                SQLServerUpdate.gif

                 

                If it is packaged in your workbook, then I think you'll need to edit the Xml.

                 

                Hope I answer your questions,

                 

                Michel

                • 5. Re: How to edit connection from tabcmd
                  kumar.c

                  Hi Michel,

                  The solution for Connection to Excel is working fine, but how to remove remove the selection from the Include External Files option from tabcmd if i dont have tableau desktop??

                   

                  Thanks,

                  • 6. Re: How to edit connection from tabcmd
                    Michel Roberge

                    Kumar,

                     

                    Ah, so this is what it is all about.

                     

                    TabCmd will allow you to publish DataSources or Workbooks. As such, your datasource needs to exist as a TDE first. What you publish is not the Excel sheet, it's a Tableau connection to an Excel sheet. To get there, you either need Desktop or the connection (file TDE).

                     

                    I can think of 2 options; I'm pretty sure there are more:

                     

                    1) The simplest and best way would be to use Desktop using the method identified in the suggested thread. You need to do this only once; then the server will always pick up the latest data from that network file. If you can't do it yourself, maybe someone else can do it for you? This is a one-timer.

                     

                    2) If you do not have access to desktop at all, which is somewhat strange, you could look into the Data Extract API. You could write a program that would read from whatever excel sheet you want, generate an extract, and publish it to the server. You would need to schedule this task periodically to do the refresh.

                     

                    There are most probably other/better solutions, but they may be unsupported / undocumented. Or I might just not know about them.

                     

                    Honestly - for what you need, get someone to do #1 for you.

                     

                    I hope this helps,

                     

                    Michel