I'm trying to share a set of parameters with several reports.
Is it possible to do that?
I currently have to create a set of parameters for each individual report. This creates duplicates of the same data, and makes it harder to maintain.
I am using SSRS 2008 R2.
Any help or direction on this would be greatly appreciated.
Thanks (^_^)
no, it is not possible because the parameters are directly linked to reports, like data sets. There are, on SSRS 2008 R2, shared data sets, the same way you have shared data sources. Maybe with them, you could try to do something like that (don't known, just guessing)
Related
Is there a way to automatically generate stored procedures out of the t-sql in the datasets found in an ssrs project?
There's not an automatic way to do this. You might be able to cobble something together to do it though. SSRS reports are in an XML format. The Datasets are in a < DataSets > element.
Unfortunately, I don't know how helpful it would be since the parameters would need to be resolved.
Someone created a Powershell to retrieve the dataset definitions from a report if you want to try to automate something. I think it would still need manual work to convert them - especially if they use parameters or have calculated fields.
https://ask.sqlservercentral.com/questions/94491/retrieve-dataset-definitions-from-ssrs-report.html
We create several crystal reports based on SQL Server - usually 2005 or 2008. Broadly there are 2 kind of reports
a) tabular reports - which shows some data in a table (for example, invoice list)
b) document layouts - which shows data in specific format - usually from one or two main tables - and several secondary tables (for example, invoice)
We sometimes use tables directly in crystal. Or create a procedure in SQL and than use that procedure. One invoice could refer to usually around 10-12 tables. Most of these linked using left outer join to the primary invoice table.
What option is better - using tables in crystal (and let crystal create and run the sql query) - or create a query - and than use that query in crystal. Which one will give better performance?
There will be no difference in performance between a query generated by the 'Database Expert' versus the same SQL added to a Command. One caveat: ensure that the record-selection formula can be parsed and sent to the database (a filter applied WhileReadingRecords will definitely be less efficient that a pure-SQL one).
Reasons to prefer the 'Database Expert':
prior to v 2008, Command objects didn't support a multivalued parameter
easier to manage (somewhat subjective)
Reasons to prefer a Command:
you can add hints
you have more finely-grained control over the SQL (e.g. in-line views, CTEs, more-complex JOINs, subselects)
Personally, I try to avoid stored procedures as they offer minimal performance benefits, but require a more-signification investment in development and maintenance.
In the end, there is no substitute for performance. Try you query both ways and measure the results.
Coding it yourself will almost invariably run faster -- after all, you know what your data looks like, and Crystal doesn't. Also, there are things you can do in manual queries (windowing functions, for example) that Crystal can't.
Crystal had tendency to do some crazy stuff behind the scenes. You can view the "Show SQL Query" under the Database menu options to see what it creates. If find it easier to write the query in SQL as I can optimize it myself much easier. I also prefer to do any calculated/formula fields in SQL to and just use Crystal as a display interface. If you do put logic in crystal remember that it is running that logic for every record returned... so if there are conditions that exclude a record from a formula put that first to limit the time spent in the calculation.
I need to kept track of every time a report is printed on crystal.
If I can write some information from crystal to a data base this may be possible, but I'm almost sure that this can not be done.
Please let me know your thoughts.
Thanks
I suggest modifying the (C# ?) programs you are calling Crystal from, to write the desired information to the database.
Crystal Reports itself can't log this information, but if you were using one of the vendor's scheduling / distribution tools (such as Crystal Enterprise) then they would log this information inside their own databases.
The only way I can think of would be to set your report datasource to a stored procedure and include an insert statement to a log table. Generally I would say 'Reports are for reading, not writing to a database' but you asked.
We have several reports that do the same formatting operations (e.g. displaying "PASS" or "FAIL" if a value is within a particular range.)
Without Crystal Reports Server, is there a way to share functions between reports so that they do not need to be duplicated? I understand I could do this with a user function library but I would prefer not to port all of the crystal functions to UFL.
Using Crystal Reports 2008.
The only other option I know would be to port the functions to Stored Procedures or Database Functions. This is actually a better implementation (in general) as the Crystal Reports Client Processing is much slower than the SQL Server. so your pass or fail would become a function or stored proc or even the use of a case statment in the Select Query.
Good rule of thumb with crystal reports, flatten out the dataset as much as possible before returning the dataset to Crystal. This will allow you to use the power of the Database server before relying on the Client to handle the processing. The perfect example is to return 1 million rows to the client but flatten it out to only displaying totals from 5 groups. Crystal will choke on the fetching of 1 million rows before it can process the totals.
I recall that earlier version of CR support the notion of a shared repository in addition to the repository that is available via BusinessObjects (nee Crystal Decisions) Enterprise.
I haven't found any mention of similar functionality (meaning a shared, non-BOE repository) in version XI+.
I really want to know your experience at working with ADO.Net datasets (calling stored procedures from SQL) and Crystal Reports, I know about the 2-4 seconds to
CrystalDecisions.CrystalReports.Engine.ReportDocument document = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
document.Load(file);
but what about the load of each tableadapter is there another way to work with Crystal Reports? Maybe with LINQ
Thanks in advance
I have used DataSets with Crystal. In general I do not like to allow Crystal Reports to fetch its own data as we have had errors with it opening too many connections to the Database. I usually create a DataSet and serialize it to XML with the schema and use the xml file as the ADO.Net "DataBase" for design purposes and then at runtime I assign the DataSet to the Report
Dim rd As New ReportDocument
rd.Load("SomeReport.rpt")
rd.Database.Tables(0).SetDataSource(dataset)