SSRS report with different data - sql-server

I have an SSRS report where I receive a table of files which stuck in transition. In that table may be more than one user who should do some action. I want to create one report and change (using SQL query) the user for whom this table generated and send personalized reports to them. We are using MS SQL Standard 2014. So I've found a workaround on how to generate a data-driven subscription and it works fine. But reports which will send by RS still contain information for all users. I mean report which contains all people who should do some stuff is sending only for people mentioned in this report, not to all users in the base. Because of this, it's not usable and it really hard to find which files belong to you.
I'm stuck on the step: Is it possible for each iteration of running the same report to use different user names to generate personalized reports? For example except this, I want users will receive that.
For data-driven subscription I used this instruction.
I know the simple way is to create many reports for one user and trigger it, but I think it's monkey business.

Thank's to Tyron78. I tried SSIS and it 100% what I needed.
I've built a small workflow with SQL query and c# script. c# script generates pdf files and sends them to a list of users which emails users get from SQL query.

Related

Output Export to excel

We having SQL Server Management Studio , we had written several stored procedures in it. Currently we taking output in HTML and mailing to desired email id's. Now our requirement is instead of HTML we need to take output in excel and mail to desired Id's.
I would use the SQL Server Reporting services, and add subscriptions that send the created result by email as an Excel or CSV file.
Excellent question.
As Michael mentioned, you may use SQL Server Reporting Services (SSRS) to create a report that automatically sends the excel file to your chosen subscribers.
This might be an ideal solution if:
Your business unit would like the report to have specific fonts, color schemes, and column formatting as this is a user-friendly way to format the report and test as needed prior to adding on the email subscriptions. Of course, this depends on your audience and the way that the excel file might be used.
You have support analysts or specialists on your team that have been granted access to SSRS, but not necessarily SQL Server Management Studio. From my experience, granting access to one but not the other may lessen the liability of stored procedures or tables being written over, deleted, executed improperly, etc.
Your business unit frequently has changes to the subscription list, as you would be able to hand the responsibility of editing the list over to designated user-support team members rather than bogging down your SQL Developers.
However, if you'd prefer to create a stored procedure to send the emails or don’t have access to SSRS, then you should be able to use the Bulk Copy Program (BCP) command-line utility to generate a simple CSV file. Here are a couple of resources that provide further detail on this option:
https://www.red-gate.com/simple-talk/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/453c9593-a689-4f7e-8364-fa998e266363/how-to-export-sql-data-to-excel-spreadsheet-using-sql-query?forum=transactsql
If you have any further questions, please don’t hesitate to reach out! I’m always happy to help whenever I’m able.

How to access the data base behind IBM Cognos Report Studio

