Cognos - How to extract query name, data item names, and expressions into a file (excel or txt) - extract

I wanted to know if there was a quick way to get all the data items from my cognos report from each query and it's expression and be able to extract it into a text or excel file. I think possibly something can be done with the XML though I'm not too familiar with it.

First copy your report specification to clipboard:
Then open XML Editor that support XPath and issue the following expression:
/report/queries/query
Copy the result to additional XML file and open it in Excel as XML table.
You should get result similar to this (Excel 2010):

Or just save your report as XML and open it in Excel

Related

Create SSRS Subscription to XLTX (Excel Template)

I am trying to get the subscription for SSRS to send the CSV data to an existing Excel template so that the data is formatted to our excel reports and all the conditional formatting in them every morning but it's just creating a new file. How do I send the data to a specific template file?
While SSRS doesn't have built-in functionality for exporting directly to an Excel template, I have a suggestion for a workaround. Use SSRS to export the data in CSV or Excel format. Then, in the Excel template file, go to the Data menu and select Get Data > From File. This lets you use Excel's built-in Power Query functionality to reference the exported file as a data source.
One of the benefits of this approach is that to get fresh data all you need to do is overwrite the data file and then click "Refresh All" in your Excel file. You can also take advantage of the transformation functions that are available in Power Query to avoid repetitive cleanup tasks if needed.

Tableau isn't converting my csv data source to tables

When I import a csv to Tableau, it gets the same format of the original csv file (a single column with every label on it). How can I make Tableau separate the columns based on commas?
I can't see why this is happening, since in every tutorial I checked Tableau already converts the .csv to a tabular format.
Here's what I get
Note: I'm using Tableau's trial version.
Sometimes when you open a csv in Excel it can mess with the formatting like your image shows. If you think you opened it in Excel before connecting, try downloading your source again and connecting first with Tableau. If that doesn't work, I happen to have this dataset in a .tde if you would like to use that. vgsales.tde
Edit: Thinking regional settings might be a factor.
Click the dropdown on the right of the data source. Select Text File Properties
To get this window:
Can you match these settings?

CodedUI test does not read data from CSV input file

I am having difficulty mapping a CSV file with the Coded UI test method. This is most likely a stupid question but I cannot seem to find a solution for my problem, at least not one that works. I have made sure to set the property of the CSV file to Copy always.
I have also imported the CSV file by writing the following line above the test method.
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\Data\\login.csv", "login#csv", DataAccessMethod.Sequential), DeploymentItem("login.csv"), TestMethod]
The file name is login.csv and it resides in the Data folder.
The test will compile without any problem but once the test executes the fields that should receive input from the CSV file are left empty and the execution is interrupted. I've tried replacing the data from the CSV file by using Strings and it works perfectly fine. The piece of code I am using to import each parameter is:
TestContext.DataRow["Username"].ToString()
Also, the CSV file contains something along the following lines:
Username,Password,Fullname
admin#mail.com,password,Admin
Is there anyone who can point what it is I am forgetting.
Update: I pinpointed the issue, it seems like the issue only revolves around the first column in the csv file. When I try to import any of the other values it works perfectly fine.
Some text files start with a Byte Order Mark (BOM). The CSV reader within Coded UI does not handle the BOM and treats it as part of the first field name. The screen shot below shows the debug trace of a CSV file with a BOM and that same file shown in Notepad++. The DataRow.ItemArray[...] values are as expected. The DataRow.Table.Columns.ResultsView[...] shows the field names, but the first field name includes the BOM.
This CSV file with a BOM was created in Visual Studio using Solution Explorer => Add => New item => C# => General => Text file. Previously I have created a spread sheet with Microsoft Excel and saved it as a CSV file, that file did not have a BOM. I have also created files with Notepad++ and saved as CSV and they did not have a BOM. It appears that Visual Studio creates files with a BOM but when editing CSV files it does not add a BOM.
Visual Studio can create files with the correct encoding. Within "Step 2 - Create a data set" of this Microsoft page it states the text below. (Thanks also to Holistic Developer for providing very similar details in a comment.):
It is important to save the .csv file using the correct encoding. On the FILE menu, choose Advanced Save Options and choose Unicode
(UTF-8 without signature) – Codepage 65001 as the encoding.
For Visaul Studio 2010, i could solve issue be selecting "Western European (Windows) - Codepage 1252" encoding for CSV files.
Summary of steps:
In visual studio 2010, Open CSV file > Go to File menu > Select " Advanced Save Options" > Select "Western European (Windows) - Codepage 1252" > Save.
This should help.
This is not the best solution but its kind of a workaround. I simply set the first element to something random and since I don't need access to the first element it doesn't matter that I don't have access to it.
If anyone finds a correct way to solve this problem I'd be grateful for your solution.

SRSS xml format

is there any settings for output xml from RS to format output xml like when you opened xml in browser(every node on new row..)?
When I open output xml in text editor there only one long line..
I have never tried this, but the documentation seems to suggest you can alter the rendering behaviour with the XML Device Information Settings, one of which is the option Indented which is defaulted to false (thus producing the compressed XML).
It looks like you can change this behaviour for the whole server by changing the RSReportServer.config file, or for an individual report by adding some query string parameters to the end of the URL.

SSIS Excel Destination with format

I try to export excel file with some format like:
Interior.Color
HorizontalAlignment
Font.Bold
and etc..
So the question is, can we do like that is SSIS..
and how to do it?
Not natively no.
If you always have the same output format you could create a formatted template spreadsheet, then make a copy of that to fill with data. I have seen this done before, the formulas and formatting were in the template, the SSIS job copied the template, then populated the copy.
SSIS is primarily a tool for moving data. Although it may be possible to write a script task or a custom component to do what you want, a better way would be to use a tool that is designed for presentation of data (a reporting tool, for example: SSRS) to do what you are trying to do.