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

Export DataExport specify name of file ?

SOLVED
Highlighted
Participant

Export DataExport specify name of file ?

Hey all,

1-

     When using the thing DataExport to export a data table, is there a way to specify the name of the exported file ?

     As of now it only creates file with the name : "Export+DateTime".xlsx

     Is there a way I could use a custom name like "VendingMachineData.xlsx" ?

2-

     Is there a way to get only the file name upon ExportInfoTableAsExcel ?

     I guess I could write down a service that get the name starting from the last "/"

Frederik

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Export DataExport specify name of file ?

Ok,

I found a work around to name the export file, but I don't think it's a "good" work around because I'm hard coding stuff,

So basically, I have a textbox, which the user set a name for the file.

Then, when the user click on export data, the service ExportInfotableAsExcel will be call, and then the service renameFile will be call on serviceCompleted.

The path in renameFile is hardcoded since the ExportInfotableAsExcel export the file in a static folder.

So, I just right down /nameofFile.xlsx and rename it right away.

View solution in original post

17 REPLIES 17

Re: Export DataExport specify name of file ?

1. Currently cannot specify the export name.

2. Could you please clarify the question? I.e desired result vs current?

Re: Export DataExport specify name of file ?

When using the service "ExportInfotableAsExcel" the result of that is the path of where it'll be stored at (repository\DataExporterRepository\Export2017-03-01_16-55-24.xlsx).

And in that result, there is the name of that file which is Export2017-03-01_16-55-24.xslx

Is there a way to get only the name of the file with the extension (.xlsx) ?

Like I said the only way I can figure out how to do it right now would be to write down a script that remove the other stuff.

So basically, I would want the name of the file when it's created, so I can filter the grid that contains the data from FileRepository.GetFileListingWithLinks
in order to get only that file in the grid.

Re: Export DataExport specify name of file ?

These is how those services work and they are not editable. Your approach would probably make the most sense for that situation. You may either remove the text prior to \Export.. or perhaps have a variable/counter/prime key to keep track of the exported files.

Re: Export DataExport specify name of file ?

Ok,

I found a work around to name the export file, but I don't think it's a "good" work around because I'm hard coding stuff,

So basically, I have a textbox, which the user set a name for the file.

Then, when the user click on export data, the service ExportInfotableAsExcel will be call, and then the service renameFile will be call on serviceCompleted.

The path in renameFile is hardcoded since the ExportInfotableAsExcel export the file in a static folder.

So, I just right down /nameofFile.xlsx and rename it right away.

View solution in original post

Re: Export DataExport specify name of file ?

By the way, I have another question about exporting data.

I have 5 DataTable and I would like to export them all into 1 file.

On what I've seen, I can only export 1 Data Table per file.

Is there any way or work around that I could have all 5 data table into 1 file ?

Re: Export DataExport specify name of file ?

You can tag them and export to file per Model Tag:

Re: Export DataExport specify name of file ?

Forgot to mention that the export functionality that I'm looking is from a mashup, where the user click on a button, then it would get all 5 data table (result from a store procedure) and export all that data into 1 file.

So in the File there would be 5 table next to each others showing all the result,

Re: Export DataExport specify name of file ?

You can sniff/use dev tools to see the call for the model tag export and create a service you would call from the mashup using that button.

Re: Export DataExport specify name of file ?

Can you give me a bit more information about how I would do it, because I've never done any of that method . Is it a external software I need to do that or what ?

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________