How to let end users customize report chart in SSRS? - sql

i am working on sql server business intelligence to generate reports. i did all the staff that i want to be in the report except the ability for the end user to customize the report without making another request to the server to generate another report based on another request. first i did this through a parameter of type Boolean and wrote an expression to check the parameter before generating the report,but my project leader said i don't want to make a request each time instead i want to bring all possible data and let the end user decide what to show.
in other words, my report contains a chart of three series i want the end user have the ability to show a set of them or all of them in client side + one request.
how can i do it through sql server business intelligence 2008

What is Your SSRS project based on ? SQL Server DataBase or SQL Server Analysis Service ?
AFAIK you can design the SSRS report with many conditions which the end user can input their own value in .
if It's based on SQL Server DataBase the conditions looks like parameters of procedure that you use in SSRS
if it's based on SSAS , The conditions looks like MDX code

Related

Dynamic generation of SQL statement for Power BI Desktop ODBC data source (triggered by refresh-on-open or by button)?

Is there mechanism for online generation of SQL statement for Microsoft Power BI Desktop ODBC data source? I.d. maybe Power BI has some events attached to the datasource, e.g. beforeOpen, beforeRefresh and I can write Visual Basic VBA (DAX? M?) code in the handlers of those event and with this code I can modify the SQL statement?
My question is connected with How to use parameters (e.g. for Firebird) in the SQL statement (optional) that defines ODBC data source for Power BI Desktop - it is quite hard to ignite use of parameters with ODBC and Firebird and hence it is my thought to avoid parameters at all and istead generate SQL code completely and then this code-generating VB code can read parameters (current date, from user input) and adjust generted SQL accordingly.
Additional Information I can import data from the static query and then Power BI created query components in the Model pane. When I choose 'Edit Query' menu item/command, then the Power Query editor opens and I have the opportunity to update the M code which is:
= Odbc.Query("dsn=MY_ODBC_SOURCE", "select s.sale_date, s.amount from sales s where s.sale_date>='01.07.2021'")
I can edit there the sale date parameter and refresh query data.
So, my question boils down to the other question: can I create button in Power BI, that does those 2 things: 1) programmatically edit the Odbc.Query("") source code (by passing parameter values from the controls of the Power BI form); 2) programmatically refresh data?
Additional information Article https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/ details the definition of Power BI parameters. Maybe those parameters can be accessed from the DAX/M expressions that define ODBC query/data source and that can be edited from the Power Query Editor? Those parameters can simple numerical values, but maybe whole parts of custom SQL can be encoded by such parameters or derivations. Currently, though, I don't see how to use Parameters in Power Query.
The overwhelming majority of PowerBI reports would simply import all the data and filter/sort it once it's loaded into the DataSet.
You can manipulate the SQL statement in M by creating a Power Query Parameter, and pasting the parameter value into your SQL statement.
But you must refresh the Data Set for any change in the parameter value to take effect, as the SQL Query only runs during a data refresh. That's why the normal practice is to import all the data and filter it in the DataSet.
You can interactively filter the source data if your Data Set is in DirectQuery mode, but you have to be using a data source that supports DirectQuery.

Teradata SQL & cognos. How can I customize Cognos to accept a customized & more efficiently performing SQL

RIght at the outset I'd like to say that I am NOT a Cognos Guy .So I have totally disconnected myself from developing cognos cubes / reports whatever you want to call it.
There are COGNOS queries auto generated - very badly written that will cause the Teradata ( DBS 15.1.x ) system to Hog on spool & CPU . I can tune them beautifully after I pull them out from DBQL. I want to know HOW can I implement Custom Queries that can be run periodically as batch reports instead of Cognos auto-generating these queries.
E.g. You create a cube - its writes code behind it and then you can open the code and write custom code that is equivalent to the original code but performs a lot better. Then when you open the cube again - it remembers there is a custom SQL and runs that instead of its own auto generated SQL . This is just how I imagine one way it can do it but again- I am not a cognos resource so pl dont flag me down for lack of knowledge. That is exactly what I am trying to get an idea about
Thanks for bearing with me
In Framework Manager you can create one Query Subject with complex query inside. Do not import tables etc. Just create QS in put your query inside.
You need to use stored procedure to return your expected data and add it to Model.
Then instead of using couple of tables in Cognos report studio (and joins), add one query and point it to your stored procedure. This way your Cognos report will execute the procedure instead of generating query (which may not be efficient in many cases)

