I am using crystal reports 2008 and my req is If i select a parameters (like it be %) then it should use a different view if it is not the it should use the same view cn I do that using a query. in Crystal reports
I don't know a way to do this in Crystal. Perhaps in .net. If you use an application like Millet Software's Visual Cut to schedule, run and distribute your reports you can set it up in such a way that the method call that triggers the report job has the ability to override the default connection parameters. That itself can be a variable too - override or not based on certain criteria.
I've deployed it in a way that uses 1 report to recursively connect to a list of different (but same schema) databases to run versions of the report, one after the other.
FULL DISCLOSURE
I do not work for Millet Software, I do not receive referral bonuses and I do not receive a reseller bonus. I simply have had great experience with them and wanted you to be aware of the possibility, not solicit your business.
If you are using database, which supports scripts or stored procedures you can do this using a command or a stored procedure. Inside the script check the value of the parameter and call one or another query.
Sample code for SQL server will look like this:
if CHARINDEX(#Parameter,'%')>0
SELECT * FROM View1
ELSE
SELECT * FROM View2
Related
I need to make identical changes to hundreds of reports, and I was hoping to do this via SQL instead of each indvidual report and it's query. I can extract the report query via xml and generate my list of reports, their location, and the query being used. But what I cannot figure out is how to update the report query and then get that updated back into the Catalog? database so that the report itself reflects the changes when executed? I have never seen where this is possible, but maybe someone on here has tried to do this or knows that it's flat out not possible.
I could use SSIS and do this, but I would prefer not to download all the RDLs and then update, and then redeploy/upload the reports. Was hoping to update in place the reports/RDLs.
You shouldn't have to download the RDLs, they should already be in your source control system, and ideally collected and grouped into project(s). If so, you are in luck - you can use the global search/replace capabilities of Visual Studio (BIDS) or Notepad++ to make your change.
If your change was to the structure of the report then you could simply write a quick nasty console app to load the RDL and manipulate the XML structure. But things like the report query are held as free-form text in a node, making it harder to apply mass updates in a reliable way.
You could look to refactor the report queries into stored procedures and/or functions, this will make future updates a bit easier. In any case if you change the report RDLs you've got no option but to republish the modified ones - there's no such thing as an in-place change on the server (having your queries as stored procedures would have avoided this issue).
I am not sure if this is even the right site for this but I'll ask anyways.
Does anybody know a program that can create a PDF with data from a database with a complex SQL statement? When an employee finishes a request for a customer, I want that the program is triggered by the new entry in a database table and fills out a pre built PDF with data that it pulls from a database.
It needs to be a complex program that can process big SQL statements.
The only thing you can do to run custom code in SQL Server is to create a CRL Stored Procedure and a trigger to start PDF processing in your specific use case. You can write a class library that connects to the database you are triggered from using a specific keyword in the connection string. You can pass in the key you need to use to select the whole dataset you need to fill the PDF as a SP parameter.
https://msdn.microsoft.com/en-us/library/ms131094.aspx
In the class library you can reference third part libraries to interact with an editable PDF and fill the flieds you need with the data retrieved from the database. I suggest you to have a look about security concerns releted to CLR use in SQL Server. Basically your code runs within the SQLServer.exe process, sharing resources and access privileges.
https://msdn.microsoft.com/en-us/library/ms131071.aspx
SSRS can produce PDF. See if that table insert trigger can call a CLR that in turn will execute the report that can even be attached to an email.
The report can be as complex as you need, so long the report SP can populate the data based on the newly inserted row.
For stability, let's not have a trigger, but the insert process itself should be done in an SP, in which that insertion SP shall call the CLR.
Further, instead of using CLR, we can use SSRS Data-Driven Subscription. When making the Subscription, we can make it as a one time scheduled Job. The SP can invoke this 'expired' Job from SQL Server Agent by using sp_start_job.
Hi I have question is there any way to automatically execute SSRS reports for example user goes to ssrs and put some parameters to execute reports and exports them in excel and pdf . Is there any way to avoid human interaction and automate the whole process or any job in C# code runs automatically reports and exports them in format.
Regards
A Reporting Services subscription is a configuration that delivers a report at a specific time or in response to an event, and in a file format that you specify. For example, every Wednesday, save the MonthlySales.rdl report as a Microsoft Word document to a file share.
Subscriptions can be used to schedule and automate the delivery of a report and with a specific set of report parameter values.
You can create multiple subscriptions for a single report to vary the subscription options; for example, you can specify different parameter values to produce three versions of a report, such as a Western region sales report, Eastern region sales, and all sales.
FROM: http://msdn.microsoft.com/en-us/library/ms159762.aspx
And for how to configure a subscription to deliver a report by e-mail, check here http://technet.microsoft.com/en-us/library/cc872783.aspx
And if you need to do programmatically, you can start here http://www.codeproject.com/Articles/36009/Programmatically-Playing-With-SSRS-Subscriptions
If you don't want to use subscriptions, you can write your own program in C# to pass the parameters and render the report and save in whatever format you like. Then run this using Windows scheduler or however you want to.
It is quite easy and Microsoft have some example code to get you started.
I am looking at a sql server database for a tfs 2010 install and I am trying to find bugs/files logged by date.
Is this information contained in the database?
I see other information such as a view named WorkItemChanges which shows all the stories that have been changed by date.
* Directly querying the collection database is unsupported *
The Tfs{YourProjectCollection} database contains all work items for a specific project collection. They live in the different Work Item tables, since a bug is a specific type of work item.
If your TFS environment is configured for reporting using Report Server, then you can use the Analysis cube or the TFSWarehouse databases to query this kind of information. For work items, a limited set of fields is stored and the same goes for files in source control. You should at least be able to find out which have changed. The following doc describes the warehouse structure: Creating, Customizing and Managing reports for Visual Studio ALM. A quick way to get started is from the Excel Powerpivot reports which are installed to your team project by default if your TFS instance is connected to a Sharepoint server with teh appropriate features enabled.
* You have a number of alternatives *
I suppose that your Visual Studio is currently working, if that's the case then there is no need to use a SQL query to get to the information you're after.
To query all bugs (or other work item types) that have changed between two dates, create a work item query (in Visual Studio) that looks like this:
You can import these into Excel for easy manipulation or further aggregation. And you can even quickly create a Report from that. More information can be found in the Bulk Add or Modify work items in Excel.
To query all files changed between a specific date range, is a little harder. You can quickly get all changesets between two dates using the commandline using tf history $/Project /collection:yourprojectcollectionUri /recursive /version"D2012-10-10~D2013-10-10" this will popup window with all changesets between these dates. You can specify /noprompt /format:detailed to dump all details to the command prompt window.
Alternatively, you can do a folder diff between two dates. This can be done from the UI in the Source Control Explorer. Or from the commandline using tf diff or tf folderdiff
I have many SQL Server databases, each with a few tables containing important (from my point of view) information. I check the data (retrieving for example maximum or minimum value) within those tables using T-SQL queries.
Since I don't want to create views for each of the databases, I'm thinking about most convenient, easier and simply the best way to prepare summary which will be updating each time when opened.
The output file (or web page) will be used internally within technical team. All members can log into database using Windows authentication.
My idea was:
Excel + dynamic T-SQL --> I want to connect to database and execute T-SQL (cursor will go through all database names)
PowerShell (showing table using Out-GridView cmdlet)
PHP - first I will ask about all database names (executing select name fromsys.databases` and then execute query for each DB)
What is in your opinion best way? Do you have any better (from programmers point of view) way of getting such report/data?
You can use SSRS Reports .You have the options of exporting the report data to several formats such as pdf ,excel ,word .You can create a dataset for all your database .Since you are interested in showing aggregation and summation of values ,SSRS reports will be pretty useful in these cases .