Embed SQL Password into Crystal Reports RPT file? - crystal-reports

We are experimenting with Crystal Reports viewers such as this one:
http://www.thereportviewer.com/
... which can actually re-connect to the data source and re-run a Crystal Reports RPT file with live data.
However when running the report the viewer asks for a password to connect to the data source (in this case SQL Server).
Does Crystal Reports have some way of embedding a connection password into a RPT file to avoid this? Or should I be using a System DSN from the Control Panel/ODBC thing to get around this?
I figure someone else must have had this problem.

You can't do that. If possible set the password in the DSN or use a Report Viewer that can store the passwords for you. You can of course also build your own .NET report viewer, which isn't very hard to do if you've got .NET knowledge.
Added on April 29, 2010:
What you can try is doing the following:
Connect to a "ODBC (RDO)" via "Create Connection" in Crystal Reports. At the bottom of the dialog you'll find an option to enter a connection string. A connection string can contain the login info, like the example below.
Example connection string:
DSN=;DB=;UID=;PWD=password

To automatic connect to SQL using user sa and password in Crystal Reports
1) Create File DSN in ODBC Control
2) In Create file DSN add line with SA Password like this:
[ODBC]
DRIVER=SQL Server
UID=sa
PWD=your_pass
DATABASE=Your_Database
WSID=YourServerName
APP=System operacyjny Microsoft® Windows®
SERVER=YourServerName\YourDatabase
Description=YourDescription
3) Connect to SQL in Crystal Report using Your DSN File
You have to remember that your password is easy to find so this is very dangerous.

In newer version of The Report Viewer, you create an override connection, leaving the server and database fields blank, but setting the username and password, and it will work. The software will set the username and password to that value without changing the other connection settings inside the report. This will stop it from prompting you for a username and password.
You could also set the username and password inside the ODBC driver, or other driver settings, but some databases don't allow this for security reason... and you may not be using ODBC.

we had this problem too, but are currently assessing sabrelogic logicity viewer.
It will store the username and password in a separate file, which call up, and runs the report. It has the advantage that I can store the reports in a central location, and just send out the file that calls up each report to each user, simplifying the problem of making changes to a report that has been distributed.
Sabrelogic
The only donwside that I have found with it to date is that it doesn't handle dynamic parameters very well.

I had the same problem with hana studio + crystal report and I solved it with this conection string, I forgot to put the user and password.
DRIVER={yourdriver};SERVERNODE=servername or IP;DATABASE=databaseName;UID=databaseuser;PWD=password

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

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.

Typing in password for every connected table from SQL Server 2008 R2 in Excel 2010 Powerpivot Addin

I've got a BI Dashboard in Excel 2010 using Powerpivot, which is connected to a number queried tables on one SQL Server. When the connections were setup, I checked the box to 'save password' on each one. However, whenever my users reopen the document and go to the Powerpivot window and select 'RefreshAll' then they have to type in the password multiple times (once for each table), which is not suitable.
I have looked here and here and seem to be experiencing the same issue as a number of other people. I have started again from scratch, ensuring that the 'save password' box is definitely checked on each connection string.
The only workaround I can think of is by user Windows Authentication, but this document is intended for widespread use, and as such this will require a lot of maintenance, and will really annoy my server admin :)
Does anyone have a workaround, or any way of resolving the problem?
This solution comes close, but doesn't seem to work in my case. Might work for others though...
Solution summary:
In the main Excel window in the Data tab, choose Connections, then select the workbook connection that corresponds to your PowerPivot connection. Click on Properties, switch to the definition tab, and mark “Save password” box.
Source:
http://cpa-it.com/password-not-saved-in-powerpivot-connection-when-using-sql-authentication/#comment-10654
I've found a workaround that works for me, but might not be an ideal solution for others.
In the main Excel window, you can create a new connection using a connection file (.odc). If you create this file on a shared network drive that all users can access, and select to store the password in the connection file, the password is -actually- stored.
You can then go on and use this connection in the PowerPivot window. It will no longer ask for a password when refreshing your tables.
Of course this is only a useful workaround within a company LAN, and if there are no security implications for storing the password on a fileserver in an odc file.

SQL Server Management Studio - Server Names Disappeared

