How access xml file of "save as sample Data" in BI Publisher - bi-publisher

When we create data model we perform " save as sample data".
My question is how i access the xml file for uploading xml data in ms word.?

That sample data cannot be exported. BIP uses that sample data to show previews of reports in the catalog and some detail views. You can only use the Export button on the Data tab to get xmls from your query. So you can run a query which returns the same data as in sample data and export it out.

Once you click on "save as sample data",you have to export the data by clicking on "export".After export it will be saved in your local system in some path.In ms word you will get an option to import xml. After clicking on that it will ask you for the path where you have saved your xml. Now you can select .click on the "field" ; you will be able to see all column details.

you can find the sample xml in the properties of data model
click on the text to see the screenshot

Related

I am unable to see the Full Data(Analysis -> View data) in Tableau

My data contains around 10000 records.
I have published my workbook in the browser. I am able to see the summary and full data in Tableau (2022.1.1) version.
But I am unable to see the content in Full data in View data ( version - 2021.4.8).
Thanks in Advance.
Firstly, "View Data" is just a preview option for your data and it will only show those fields which belong to the viz used in your dashboard

Programmatically generated CSV file format issue for Excel and Numbers

In my iOS project, I have programmatically generated csv file from my data. Most of time, it looks all good for Microsoft Excel and Apple Numbers to open with.
But when the cell data is something like 5 - 60, it seems Excel would automatically convert it to date value like May-60, while Numbers open it correctly.
I have found this thread: https://stackoverflow.com/a/165052/833885, so the solution makes Excel happy is using "=""5 - 60""". But this will make Numbers shows ="5 - 60"......
You can quickly generate empty csv file to test what I described above.
Is is possible to generate csv file that makes all world happy???
Thanks in advance.
You can create a new file in excel and import from the data ribbon tab - this gives options to specify the data types for 'columns' in the csv. A bit of a pain but will avoid the issue.

Download link for Google Spreadsheets CSV export - with Multiple Sheets

