Can you try either of the following?
1. Using the REST API, query view data
2. Bring up the report URL and append .csv onto the end of it and see if this downloads what you want. If so, maybe you can do this programmatically.
We're aware of appending csv to the end of the URL, unfortunately csv isn't an acceptable business solution for us, so if we used the CSV url, we'd then have to run it thru an XLS converter anyways. That's our final option if we can't figure anything else out.
It looks like the REST API will also return the underlying data, not the pivot grid?
Were you able to figure anything out on this? We need the same thing!
We're still trying to find a work around. We've been playing with:
GitHub - starschema/starschema-tableau-excel-extractor: Extract Tableau reports in Excel format.
That apparently used to work for custom views (and only custom views), but it appears to be broken as of the newest version of tableau server.
But even if we get there, it doesn't take parameters or the current state of the view into question, just the custom view as saved on the server.
For a little more background, it appears if you run fiddler or wireshark, or some other tool to track webtraffic, you can see the vizql query chain that results in generating a crosstab when you do so manually, so we're basically using those, and the existing code in that github repository to try and see if we can automate that vizql call.
This doesn't help your use case, but I am working on a POC to schedule reports to XLSX, and the only method I've found thus far is to use Selenium IDE to generate a .SIDE and then calling the .SIDE with selenium-side-runner. I'm still working on some challenges with the process, not the least of which is the requirement to have a .SIDE per report.. I've yet to determine a way to inject a variable into the .SIDE so I could just create a single .SIDE to handle the navigation and download actions.
Assuming I resolve this, I'm then using Powershell to add a title and some header rows, apply some formatting and save to XLSX.