How can I hard code logon parameters in a Crystal Report? - crystal-reports

I have a Crystal Report that runs from within an MS SQL Server based application. The application can run reports based off of this database just fine, but now I need to run a report that also has another datasource, an Access db. When I run the report from the CR designer it works. However, when I run it from within the application it fails with incorrect logon parameters. I think the application uses its own logon parameters to run reports. I'm not 100% sure of this though because it happens "under the hood" of the application. Is there any way I can force the report to use a certain logon for the Access db?

It is fairly standard practice when an application embeds crystal reports that every table will be looped through and the logon parameters set to those of the application's data source.
The way i have achieved what you are looking to do in the past is create a view (possibly in conjunction with a linked server) in your application's database then you point the report at this/these view(s).
Good luck!

Related

Approch for JasperReports

I am new to JasperReports, I need a few heads up before going forward with my development. My colleagues told me they are able to generate a basic report, but they are stuck with what approach should be used.
I was told we could:
write the queries in each report
run the queries outside the report, and pass it to the report as a
datasource
Which approach is preferable? Does passing the datasource have any performance hits compared to passing the bean? Also would like to know does first approach run in a different jvm?
Current Project Architecture
Struts 2 - Spring 2.5 - Spring JDBC
If you and your team are just starting out with JasperReports I would recommend embedding the SQL query into each report. It makes building the reports in iReport much easier, since you can constantly preview your report with live data while working on it.
As far as performance, I do not think it really is not going to matter in the most basic of examples. If it is just a SQL query then no matter what scenario you use it is going to be using JDBC with the connection you give it. So I would ignore performance for now.
With that said, if you already have the data (i.e you have displayed on a screen and you want to allow the users to then export it to PDF or whatever), you could simply pass it in as a datasource and not take the performance hit of running the query again.
Another scenario you may want to use your own datasource is if you wanted to manipulate the data before it was exported in the report. Maybe some crazy sort that you could not pull off in SQL or something.
As far as your last question, it should all run in the same JVM (at least from my understanding).

Set server URL for an SSRS linked to report in CRM

I am working with CRM 2011 and a SSRS 2008 R2. Each are located on different servers and are set up so that each one can be deployed from Dev servers to Production servers without causing problems to the other.
In CRM I am linking all the SSRS reports by using a URL. (Report Type: Link to Web Page). My goal is to have the SSRS URL change in CRM depending on which server CRM is deployed to.
For example:
Dev Server
SSRS Server - http://DevSSRSserver
CRM Report URL - http://DevSSRSserver/ReportServer/Pages/ReportViewer.aspx?MyReport&rs:Command=Render
Production Server
SSRS Server - http://ProductionSSRSserver
CRM Report URL - http://ProductionSSRSserver/ReportServer/Pages/ReportViewer.aspx?MyReport&rs:Command=Render
Can anybody point me into the right direction so that I can change a Report URL to a different server name depending on the server CRM is being deployed to? I'm very new to CRM and any help at all will be greatly welcomed.
Thanks,
Shane
There's a couple ways you can address this:
1) If the CRM/SSRS servers are in different network environments; you can just use DNS aliases in each respective environment to control what report server you want to link to. Its not clear in your statement above if you have these server pairs in a different network or if they are on the same network and just different servers.
2) Use features of the SDK -- and write code to search for/iterate over report items in the report entity. Replace the server portion of the URL and save the entity back to the server.
3) One thing I haven't tried before but may be appealing is to use the Export/Import features native to CRM to Export the list of reports you want to alter to Excel, edit them, and Reimport. I'm the least sure of this approach. I've noticed that unlike other entities, Reports has the "Download Template for Entity" option greyed out. (Its seen under the "Import Data" button on the ribbon control) This means you may have to do a little more work to do the import, but it may still be a better fit than the two options above. Certainly -- its better than hand editing each individual one.
From
http://msdn.microsoft.com/en-us/library/gg309480.aspx
Create a hidden parameter of type string in the report that has the name CRM_URL. For more information about adding parameters, see Use Parameters in Reports. When the report is run, this parameter is automatically set to the Web address of Microsoft Dynamics CRM.
Hope that helps!
Ryan

Problems using views directly in Crystal Reports with multiple databases

