Add SQL command to report - crystal-reports

I want to make a Crystal Report based on a SQL statement. I've read to do that, you add a command to the report, and to do that you have to connect to a database.
When I click the browse button I get the following screen:
Based on my research, it seems you connect to a database. As seen above, all of the file types are .xml files and all that shows up is Dataset. After I click on that, and right click on the dataset name node, the Add Command to Report is greyed out:

Normally you'd be able to add a custom SQL command by right clicking Add Command and selecting Add Command to Report However ADO.NET requires some unique steps in order to add the custom SQL. Instead you'll want to navigate here:
Create New Connection → OLE DB (ADO) → Microsoft OLE DB Provider for SQL Server
You'll of course supply the server information and pick the database.

After adding the connection:
1) Click the plus sign next to your connection.
2) Double-click the "Add Command" node.
3) Type in your SQL query, click ok.
Source: Crystal Reports 2016 Online Help chm file.
HTH,
aEon'

Related

Correcting Crystal Report Data Sources -- Tables not following Server

Been struggling with this on a few Crystal Reports, and it's super evident when testing inside of the CR editor.
My report has one database connection (OLE DB to a a SQL Server). On the vast majority of my CR's, when I hit F5, and log into the SQL server for a data preview, the rest of the report will follow whatever database I select.
On some reports, it does not--and the tables in the underlying connection are stuck to a specific database.
Is this a setting within Crystal Reports for the tables below a connection to have their own "Catalog"?
I've found I'm able to correct this somewhat by changing each of the tables Catalog's manually, but I use these CRs against multiple databases.
Has anyone encountered this, and hopefully found a way to fix it without re-creating the report from scratch?
Try to verify the database. If this doesn't help try to update the connection to ODBC and back to OLDE DB.
Something else to try would be to click on Database in the menu bar, then click "Log On or Off Server". This will allow you to select a database server that the report is connected to and then Log Off from that connection, repeat this for all connected databases. Then click Database on the menu bar again and then click "Set Datasource Location" to update the report with the database you would like to use.
This usually works for me:
right click on database fields and left click on set datasource location.
some times you will need to update every table.
but most of the time - after making the connection to database you can update all tables automatically

Export single database, import to different database, Console only

In Google Cloud SQL, is there a way to export a single MySQL database (not the entire server) and then import that data into a different existing database on a different Cloud SQL Server, all through the console?
I know that this wouldn't be very difficult to do through the command line, but I'm looking for a Console-only solution. The things I can get to work are:
To restore an entire server
To restore a single database as a new database in an existing server
but neither of those are what I'm looking to accomplish. I want to overwrite a database in one server with the data from a database in another.
If I understood you correctly, this is what you can do:
Go to the first Cloud SQL instance
On the top there should be a button saying "EXPORT"
Select a bucket, and click on "Show advanced options".
Select the database(s) you want to export
Go to the second Cloud SQL instance
Click on the "IMPORT" button next to "EXPORT"
Select the file that you exported
I think that's what you want, if it's not, please reply so I can understand better.

Crystal Report ODBC connection only shows "Add command"

I'm supposed to set up a crystal report for something less than exciting. This is my first experience using Crystal Reports (and its been agony).
When I add an ODBC connection, I put in the password (confirmed it works elsewhere) and press all the "Next" there are, and then I end up with this this:
I also am able to use a direct query when I do "add command" and can access the database tables that way, but this is less than ideal.
My understanding is that the tables from the database are supposed to be listed under my connection, but all I see is "add command"
Does this mean I am not connected to the Database?
How do I correct this?
Verify that the user you setup in the ODBC Data Source Administrator has access to those tables in the database.

Crystal Reports - Add a new field to a stored procedure and make it available in the IDE?

I added a new field to a stored procedure.
How do I get it to be available in Crystal Reports without resetting the datasource in the database expert?
Verify Database works, but you have more control over things if you use the Set Datasource Location (found in Database > Set Datasource Location) to update the report after a proc change:
Open the Set Datasource Location dialogue (Database > Set Datasource Location).
Left click/select the procedure to update in the Current Data Source pane
Navigate to the procedure on the server to update with in the Replace with pane
Use the Current Connections leaf if you've already ran a report within the Crystal Reports Developer application. It can take a while for the pane to refresh.
Otherwise, navigate to the Create New Connection > [Database] leaf. If using Oracle, you will be prompted for the TNS, user and password for the connection
Click the now enabled Update button
This is where you set the Overridden Table Qualifier Name, which is essential for Oracle when a single report is to support multiple environments using the same TNS name.
Database Menu -> Verify Database
http://it.toolbox.com/blogs/programming-life/adding-new-fields-to-stored-procedure-and-updating-it-in-crystal-reports-30072
Click on Database -> Verify Database
Then right click on data source and refresh

Reporting Services Deployment Problem Deploying from VS 2005 to RS 2008

I've got a report that works perfectly in development previews. But when I deploy I get the following error:
In the Dev Environment the Error displayed is:
Error 4 The data source 'myDataSource'
cannot be found. c:\reporting services
projects\reports\rest_of_path\my_report.rdl
0 0
On the reporting services side the error it shows is:
The data source connection information
has been deleted.
(rsInvalidDataSourceReference)
By itself the datasource deploys just fine and it's present on the server so it doesn't make sense that it "can't find" it. What is going on?
P.s. I found a way to make it work on the server by manually assigning the datasource link that's lost in deployment. But I'd rather not have to do this every time I deploy a new report.
go to Report Manager(http:///reports/pages/Folder.aspx)
Click on the Folder in which u have reports
U will be directed into contents tab where u will find Show Details at the right top corner
Click on Show Details
Check in the particular report and click the edit button corresponding to it
Go to the properties tab and click on it
U will find a menu on left hand side, click on Data Sources link
There u will find radio button selected for A share data source(by default) and a browse button.
Click on the browse button u will find the tree structure of the datasource and the reports folder.
select the datasource in the datasource folder and select OK.
(From a post on http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/622dc981-4378-4331-b2fc-e377660464df/)
Did you upgrade the report files? the RDL spec changed between 2005 and 2008, you need to ensure that you are working with 2008 compatible tools if you are targeting 2008.
I got this to work with 2005, and to make it work I had to change the data source to use OLE DB and Sql Server Native Client 10.0. Another strange quirk was that the data source had to not have spaces in the name. I then had to reassign the report to use the new data source without spaces and then the 2005 rdl worked on the 2008 server.