The first dialog box you get when opening SSMS (mine is 2008 R2) allows you to choose which server you want to connect to.
I had at least six servers in that list, including a local server called something like MYPC/SQLSERVEREXPRESS
Windows Updates ran last night and rebooted my machine, and now my SSMS list of servers is gone. I can select (local) or (browse for more)
What happened to my previously saved servers and their saved login info?
The file that stores these for 2008 is found at c:\%UserProfile%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
My guess is that it is still there, but was overwritten by one of your updates, you can check it to see when it was last modified.
You should make use of registered servers and export the file to save time if this happens again.
As I understand, you want to retrieve your credentials from that file.
There is a way to restore your passwords, if you still have sqlstudio.bin file and you can see "password" entries there.
First, some theory: When SSMS saves connection object it encrypts the password using some encryprion method, that is BOUND to your windows login. If you try to copy the sqlstudio.bin to other machine/user profile, passwords will not be decrypted. So it is important that you do all actions under same windows account, that you have used then sqlstudio.bin was generated. I can not tell you, if you can directly manipulate sqlstudio.bin - I suppose there are some checksums there which will prohibit direct manipulation, but there is another way.
I know the information I written above, because I develop myself an add-in for SSMS - SSMSBoost. I have implemented there the logic to manage preferred connections (so that you actually will not need standard dialogue anymore). I use exactly the same SSMS objects to store connections and serialize then into XML, so it is easier to manipulate.The picture below shows contents of sqlstudio.bin and SSMSBoostSettings.xml for the same connections. You can recognize, that username and password binary data are the same. So, to restore your password you have to:
install ssmsboost
add preferred connection to ANY database with sql server security
open SSMSBoostSettings.xml (you will see the path to that file in settings dialogue, after you have saved settings. Just save, close and re-open it. Path is displayed at the bottom)
Close SSMS, open sqlstudio.bin and ssmsboostsettings.xml in editor
modify entry in ssmsboostsettings.xml - enter data of your server from sqlstudio.bin - adress, database name, username. Carefully copy password data.
save xml and open SSMS - SSMSBoost will now show your connection in preferred connections and you will be able to connect to database. (see second picture)

Changing Crystal Reports reports shipped with an application and a runtime version

We have a purchased application (I'm told it's .NET, it's client server, running on Windows XP, connecting to SQL Server 2005) that uses a Crystal Reports runtime and separate report files (.rpt) to do it's reporting function. I have a copy of the CR Designer program but we don't have the CR Enterprise software. I can open the reports in the designer, get to the SQL Server data source (and any others, I guess), add them to the report, run it, print it -- but I can't figure out how to use the same Datasource, which is a subset of the tables in the database that it's connecting to, to do it, and I can't figure out how to save the report files so they'll work with the application. Real gravy would be coming up with new reports.
Is this even possible?
If you open up the report and then go to Database, Set Datasource Location, under the Properties section you will find a lot of info about the datasource and where it is getting it's info from. If the purchased application is creating its own datasource internally though and supplying it to the report at runtime, the best option that I can think of is to start a trace on the SQL Server and then run a report. You should be able to see the SQL that is issued by the Datasource and replicate it in your own version.
You have the possibility to manage your connection's properties at runtime (ie while launching CR from your app). Here is a proposal: Crystal Reports Datasource remap
If you cannot access your app code, you should then do as proposed by #Anthony, by updating all your connection strings in your rpt files, save the rpt files, and copy then on the corresponding report folder of your app: you might have to find where it's located in your system.
First of all, you'd better make sure you're not violating the application's license agreement by attempting to add to it in this way.
It may simply not be possible to add reports to the app in any case - it depends how it loads them and what it does with them.
To use the same datasource, you should just be able to open one of the .rpt files, then go to File > Save As, and give it a new name. Then modify it to what you want. Of course, if you don't know the authentication credentials the app passes to the report to connect, it would be tricky to test it.
It would help greatly if you gave us the name of the purchased application, as we don't really know what you're up against.
It could be that the application is passing through a filter of the data. So when you run the report from Crystal Reports Designer you get the whole data base, however when run through the program the parameters being passed to the report restrict the data back down.
Create a backup of the report. Then edit the existing report, make the changes you require, preview the report to get an idea it looks right, save the report and run the report via the application.
Warning:
As it has already been stated some vendors may not allow you to edit existing reports, your warranty/sport may be voided by editing existing reports, or reports could even be overwritten on the next update.