Access dataset version tag programmatically - palantir-foundry

I would like to be able to add a column to the generated datasets that contains the version number of the dataset. The dataset version tag being present in the dataset itself will let them track applications that use this dataset (even if they use the dataset outside Foundry) and reproduce results in these applications by always being able to access the original dataset version used to create them. Is this possible?

Related

Added field to report causes report not to be shown

I need to perform a small change to a report running on an old version of MS-Access (2007). The report is based on a simple SELECT statement which, when running it directly vis-à-vis the DB (SQL Server Management Studio) it generates the required data.
A new field needs to be added to the same report and hence the original query was updated to include the new field. Again, execution of the query vis-à-vis the database yields the desired result (including the new field of course).
The new query was deployed into the report (replacing the old one).
Now, I added a new element to the report and set the source of its value to be the new (added) field, which appears in the list of available sources.
The problem is:
When I set the new field as the source of the added object, the report is not generated at all (no error messages are shown either),
If I leave the source of the field as blank, the report is generated (though the new element is shown empty of course),
If I set as the source of the new element any other field shown in the list, the report is generated and the value of the field is being shown correctly.
Can anyone suggest how and where to search for the issue? For instance, try to breakpoint at the opening of the report (if that part of the code is accessible at all).
Unfortunately, I cannot share code nor screenshots (company policy).
Thanks in advance.

SSRS change default DataSet

I have an SSRS report with a dataset from a certain database. I've gone to the trouble of creating a query that (hopefully) imports the data from a more accurate source. What I want to do is potentially delete the first source, and then use the second source. However the only thing I've found online tells me I must:
=First(Field!MyField.Value,"Better Source")
I really just want to try to switch everything out.
If you added a new/replaced the current DataSet with the new query, you can change the column names to match the ones in the current Tablix/Matrix (the same Aliases/names within the Query Designer).
That way, your fields will be within the DataSet and you will see Fields!Myfield.Value instead of First(Fields!Myfield.Value)
Let me know if that helps

SSRS -> Using code function to create my query dynamically, how do I get at my data (put data into table)?

I am not a seasoned SSRS veteran. I have made quite a few but they were pretty simple.
Today, I am attempting to use the Code tab of the Report Properties to perform some vb functions that will return my query in a string. I am passing in date parameter that is used to create my dynamic query.
My problem/issue is that I do not know how to pull this information into my table.
I have seen instances where a developer calls from each individual field and it calls the code to get a specific field. I was under the impression that I could somehow use a dataset to do this and have some documentation on this, but can't seem to find anything on the web regarding how to do this.
This is probably a pretty poorly written question, but does anyone know how to do this?
I was thinking in the Dataset Properties, I would code something like this in the expression field.
=Code.GetReportDetail(Parameter!InputDate.Value)
GetReportDetail being the starting function within my code window.
I am having difficulties how I can then pull that dataset into my table from that point though.
Any advice on this is greatly appreciated....Thanks.
After further review, I was creating this in VS2010 for RC0 2012 SQL Server, which I should have noted above.
All you have to do is create your report by adding new item (Report). Add your code by right clicking in the pink area and going to Report Properties and pasting your code into the code tab.
Next when you pull a table into your "add item to the report / white space" It allows you to create your dataset.
I chose use dataset embedded in my report. Datasource of OLE DB because I am doing MDX. Query Type Text then in the function I pasted this. (omitting parameters for now) :
=Code.GetReportDetail()
I then filled in fields manually because it seems that dynamic query running does not pull in fields.
I was then able to reference these manually created fields via my table detail row.

How do I re-use reports on different datasets?

What is the best way to re-use reports on different tables / datasets?
I have a number of reports built in BIRT, which get their data from a flat (un-normalized) MySQL table, the data which in turn has been imported from an excel sheet.
In BIRT, I've constructed my query like this, such that I can change the field names and re-use the report:
SELECT * FROM
(SELECT index as "Index", name as "Name", param1 as "First Parameter" FROM mytable) t
However, then when I switch to a new client's data, I need to change the query to the new data source and this doesn't seem sustainable or anywhere near a good practice.
So... what is a good practice?
Is this a reporting issue, or a database-design issue?
Do I create a standard view that the report connects to?
If I have a standard view, do I create a different view with the same structure for each data table, or keep replacing the view with a reference to the correct data table each time I run the report?
What's annoying is the excel sheets keep changing - new columns are added, and different clients name their data differently. Even if I can standardize this, I'd store different client data in different tables... so would I need to create a different report for each client, or pass in the table name to the report?
There are two ways and the path you choose is really dictated by how much flexibility you have architecturally.
First, you are on the right track by renaming your selected columns to a common name since that name is what is used to bind the data to the control on the report. Have you considered a stored procedure to access the data? This removes the query from the report and allows you to set up the stored proc on any database to return the necessary columns. If you cannot off-load to a stored proc, you can always rely on altering the query text at run-time. Because BIRT reports are not compiled (they are XML) you can change the query based on parameters and have it executed for each run of the design. Look at the onCreate event for the Data Set and you can access this.queryText and do any dynamic string substitution you need via JavaScript. Hidden parameters are a good way to help alter/tune the query. If you build the Data Set correctly, the changing of the underlying data could be as easy as changing the Data Source and then re-associating the Data Set to the new Data Source (in the edit data set window). I have done this MANY times and it works well. If you are going down this route, I would add the Data Source(s), Data Set(s) and any controls that they provide data to a report library. With the library you can use the controls in many reports and maintain them in one spot. If you update the library, all the reports using the library get updated as well.
Alternatively, if you want to really commit to a fully re-usable strategy that allows you to build a library of reusable components you could check out the free Reusable Component Library at BIRT Exchange (Reusable Component Library). In my opinion this strategy would give you the re-use you are looking for but at the expense of maintainability. It is abstraction to the point of obfuscation. It requires totally generic names for columns and controls that make debugging very difficult. While it would not be my first choice (the option above would be) others have used it successfully so I thought I would include it here since it directly speaks to your question.

Column headers from different dataset in MS Reporting Services

I basically need to load table headers from one dataset and table data from another. Is it possible to do with MS Reporting services?
As I can see table is associated with the data by DataSetName property and it can be only one dataset.
You can include data from a different dataset to the one linked to the table by including the dataset name in the expression, for example:
=First(Fields!HeaderField1.Value, "HeaderDataset")
If the dataset isn't dynamic, then you can manually define the dataset (or edit it) Ctrl + alt + D (I think) should pop the dataset window open (in RS2005/2000) failing that I think it's under: view - other windows
I have used this where a stored proc uses temp tables and RS is unable to determine the final dataset structure correctly.