Replacing Crystal Report data source with store procedure - crystal-reports

I used to create crystal reports by going into database expert, selecting tables and specifying the link manually. As I get a bit more comfortable with CR, there is a need for me to put the underlying SQL query into a store procedure to provide data to the report. But doing so will require me to rewrite the whole report which is time consuming.
So, my question is if there are any guru in the community that could and/or have tried to replace the underlying SQL (created by manually add table and links) with a store procedure or cmd without having to rewrite the whole report? I would love to get some hint of how to do that as I have a couple dozen of reports that need "adjustments" and time does not permit me to rewrite them all.
My Crystal Report versions are CR 2008 and CR 2012.
Thank you in advance.

In case you can use an existing software : this feature is available in a free Crystal reports viewer. Here is the documentation, which explains the use :
http://www.r-tag.com/Documents/RTag%20DataSource.pdf
... and here is where you can get your free license:
http://www.r-tag.com/Pages/FreeCrystalReportsViewer.aspx

Crystal does an absolutely horrible job of migrating from many tables to a single DB object, be it a Command or stored procedure.
You might be able to Database | Set datasource location... to map your SP to one of the many tables in the report (choose the one that has the most fields in use); I've never been able to get this feature to work trying to map a Command to a table.
'Best practice' for a really-poor 'feature' set:
create a formula field for each field that will be on the canvas, but isn't grouped (these fields won't be removed when you change datasources)
add the Command to the report; link tables if desired
manually switch grouping, record-selection formula, sorting, etc.

Related

Adding second table field to report causes report to go blank - Crystal Reports 14.1.2.1121 using SQL Server Database source

I have a report pulling all fields from a single SQL Server table that works well. I need to add a second table to pull additional data, but doing so causes the entire report to go blank and number of records to drop to 0, from 242 without the added field from the second report. I have no grouping in the report either.
Reviewing Database Expert Links I see multiple links between the two tables, but the field in question, (CUSTPO_27, a String field), does not appear in the original table and therefore has no link. The field needs to be in the Details section of the report along with the data from the original table.
I have run Verify Database and get the "The database is up to date" message.
Running Dependency Checker finds no errors, even with the troublesome field added.
I am fairly new to Crystal Reports, but feel like I am missing a step to be able to see the second table field in the report, so any insight or direction would be greatly appreciated.
I would be happy to add code, but I don't see where to view the code in Crystal, (again, I am a newbie!)
Adding that field probably forced Crystal to join to a new table, and that join failed to find a matching record. So check your join logic.
Crystal doesn't update your database. It's Read Only.

How to find what tables are used in SAP Crystal Report 2013?

I am trying to debug missing data in an existing report.
I see the database it is connected to, but I do not find any table or stored procedure or view in that database with the same name that I see in the record selection part of the Crystal Report.
Is there a way to find which table/view/stored procedure is used as input for the Crystal Report?
Thank you
Never mind. I found it. Rt click on Database Fields and select Set Datasource location...
You need to set up first what type of connection you need.
This will help you using ODBC connection.
Ideally you can set this when first time confiugre the data, but suppose if you update the table or procedure and that will not impacted in your crystal report.
To update the updated db element / object in crystal report, simply "Update datasource" option click which pull the changes and update in crystal report.
May be helpfull in future.

Crystal report that auto-emails to vendors in Parameter

This is a little bit of a stretch, but we're trying to convert old reports in an increasingly unstable Access Database and I have a question.
Here's what the report does in Access currently:
The user gets prompted for one of our many Suppliers in a drop down style list
Once the supplier is entered, that Suppliers list of parts will be populated
The report then pulls an email address from our system (IFS) and emails the list that has been populated to the email in our files.
We've made a SQL Query that will pull in the information that we need to replicate the report, but we're at a sort of cross-roads with how to get it to automatically go through the list of Suppliers that are in the Parameters and send off the email to them all automatically.
Would there be an easier way to do this in Crystal Reports (2011) besides automating the report and selecting all the parameters manually or in Oracle SQL Developer through maybe a WHILE LOOP?
Thanks in advance, and if you need any more information, I'll try and clarify!
This looks like a data driven report ( publication). You will run a query to retrieve the list if suppliers and their emails then run a report for each record returned by the query. Let say you have a report , which accepts a parameter SupplierID and the query returns data like this
SupplierID SupplierEmail
ID=1 email=supplierA#mail.com
ID=2 email=supplierB#mail.com
ID=3 email=supplierC#mail.com
The software will get row #1 and will use ID=1, as a parameter for Suppliers report, will export the report and will send the exported file to supplierA#mail.com. Then it will move to the next row and will use ID=2 as a parameter for the next run of the same report, export it and send it to supplierB#mail.com. The same will happen for row #3. You can check also this video, which demonstrates the proces: http://www.r-tag.com/Pages/Preview_CreateBatchJob.aspx .
Because the values for report parameters, emails etc are returned by the query this approach is known as data driven report ( publication).
Data driven publications are available in SSRS if you own SQLServer Enterprise license. There are other types of software who support them. The sample video above is from R-Tag, which could be useful too and supports SSRS, Crystal reports and SQL Ad-hoc queries. If you use Ad-hoc query you can export suppliers data to Excel without creating a special report.

How can we use INSERT and UPDATE statements in iReport?

Actually I am wondering how can we use Other Data manipulation statements like INSERT and UPDATE statements inside iReport designer. I have been searching the solution for very long time but could not find anything which can actually help me.
I know even in Ireport I cant use multiple select statements separated with " ; ".
Is it possible to use these statements in Ireport?
IReport is for report creation only. If it can execute insert or update to database then its no longer for report. A report is something that presents meaningful data based on the user requirements. Whatever data you pass them, it can only format it, add some cosmetics, then make it printable. If you need something that inserts or updates data to the database, IReport is not what you want, but a software itself.

Crystal Reports Subreport - Selecting data based on column clicked

I have a number of reports with current and ytd columns(summary totals by salesman). I want to be able to select the sub-report based on the column clicked. I have one sql procedure that selects current and one that selects ytd. I want to use the same report format (without having to copy and modify it) for current and ytd. Is there anyway of identifying what column is clicked?
Crystal Reports is pretty much just a reporting tool; it's not very interactive.
I'm more familiar with older versions of Crystal Reports, but as far as I know there aren't any onClick methods for columns that can be trapped using pure Crystal Reports.
Depending on how many columns you have, you can create a subreport for each column, but that may be prohibitively slow if you have a large number of columns you want to create subreports for.
If you're using C# or VB.NET to generate the report, you may have more options, but since the question isn't tagged with any programming languages, I'm going to assume this is pure Crystal Reports.