Reuse of SSRS Report parameter

I am new to SSRS, I am creating a report which will take ID's as parameter e.g. 1,2,6,7,8,9 and so on. This parameter will be used for multiple reports. As a good practice I am thinking the user should not enter the ID for each report. Once entered/selected the ID parameter should be persistent for all the reports.
I am using Visual Studio 2008 to create the report and SQL Server 2008 R2 for backend scripting.
This can be done in an elegant way, but requires some work on the back end database.
If your reports are executing stored procedures, you can have the stored procedure for each report write the user's choice of a parameter to a table. Then the next report can check that table for a value. You could design this to be user specific, time-dependent, etc., depending on the effort you put in. It might be cleaner to set the parameter in a separate dataset. That is, in each report, you have multiple datasets. One grabs the parameter value, and your report parameters will default to that result. The other report data set can display the "main data."

Crystal Reports - how do I find which reports are being used?

I need to find out which of our Crystal Reports users are actually running, so we can get rid of those that are no longer being used. I can do some kind of query of the latest jobs run on the SQL server as described here:
How to get the last run job details in SQL
However I'm not sure how I could tie that back to the actual reports. I've tried opening a Crystal Report in Crystal Reports 2008 while running a trace on the SQL server using SQL Profiler, however I don't see any database calls in the tracethat would allow me to determine the name of the report being run.
How could I find out which Crystal Reports are actually in use?
I usually embed a unique identifier (the report's name or ID) in either a sql-expression field or the command's query.
If the DBA finds an issue with a given query (e.g. non-performant), this approach easily identifies the source.
SQL-expression:
//{%report_name}
(
'Daily Obstetrics Review [OB003]'
)
In the command:
SELECT 'Daily Obstetrics Review [OB003]' AS REPORT_NAME
...
FROM ...

Variables to input in file name for Reporting Services subscriptions

Is there a list anywhere that lists all the variables I can use in file names for report subscriptions from within SQL Server Management Studio? I currently use #timestamp in my file names, but would like to use other options or even remove parts of the time stamp (for example, just use the date, not the time).
Unfortunately #timestamp is the only variable available. There are various workarounds for formatting #timestamp, but nothing that is simple. Here is a thread that explains one (but not the only) workaround:
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/81f47009-946a-4ebc-be43-7690236e829b
In case that link goes away, here were the recommendations:
To solve the issue, I would suggest using Data-Driven Subscription
A data-driven subscription provides a way to use dynamic subscription
data that is retrieved from an external data source at run time. A
data-driven subscription can also use static text and default values
that you specify when the subscription is defined. We can use
data-driven subscriptions to do the following:
Distribute a report to a fluctuating list of subscribers. For example,
you can use data-driven subscriptions to distribute a report
throughout a large organization where subscribers vary from one month
to the next, or use other criteria that determines group membership
from an existing set of users. Filter the report output using report
parameter values that are retrieved at run time. Vary report output
formats and delivery options for each report delivery. .
In this case, we can define the filename with timestamp in database
and then use Data-Driven Subscriptions to delivey the report.
For more information about Data-Driven Subscriptions, please see:
For SQL Server Reporting Services 2005:
http://msdn.microsoft.com/en-us/library/ms159150(SQL.90).aspx
For SQL Server Reporting Services 2008:
http://msdn.microsoft.com/en-us/library/ms159150.aspx