I'm trying to find a link which allows me to download a CSV formatted version of my Google Spreadsheet. Currently I'm using:
https://docs.google.com/spreadsheets/d/DOCID/export?format=csv
This works great except that it only download the first Sheet. My document has multiple sheets. Does anyone know how to format this link so that it downloads either all the sheets or a specific sheet? Something like:
&sheet=all
or
&sheet=3
Every document in Google Sheets supports the "Chart Tools datasource protocol", which is explained (in a rather haphazard way) in these articles:
"Creating a Chart from a Separate Spreadsheet"
"Query Language Reference"
"Implementing the Chart Tools Datasource Protocol"
To download a specific sheet as a CSV file, replace {key} with the document's ID and {sheet_name} with the name of the sheet to export:
https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}
The datasource protocol is quite flexible. Various other options include:
Response Format: Options include tqx=out:csv (CSV format), tqx=out:html (HTML table), and tqx=out:json (JSON data).
Export part of a sheet: Supply the range={range} option, where the range can be any valid range specifier, e.g. A1:C99 or B2:F.
Execute a SQL query: Supply the tq={query} option, such as tq=SELECT a, b, (d+e)*2 WHERE c < 100 AND x = 'yes'.
Export textual data: Supply the headers=0 option in case your fields contain textual data, otherwise they might be cut out during export.
Open your Google sheet
Click the "Share" button and configure "Anyone with the link can view"
Press F12 to launch debugging tools in your web browser and select the "Net" tab.
Select "File -> Download As -> Comma-separated values .csv current sheet" (or whatever format you want, e.g. xlsx, ods, pdf, html, csv, or tsv)
Copy the URL of the GET request from the "Net" tab
It will look something like this:
https://docs.google.com/spreadsheets/d/KEY/export?format=csv&id=KEY&gid=SHEET_ID
Note, the "gid" parameter is the sheet ID, which you can find at the end of the URL of the open Google sheet.
Reference: https://developers.google.com/sheets/api/guides/concepts#sheet_id
This is a sample csv data can be downloaded. Download link for this data was made like this
Open google sheet-> Blank ->File->Open
Open file from "My Drive" or "Upload"
File -> Publish to the web -> "Sheet name" option and "csv" option
As of November 2020, the most elegant and simplest solution seems to be buried in #jrc's reply:
https://docs.google.com/spreadsheets/d/KEY/export?format=csv&gid=SHEET_ID
Here's a live example; given the Google Sheet that has a KEY of 1CTgM1g_aYoWFFpHU6A_qyqWGH0ulCFhs67uAcRVf1Rw
i.e: https://docs.google.com/spreadsheets/d/1CTgM1g_aYoWFFpHU6A_qyqWGH0ulCFhs67uAcRVf1Rw
To get the permalink to a CSV export of its first sheet (i.e. gid=0), append: /export?format=csv&gid=0:
https://docs.google.com/spreadsheets/d/1CTgM1g_aYoWFFpHU6A_qyqWGH0ulCFhs67uAcRVf1Rw/export?format=csv&gid=0
Note: if you're just exporting the first sheet, i.e. gid=0, then the URL is the same as the URL format posited in the original question, i.e.
(by default, the endpoint will assume gid=0 if it's left unspecified)
https://docs.google.com/spreadsheets/d/DOCID/export?format=csv
2021 update...
Question has been well answered in another post.
I'll add some things to look out for ...
On the "publish to web" there are:
Drop downs with options to choose the format and,
A choice on which sheets you want included,
Lastly a checkbox to ensure changes are republished
Publish to Web Google Sheets
I've developed an handy python command line application called google-sheets-to-csv few month ago: https://pypi.org/project/google-sheets-to-csv/ which allow to download multiple sheets at once.
Basic usage on linux (probably works on windows as well, I haven't test):
pip install google-sheets-to-csv
gs-to-csv <spreadsheet ID> <sheet selector (regex)> <output directory>
where:
<Spreadshhet ID>: is the weird data in the url https://docs.google.com/spreadsheets/d//
<sheet selector (regex)>: is a regular expression https://en.wikipedia.org/wiki/Regular_expression
<output directory> is an existing directory on your file system
To download all the sheets at once you can do:
mkdir output/
gs-to-csv DOCID ".*" output/
You'll find one file per sheet.
Do not miss details in the project README ( regarding authentification the current published token is not yet validated by google you'll get an authentification warning like in this video used for the validation process: https://youtu.be/7zacMyv_ooU?t=73) If are afraid you can read the code here https://gitlab.com/micro-entreprise/google-sheets-to-csv (it's Open source software!) or use a google service account.
The following URL format (as a template string) is the only one that worked from me:
`https://docs.google.com/spreadsheets/d/e/${id}/pub?output=csv&id=${id}&gid=${gid}`
This assumes the entire document has been published to the web.

Filemaker Pro 12 Exporting current 'Records being browsed' as Excel on iOS

I'm managing a Filemaker Pro 12 solution to create purchase orders and send them via email for the iPad but the iOS Platform doesn't allow to export Excel files.
Currently we are sending the orders as a .pdf file but the warehouse has to manually approve each order. The solution we were thinking of is to send a .csv file attached to an email so that the warehouse has less work.
I'm using 3 different tables to create a order. A table that stores the products, a container table (to set the quantity, discount etc.) and a table for the order itself. So you can for example create three product-A and two Product-B in an order which works fine. My PDF solution uses an extra Layout and works fine. On a PC or Mac you can export Excel files with a script and the "Save Records as Excel" function, but this is not available on iOS, so I'm looking for alternatives.
The script I came up with to send the .csv file via email looks like this:
Set Error Capture [On]
Freeze Window
Go to Related Record [Show only related records; From table "Orders_Container"; Using Layout: "MailLayout" (Orders_Container); New Window]
If( Get (LastError) = 0)
Sort Records[ Restore; No dialog]
Set Variable[ $FILE; Value:Get (TemporaryPath ) & "file.csv" ]
Export Records [No dialog; "$FILE"; Windows(ANSI)]
Send Mail[Send via E-mail Client; To: "customer#web.com"; Subject: "Order"; "$FILE"]
End If
Close Windows [Current Window]
I tried to use the function "Export Records" but it exports all records of the current customer instead of the 'Records being browsed' which is only available for the PDF export. I've tried to do this but on iOS you can't create a new file to export and I can't come up with something else. I don't want the users to use Menu -> Export -> E-Mail because they will have to enter 3-4 Email addresses each time which is way to time consuming (this also exports all records instead of the ones which are currently being browsed). Is there any way to export the records that are currently open, save those in a .csv file and send a mail with the file attached? Thanks in advance.
EDIT: Ironically after some testing with different scripts, the script I posted here works now correctly.
The Export Records function exports the current found set - the same as Records Being Browsed. This indicates that other issues are keeping your script from working.
You might want to look at the Related Record and which set is found. Use a temporarily pause just before the Import Records function is called to see what set is present.
Also, keep in mind that if there is an error with your Go to Related Record call, nothing happens. A record created by a previous export would then remain in place and this then might show a different set of records than you would expect.

ASP.net MVC Export To Excel

I am currently exporting to Excel using the old HTML trick, where I set the MIME type to application/ms-excel. This gives the added benefit of nicely formatted tables, however the negative of the excel document not being native Excel format.
I could export it as CSV, but then this would not be formatted.
I have read brief snippets that you can export it as XML to create the Excel document, but cannot find too much information on this. Does anybody know of any tutorials and/or benefits of this? Can it be formatted tables using this method?
Thanks.
Easiest way, you could parse your table and export it in Excel XML format, see this for example: http://blogs.msdn.com/b/brian_jones/archive/2005/06/27/433152.aspx
It allows you to format the table as you whish (borders, fonts,colors, I think even formulas), and Excel will recognize it as native excel format. As a plus, you can use other programs that can import Excel XML (ie.Open office, Excel viewer,etc) and you do not need to have Office components installed on the server.
Check out ExcelXmlWriter.
We've been using it for some time and it works well. There are some downsides to the xml format however. Since it's unlikely your end users will have the .xml extension associated with Excel, you end up having to download files as .xls with an Excel mime type. When a user opens a file downloaded in this way they get a warning that the file is not in xls format. If they click through it, the file opens normally.
The only alternative is a paid library to generate native Excel files. That's certainly the best solution but last time we looked there were no good, free libraries (may have changed)
Bill Sternberger has blogged a very simple solution here:
export to excel or csv from asp.net mvc
Just today I had to write a routine that exported data to excel in an MVC application. Here's the details so someone may benefit in the future, first the user had to select some date ranges and areas for the report. On the post back, this method was in place, with TheModelTypeList containing the data from LINQ/Entity Framework/SQL Query returning strong types:
if (ExportToExcel) {
var stream = new MemoryStream();
var serializer = new XmlSerializer(typeof(List<SomeModelType>));
serializer.Serialize(stream, TheModelTypeList);
stream.Position = 0;
FSR = new FileStreamResult(stream, "application/vnd.ms-excel");
}
The only catch on this one was the file type was not known when opening so the system prompted for the application to open it... this is a result of the content being XML.... I'm still working on that.
I am using Spreadsheet Light, an Open-Source library that provides ridiculously easy creation, manipulation and saving of an Excel sheet from C#. You can have an MVC / WebAPI Controller do the work of creating the file and either
Return a URL link to the saved Excel file to the page and invoke Excel to open it with an ActiveX object
Return a Data Content Stream to the page
Return a URL link to the calling page to force an Open / Save As dialog
http://spreadsheetlight.com/

Resources