Working with Crystal Reports over a multiple database environment. In the past reports have been written un-generically (go figure). Trying to clean this mess up while providing new deliverables. Clients do not understand and always pushing for the shortest possible way and do not see the need for cleaning/tuning up existing reports to make them generic for all systems.
Have come across a number of reports built using a specifically written view for each report. The drama comes when cloning a view based crystal report and then trying to run the report via crystal designer on a database different from the original database the report was built on.
The report holds onto the original view object. Runs but delivers no output. At first I thought there were grants issues with the underlying views.
The solution is to update the view reference in the "Set Datasource Location" panel.
Wondering peoples opinions on using views in crystal reports. And if they have hit this situation before.
Obviously views have their uses but I do not see the point of adding another layer between a report and the sql statement(s) by making a specific view for the report when the sql can be plugged straight into the report. Only database procedures make sense to me when you are wanting to do more complex calculations and output.
Notes
The report runs fine from the application menus for the differing
systems (without changing the crystal datasource) SAP B1.
Those reports using views indirectly are NOT affected by this issue.
Pseudo screenshot:
Set Datasource Location (panel)
Current Datasource:
Report
server
properties
initial catalog: other database
view
properties
catalog: original database
From our experience using views for multiple servers/databases (or even tables with N-N relations) is preferred way. If anything changes in database layout or servers configuration, what you prefer - alter one view or multiple related reports?
Of course it can be related to fact that our reports are designed to work on single database. Our application always replaces all included datasource locations (tables, views) to current database, this allows easy reporting on different databases (including MSAccess and MSSQL ones). Such approach excludes cross-database reports, unless using views. Our reporting uses OLEDB interface too, not linked to datasources-connections, opened in application.
There are sometimes problems in designer, when it is opened directly with report file; set datasource location usually corrects them (you may need to set location for specific views too). If opened through our application, which saves report copy with corrected database information, designer works flawless.
And there are sometimes problems with underlying views, which cannot be easily transferred to different database layout. Fortunately view definitions can be altered without changing output layout :)
About customers - they of course do not want to change their working reports. You can be sure that you introduce some errors when replacing their reports with more universal ones - who wants that? No one.

Can I change the database server and database a report is pointing to dynamically?

I have a Crystal 2008 report that will be deployed to an InfoView server. There are four different databases the user might want to execute the report against. Each of the four databases have exactly the same schema. Only the data in each is different. Each database corresponds to a plant we have around the world.
Instead of creating four different reports (each one connected to one of the four databases), am I able to dynamically change the server/database the report hits based on a value the user enters into a parameter? I'm really trying to avoid having to create four identical reports except for the database connection on each. If this isn't possible, how do developers typically deal with this sort of scenario? I would imagine it's fairly common.
Thanks very much.
InfoView doesn't support dynamically changing a report's datasource. You certainly could modify InfoView source to suit your needs with the BusinessObjects Enterprise SDK, but that will be a challenge and won't be supported by BO.
Another option is to build a custom portal with the BusinessObjects Enterprise SDK, but this will require quite a bit of coding as well.
Probably the best option is to publish the report multiple times, set each datasource as appropriate (via the CMC), and change the name of the report to give an indication of its datasource (via the CMC). I there is a report property in the CMC that will save the datasource settings so you can quickly republish the reports if you make a change to the original.
I'm not familiar with InfoView, but it is quite common to do what you describe, I've done similar things with Asp.Net and Winforms; if you have access to the Crystal Reports object model, there are extensive options for setting logon info, I think it is SetDatabaseLogon; if you have subreports, you have to set the login for each of those separately.
The schemas do have to be completely identical, or the user will get warnings.

Good ways to use Crystal Reports with Salesforce?

Does anyone know good ways/tools/approaches for using Crystal Reports with Salesforce.com?
I know that Crystal Reports for Salesforce exists but I'm wondering what other possibilities there are...
It looks like your data is tied up with salesforce.com if you can export data you could use crystal reports independent of salesforce.com.
Other links on exporting data:
http://sfdc.arrowpointe.com/2008/04/28/do-you-backup-your-salesforce-data/
http://ideas.salesforce.com/article/show/97976/Export_All_via_Data_Loader
http://ideas.salesforce.com/article/show/23579/Scheduled_Data_Export_to_backup_database
Our solution may not work for you, but we've decided to host our reports on an external reportserver which is written in c# and exposes a SOAP based web service because the Crystal Reports for Salesforce solution you mentioned didn't offer us the flexibility we needed.
The process is essentially:
Salesforce makes a soap based call to the report server
Report server collates data from Salesforce via the Salesforce Soap API
Report server renders the report and returns it to salesforce
To answer my own question, we eventually decided to set up a local read-only copy of the Salesforce database in MS Sql Server, and develop reports based on that. This allowed the report-writing people to use all the familiar SQL tools they know, without the restrictions on what-can-be-joined-to-what that the native Salesforce database has.
We're using a piece of software called DBAmp to do this - It makes Salesforce appear in SQL Server as a 'linked server', and provides stored procedures you can use to download entire Salesforce tables, or just download changes to a Salesforce table since the last time. This makes it very easy to set up a local copy of the data that gets updated every night.