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.
Related
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.
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.
I have several SSRS reports that need to be transferred to another server. Currently, all reports and SSRS reside on the same exact server as SSMS and all databases. I was wondering if there is a simple way to essentially take everything I have on SSRS (All Reports) and transfer them along with their data sources to the new server that I have. I know downloading all reports and uploading them to the new server is an option but I was wondering if their is an easier/more logical way to go about this process. After completion, SSRS and the SQL Server will be on different servers but still able to work together.
I have had really great experiences with an old (2007) program called "SSRS Scripter" (from Jasper Smith). It seems like it has been absorbed into a newer product called SqlServerFineBuild (which I have never used). The original stuff is a little hard to find, but very nice to work-with, imo.
Microsoft also has another product called Reporting Services Migration Tool (free) https://www.microsoft.com/en-us/download/details.aspx?id=29560 It is a command-line util and isn't the easiest or most-helpful. It has a UI-mode, but it isn't very user-friendly.
Both of these will only extract report files and settings from an existing site. You still need to use VStudio (+ reporting add-in) (and then some RS project work/design/config) to re-deploy.
We are a development firm integrating Crystal Reports 2013 into our software. I need the ability to remove the database name from the SQL Query generated by Crystal Reports. We have customers running multiple instances of our software using the same data server. So we need to remove the database name so when it connects it uses the database specified in our file.dsn for an ODBC connection. We are using SQL Server as our data source. Any help would greatly be appreciated.
It depends on how you're using Crystal (this answer may or may not apply to your scenario). If you're using the .Net objects (in VB or C#) and programming against them you can switch out your connection information programmatically. It is finicky about the order in which you do it (e.g. you need to change the connection in the report and all sub reports, etc.).
I have two blog posts that have VB and C# with them that address changing database/connection dynamically through code, they are a few years old but they should still apply:
http://www.blakepell.com/2012-05-22-crystal-reports-extension-methods
http://www.blakepell.com/2010-09-17-crystal-reports-changing-the-database-connection-from-net-subreport-links-and-the-case-of-the-missing-parameter-values
On a side note, if you don't like the SQL that Crystal Reports generates you can always use a "Command" where you input your own SQL and then Crystal treats it kind of like a table (or you can take the SQL it generates to get your started and alter it to your liking, copy it, change it, then create a command with it).
Crystal reports uses that query for generating the schema for the report which you can change the connection or change the query inside the code of software but the schema should be the same,
perhaps you are not setting the connection of report by code successfully, you have to set the parameters and change the connection inside the code which loads the report if you do this successfully then you'll see the report.
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