Displaying the data source in SSRS - sql

How do I return and display the data source in SSRS?
I've got multiple data sources in the report in addition to Live vs. Test systems. How do I output/display a string with the data source.

There's no built in function to get data source names in an expression.
Interestingly, you can use an expression to define a connection string. So you could use that same expression elsewhere on the report.
I was hoping there was a way to access them through Custom Code. The only approach I could find though is to query the Report Server database.

Related

How to pass Data Studio Controls to BigQuery custom query

I have the Data Studio Report in which I have Date and Task Controls.
I am using custom BigQuery and have already set the date Control via date between #DS_START_DATE and #DS_END_DATE but I also need to set Task in the custom query.
Note: I cannot use the parameter like Task = #Task because Task is a Control while adding parameter(#Task) is a completely different thing.
Update : The task is not a first-level filter. Somehow I need it to pass it in the subquery. I can pass the date in subquery via #DS_START_DATE and #DS_END_DATE but cannot do the same with Task.
Thanks in advance :)
Unless there is a specific requirement, your setup as it is should work. I'm assuming Task is a field in your data. When the report viewer picks one or more values from the Task filter control, Data Studio will send the query to BigQuery with appropriate filter clause. You can confirm this by looking at the billing project's query history in BigQuery.
Edit(since OP has a specific requirement to add the parameter):
Create a task parameter in your data source. (how to) This can be text or single select. If it is single select, you will have to manually define the values. Make sure this parameter can be modified by report editors.
In your query, add to the WHERE clause:
WHERE task = #task
Add the appropriate control in the report and link it to the task parameters.
This post has a similar example in the Creating parameterized custom queries section.

How to query access table with a subdatasheet that requires parameters

I have been tasked with creating a method to copy the contents of an entire database to a central database. There are a number of source databases, all in Access. I've managed to copy the majority of the tables properly, 1:1. I'm using VBScript and ADO to copy the data. It actually works surprisingly well, considering that it's Access.
However
I have 3 tables that include subdatasheets (to those that don't know, a subdatasheet is a visual representation of a 1 to many relationship. You can see related records in another table inside the main table). When My script runs, I get an error. "No value given for one or more required parameters." When I open Access and try to run the same query that I've written in SQL, It pops up message boxes asking for parameters.
If I use the query wizard inside Access to build the select query, no parameters are required and I get no subdatasheet in the result set.
My question is this: how do I write a vanilla SQL query in my VBScript that does not require parameters and just gives me the data that I want?
I've tried copying the SQL from Access and running it through my VBScript and that doesn't seem to do the trick.
Any help is greatly appreciated!
As it turns out, you need to make sure that you've spelled all of the field names properly in your source query. If you've included additional fields that aren't actually in the source or destination table they'll need to be removed too.

Finding which function cause the error message while processing a table

by processing (Process Full,Process Data) a table (every table) in my cube, I get the following error:
Failed to save modifications to the server. Error returned: 'A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
The credentials provided for the SQL source are invalid. (Source at XXXX;XXXX.). The exception was raised by the IDbCommand interface.
How can I find which function cause this error?
Query the $SYSTEM.MDSCHEMA_MEASURES DMV, which lists measures in a Tabular model. The Expression column contains the definition of each measure, and you can use this to find any measures that have the MAX function that was specified in the error message. SSAS DMVs can either be queried from an MDX query editor window in SSMS or another tool such as Dax Studio. Dax Studio contains a listing of DMVs, and if you don’t already use it I’d recommend looking into this. You here find more information on this here. You can also execute your
measure in Dax Studio, which can help with
debugging it. You will also want to verify that the account you’re using has the proper permissions on the SQL Server objects used by your Tabular model.

SQL Reporting 2008 and Excel as Data Source

I am working on a project were we need to develop SQL Reports based on some excel files.
I was able to create the ODBC for the Excel file and I was able to connect to it successfully using the Report Services.
My question is:
How can I used paramaters in the query ? When I try to use #CIF or #StartDate I get all kinds of errors and I don't know how to use parameters with SQL query for Excel.
Sample:
SELECT * FROM [Loans$] Where [CIF] = #CIF
Can anyone tell me how?
If you are successfully extracting information without trying to filter at the query level, as a workaround you can add the filtering at the DataSet level, something like:
This will extract data from the DataSet then apply any filter, not try to do it at the same time.
It's might not be addressing your root cause, but will hopefully get you up and running in the meantime.
Since you don't actually list the errors you're getting, it's hard to offer more specific advice.

ssrs one or more parameters required to run the report have not been specified

I'm having the error one or more parameters required to run the report have not been specified. The only thing is i've removed all but one parameter from my report and I have specified the value for that parameter. My guess is it's still looking for one of the parameter's i deleted from the report. How do I find that parameter value and get rid of it?
Replacing reports on the server often does weird things with the parameters on the server. The fix is to delete the report off the server and then deploy a fresh version.
One way this can happen is if you are using Shared Datasets and you pull in DataSets that your report is not using. Each report must define its own version of the parameters for each shared Dataset locally. So if you've included a Dataset as one of your data sources and you have not explicitly defined how this particular report will pass parameters to that Dataset, you'll get this error.