We are using the IBM Cognos Report Studio for Making the Reports.
And we have 1000s of reports developed and using.
Now i need to fetch all the SQL queries written in these 1000+ reports.
For that at present i am opening the report studio for each individual report and getting the query.
But it is very tedious job and taking months to get all the SQLs in these 1000+ reports.
So i am looking for a way to get all these queries from database behind Cognos studio.
Does these report parameters (including the SQL) store in a Database or only in Contentstore?
If it store in DB then is it possible to access the Report Studio in a Database tool like Oracle SQL Developer?
So that i can fetch all the SQLs in one shot from the database table.
Thanks for the help!
My experience migrating from one reporting product to another is like what you are asking. I think I had 7000 reports that I was aware of plus many reports sitting on workstation hard drives. At some point along the way we realized that the new product had different features than the old one, so report redesign was a good option in most cases. It took 18 months once we actually started working on the reports. That was to replace the 700 "standard" reports. Users were on their own (with support from IT and subject matter experts) for their custom work. I now have about 19,000 reports in Cognos.
Except where the report developer wrote SQL in a SQL object in the Queries area, Cognos reports do not contain SQL code. Cognos generates the SQL at runtime based on the report spec and user interaction (what parameters they set, what page the opened, etc.). Short of writing your own report spec parser, duplicating the work that Cognos does for you, there is no way I know of to generate the SQL.
One possibility: I haven't dug too deeply into the Cognos SDK. There may be a method there to generate the SQL for each report. Then you can do it automatically. Be aware that for thousands of reports you'll want to run this process during non-work hours. It could run for hours and may use a lot of resources.
Another possibility: Turn on native query logging (Cognos Administration | System | All dispatchers | | Set properties | Settings | Logging | Check the boxes for "Audit the native query..."). Then have a person, a product like those from Motio, or a Cognos SDK program you create yourself run every report. Then you can get the SQL from the Audit database. Of course, the problem here is answering prompts. It will probably take a person to run these.
To add two columns to a list, or two data elements to a report or page header or footer, or two filters (I don't know what you mean by "clause"), you'll want to use the Cognos SDK.
Choose relevant examples of different types of reports.
Examine the XML report spec for each of those reports.
Determine how to identify where the new element should appear in the XML.
Write a program (probably in C# or Java) to use the SDK to...
inspect every report in your environment.
determine which pattern the report fits.
add the data elements.
save the report.

Sharing SQL data through Excel spreadsheet

I was hoping to get help to find a solution.
I have an excel spreadsheet that connects to my SQL server and populates a spreadsheet based on a query i have written.
I want to share this spreadsheet with 10 users.
This is were the problem comes. In order to share the spreadsheet i have to remove the link. Meaning the connection to the SQL data is lost.
The database is frequently updated so need to keep the connection live. All 10 users might be in the spreadsheet at the same time working on cases.
Is there a way for me to do this as iv search high and low and cant find a solution. I am almost tempted to create a c# app that will allow me to do this instead of using a spreadsheet, Any suggestions will be very much welcomed
Thanks
Take a look at https://cirkulate.com. We are working on such a service that enables developers to go from SQL to automatically refreshing spreadsheets.
You'll only need to specify SQL that populate the cells, the refresh schedule(optional) and the recipient email addresses.
When the spreadsheet refreshes, all the recipients get the latest copy of the spreadsheet along with a snapshot of the spreadsheet in the email body, so they consume a quick snapshot within the email client.
Disclosure: Just to be clear about affiliations, I am the founder of Cirkulate.

Displaying Reports on SharePoint

First of all, I must say that I'm new to this. I'm a 3rd year ICT & Business student and an intern in a international company. My assignment is to create a reporting service on the company's intranet (SharePoint).
The company wants to have a section on the intranet where only managers can access. To give you an idea, lets say one of the managers wants a report like this:
"Show the names of the male interns who worked between 2012 – 2013".
And lets say the interface on the intranet is going to be like the image below.
http://i.imgur.com/eBZXP8t.jpg
Once the manager fills in the required fields and presses the button;
1.SharePoint is going to create the query,
2.SharePoint is going to ask for the data which is stored in the SQL Server,
3.SQL Server is going to send the data to SharePoint,
4.SharePoint is going to create an Excel File.
In order to achieve such a reporting system, where and how do you suggest me to start? Any links, guides etc. would be much appretiated. Even a general response would help me to understand the basics.
NOTE: Our IT department will handle the connections between the SharePoint and SQL server. I don't have to worry about that. All I need is to find out how you create a query on Sharepoint which will connect to SQL server and ask for data and display it on SharePoint (or Excel in this case).
Thanks in advance.
If you're not already, you need to use SharePoint Designer.
Create a new site in SharePoint. You'll need to manage the permissions as to prevent non-management from accessing the new site.
Open the new site in SP Designer. Bring up the Data Source Library (Data View > Manage Data Sources). There you can 'Connect to a database...'. I can't help you there. For this you'll need the DB connection string and you'll have to design a query that gets a super set of interns (to your example). You can then use filters to extract the specific intern. This also will take some exploring on your part.
You may be able to customize the SQL query using form elements but I haven't seen that done before. Typically the DB connection pulls down a data table and that is consumed by the web parts on the page.
Hope this at least gets you started...

User-friendly tools for retrieving data from a SQL Server database

We have several SQL Server databases containing measurements from generators that we build. However, this useful data is only accessible to a few engineers since most are unfamiliar with SQL (including me). Are there any tools would allow an engineer to extract chosen subsets of the data in order to analyze it in Excel or another environment? The ideal tool would
protect the database from any accidental changes,
require no SQL knowledge to extract data,
be very easy to use, for example with a GUI to select fields and the chosen time range,
allow export of the data values into a file that could be read by Excel,
require no participation/input from the database manager for the extraction task to run, and
be easy for a newbie database manager to set up.
Thanks for any recommendations or suggestions.
First off, I would never let users run their own queries on a production machine. They could run table scans or some other performance killer all day.
We have a similar situation, and we generally create custom stored procedures for the users to "call", and only allow access to a backup server running "almost live" data.
Our users are familiar with excel, so I create a stored procedure with ample parameters for filtering/customizations and they can easily call it by using something like:
EXEC YourProcedureName '01/01/2010','12/31/2010','Y',null,1234
I document exactly what the parameters do, and they generally are good to go from there.
To set up a excel query you'll need to set up the data sources on the user's PC (control panel - data sources- odbc), which will vary slightly depending on your version of windows.
From in excel, you need to set up the "query", which is just the EXEC command from above. Depending on the version of Excel, it should be something like: menu - data - import external data - new database query. Then chose the data source, connect, skip the table diagram maker and enter the above SQL. Also, don't try to make one procedure do everything, make different ones based on what they do.
Once the data is on the excel sheet, our users pull it to other sheets and manipulate it at will.
Some users are a little advanced and "try" to write their own SQL, but that is a pain. I end up debugging and fixing their incorrect queries. Also, once you do correct the query, they always tinker with it and break it again. using a stored procedure means that they can't change it, and I can put it with our other procedures in the source code repository.
I would recommend you build your own in Excel. Excel can make queries to your SQL Server Database through an ODBC connection. If you do it right, the end user has to do little more than click a "get data" button. Then they have access to all the GUI power of Excel to view the data.
Excel allows to load the output of stored procedures directly into a tab. That IMO is the best way: users need no knowledge of SQL, they just invoke a procedure, and there are no extra moving parts besides Excel and your database.
Depending on your version of SQL server I would be looking at some of the excellent self service BI tools with the later editions such as Report Builder. This is like a stripped down version of visual studio with all the complex bits taken out and just the simple reporting bits left in.
If you setup a shared data source that is logging into the server with quite low access rights then the users can build reports but not edit anything.
I would echo the comments by KM that letting the great unwashed run queries on a production system can lead to some interesting results with either the wrong query being used or massive table scans or cartesian joins etc

Resources