1 2 Previous Next 16 Replies Latest reply on Jul 6, 2017 6:54 AM by Vathsal Ravi

    DataExtract

    Srinivas Nallamothu

      I am trying to add DataExtract API Reference in C# application. But I am not able to add the reference to the DataExtract DLL in the C#.Net application. Please help. Kindly post the the sample C# code to create a .TDE file.

        • 2. Re: DataExtract API in C# application
          Russell Christopher

          Srinivas -

           

          I suspect you've already figured this out, but we don't support managed CLS/CLR languages natively.

           

          A Tableau user by the name of scott.steesy.has already created a wrapper that you could probably use. I just invited him to the group and have asked him to post his work. You could probably try to reach out him to him directly, too.

          • 3. Re: DataExtract API in C# application
            scott.steesy

            Srinivas,

             

            I ported the Data Extract API glue code from C/C++ to C# during the beta of Tableau 8.0.

            It went through a couple changes so is a "version 1.2" and should be completely functional.

            But I admit I've only used to do a simple dump of data to a TDE file so have not exercised every function of the API.

             

            The ZIP file attached includes the port of all the code in the Data Extract API including the sample MakeOrder app.

             

            Everyone Enjoy,

            Scott

            • 4. Re: DataExtract API in C# application
              Srinivas Nallamothu

              Scott,

               

              This is excellent piece of work. I am able to generate TDE files using your code. Thanks a lot for your help.

              Please let us know if you are updating the code agian to download the latest versions.

               

              One question,

              Will this code work with Tableau 7.0 version? I tested this with 8.0 beta and its working fine.

               

              Thanks,

              Srinivas N.

              • 5. Re: DataExtract API in C# application
                Russell Christopher

                Srinivas -

                 

                The Extract API creates extracts in the v8 format - they are not backwards-compatible and therefore cannot be used by v7

                • 6. Re: DataExtract
                  Steven Eisenoff

                  Hi Scott,

                   

                  I downloaded your C# DataExtractAPI (VS 2010).  I recompiled the DLL and referenced it.  I did not make any other changes.  The line ( Extract extract = new Extract( file ) ) at the beginning of MakeOrder.Main() is throwing the error

                  -- The type initializer for 'Tableau.DataExtractAPI' threw an exception.

                   

                  Any ideas?

                   

                  PS - It looks like some very nice work.

                  Thanks.

                  Steve

                   

                  • 7. Re: DataExtract
                    Steven Eisenoff

                    I solved my issues:

                     

                    1. I found that security (I work at a bank) had locked down the common folder.  So, I changed the 'C:\Program Files\Common Files\TableauDataExtractAPI' in the file DataExtractAPI.cs and simply pointed it to the bin\debug folder for the new dll.
                    2. I needed to copy the DLLs created by Tableau from their regular download for Python, into the bin\debug folder.  DataExtractAPI.cs uses DllImport to load the dataextract.dll.  (note: I tried to register dataextract.dll but I was unable to (win 7 - 64x))

                     

                    Like everything, it was easy once I realized what was happening.

                     

                    Thanks.
                    Steve

                     

                     

                     


                    2 of 2 people found this helpful
                    • 8. Re: DataExtract
                      Ray Choe

                      where can I download dataextract.dll?


                      I made code change like below but still can't make it working.


                             // Default folder for 32 bit TDE API on 32 bit Windows

                              private const string TDE32Win32Folder = @"C:\Tableau\Tableau\DataExtract_DotNet\bin\Debug";

                              // Default folder for 32 bit TDE API on 64 bit Windows

                              private const string TDE32Win64Folder = @"C:\Tableau\Tableau\DataExtract_DotNet\bin\Debug";

                              // Default folder for 64 bit TDE API on 64 bit Windows

                              private const string TDE64Win64Folder = @"C:\Tableau\Tableau\DataExtract_DotNet\bin\Debug";

                       

                      and

                       

                                  FileInfo tdeAPI = new FileInfo( Path.Combine( tdeFolder, "DataExtract_DotNet.dll" ) );   

                      • 9. Re: DataExtract
                        Jeff D

                        Hi Ray, have you downloaded the Data Extract  (TDE) API?

                         

                        Get the Data Extract API | Tableau Software

                        1 of 1 people found this helpful
                        • 10. Re: DataExtract
                          Goutham Mullaguru

                          Hi Scott, Thanks for this and is very useful. Everything is working as expected except for issue below.

                           

                          row.SetCharString(1, "Beans" );


                          writes only the first character to TDE. When I use SetString, things are working as expected. Not sure if there is a easy fix.


                          Other question is, what is the best way to handle NULL values? currently I am adding 1/jan/1900 for dates, 0 for integers, and doubles and "NULL" for strings. This is not the ideal way but get the job done for my use case. not sure if there is a better way to do this.


                          UPDATE:

                          -figured out there is a SetNull() to set null values.

                          • 11. Re: DataExtract
                            Subhash Gowda

                            Scott,

                             

                               I would like to leverage your module to create a TDE with millions of records.

                               Is there a way i can append to existing TDE using this module.

                               Since I will be suing this for 10+ millions, will there be any performance issues.

                             

                            Thanks,

                            Surya

                            • 12. Re: DataExtract
                              Bhavya Kolakaluru

                              Hello All,

                               

                              I have encountered the same issue that Steven had come across with the following error :

                              The line ( Extract extract = new Extract( file ) ) at the beginning of MakeOrder.Main() is throwing the error

                              -- The type initializer for 'Tableau.DataExtractAPI' threw an exception.

                               

                               

                               

                              I've followed the same steps that Steven listed afterwards on how he was able to fix the issue by copying the DLLs created by Tableau for Python but unfortunately, it did not resolve my issue. I keep getting the same error.

                               

                              Any thoughts on what I am possibly missing. Thanks much and appreciate your help in advance.

                               

                              Regards,

                              Bhavya

                               

                               

                              • 13. Re: DataExtract
                                Iris Abramovitz

                                Hi Scott,

                                 

                                I just tried downloading the code including getting the API code. I copied over the support .dlls to my bin folder as suggested by others however I am still failing on the following:

                                 

                                result = API.TabExtractCreate( out m_Handle, path );

                                 

                                not sure what else to try? I am running my VS as an admin

                                 

                                TIA

                                Iris

                                 

                                • 14. Re: DataExtract
                                  Iris Abramovitz

                                  I just realized that it can not load the dataextract.dll library and get a handle. I modified my paths and made sure the dataextract.dll exists in the path, yet still no luck

                                  1 2 Previous Next