Sitemap

Amicuk Programming Answers

How to change Crystal Reports XI database name at run time from ASP code using ADO

2015-10-11   Views:2

Advertisement

Dear All, I need advises regarding to my problem below I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page. The problem is ho

Dear All,
I need advises regarding to my problem below
I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page.
The problem is how can I change a database from TEST01 to LIVE01 at the run time from ASP code as I already using TEST01 database on Crystal Reports and I do not want to set a new database location inside crystal for each reports
Thanks and wait for your reply soon.
Below is my code, which has no effect to crystal reports although I've change the database from TEST01 to LIVE01:
<%
Dim oADOConnection, oRptTable, oADORecordset, sql
Dim struser, strpwd, strdriver, dblocation, dbname, strConnect
struser = "sa"
strpwd = ""     
strdriver = "{SQL SERVER}" 
dblocation = "SQL200501"     
dbname = "LIVE01"    ' Changed from TEST01 to LIVE01
strConnect = "User Id=" & strUser & ";"
strConnect = strConnect & "PWD=" & strPwd & ";"
strConnect = strConnect & "DRIVER=" & StrDriver & ";"
strConnect = strConnect & "SERVER=" & DBLocation & ";"
strConnect = strConnect & "DATABASE=" & dbName
sql="Select * from Employee"
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11")
Set session("oRpt") = session("oApp").OpenReport("C:\REPORTS\RPT01.RPT", 1) 'USING TEST01 DATABASE
session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
session("oRpt").DiscardSavedData
Set oADOConnection = Server.CreateObject("ADODB.Connection")
oADOConnection.Open (strConnect)
Set oADORecordset = Server.CreateObject("ADODB.Recordset")
Set oRptTable = session("oRpt").Database.Tables.Item(1)
oRptTable.SetDataSource oADORecordset, 3
session("oRpt").SQLQueryString = CStr(sql)
session("oRpt").ReadRecords
%>

The replay answer
Advertisement
Did you ever find a solution to this problem?  I have the same problem when moving reports from development to Test to Production environments.  If the DBName is not the same the report ignores the name provided at runtime.

Go to See the other 2 answers

How to change Crystal Reports XI database name at run time from ASP code using ADO

Category:DefaultRelease time:2015-10-11Views:130

Dear All, I need advises regarding to my problem below I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page. The problem is ho[More]

Launch a Crystal Report Based on a Bus. Objects Universe with code

Category:DefaultRelease time:-0001-11-30Views:130

Post Author: BobM CA Forum: .NET Launch a Crystal Report Based on a Bus. Objects Universe with code We have purchased Business Objects Enterprise XI R2 and have designed a universe.  We have hundreds of scheduled reports that have been configured thr[More]

Crystal Reports 2008 runtime error while running on Windows Server X64

Category:DefaultRelease time:2015-10-11Views:130

I have a .NET web application compiled as X86 in Visual Studio 2008 invoking Crystal Reports 2008 SP2 that's running fine at a number of sites running Windows Server 2003 X86.</br> </br> When deploying this app to Windows Server 2008 X64 I get[More]

Unable to see Oracle driver from Crystal Report's Database Expert

Category:DefaultRelease time:2015-10-11Views:130

I have installed Oracle client (version 10g) on my laptop that also has Crystal Reports 2008 ver 1 SP3.  I then installed data driver 5.3 (Datadirect ODBC database driver) but I canu2019t see the Oracle driver nor the Oracle wire protocol driver from[More]

Crystal Report Server Database Log File Growth Out Of Control?

Category:DefaultRelease time:2015-10-11Views:130

We are hosting Crystal Report Server 11.5 on Microsoft SQL Server 2005 Enterprise.  Our Crystal Report Server SQL 2005 database file size = 6,272 KB, and the log file that goes with the database has a size = 23,839,552. I have been reviewing the Appl[More]

Crystal Reports: Unexpected database connector error

Category:DefaultRelease time:2015-10-11Views:130

Hi experts, I have a Web Module DC that uses JSP to show Crystal Reports. In my report I use POJO as datasource. The POJO itself is a JPA entity and is located in other EJB Module DC that has dependency with the Web Module DC. At design time everythi[More]

Crystal Reports Integration Database Login error

Category:DefaultRelease time:2015-10-11Views:130

Hi guys, We have installed crystal reports integration on our customer's server and client PCs. They are using SAP 2007 A PL10. We created a report and the report works perfectly on the server and on another client pc. There is however 3 clent pcs (a[More]

Crystal Report requests Database logon if SAP BW is datasource

Category:DefaultRelease time:2015-10-11Views:130

Hi all I experience the following: 1. SSO from SAP Portal to BOE works: I can view Sample Crystal Reports based on the BO-iView-template without additional login 2. SSO from SAP Portal to SAP BW works: a) I can view custom BW Web queries without addi[More]

Using excel file as datasource in crystal report asking database logon

Category:DefaultRelease time:2015-10-11Views:130

hai all, we uisng  plain excel file in crystal report to develop some reports it is working fine. Issue is when we are using  parameters and  using the crystal report in live office it  is asking for database logon details. we are not using any datab[More]

Crystal Report with subreports breaks when running on different databases.

Category:DefaultRelease time:2015-10-11Views:130

HI there I have a report with 5 subreports on that only works on the database I am designing it on. As soon as I run the report through my application on a database different to the one I design on, it seems to have lost all the parameter fields I cr[More]

Crystal Reports 2008 database error

Category:DefaultRelease time:-0001-11-30Views:130

I want to make a change to an already existing Crystal Report.  The database table(s) were specified with the "add Command" command and so the report uses an SQL command to access the tables. (An ODBC connection is used to access tables.)  When[More]

Hot
Hardware MacBook Pro Retina Mid 2012 2,6 GhZ Intel Core i7 8 GB 1600 MHz DDR3 Intel HD Graphics 4000 1024 MB and NVIDIA GeForce GT 650M APPLE SSD SM256E Media Operating System OS X Yosemite 10.10.1, downloaded from the AppStore via Disk Utility Hi, f [More]
Hi, I am having a problem while trying to open a file from my servlet by using URL connection. Following is my code sample. what happens is when I first run my project it opens the file but after that when I rerun it again and again it sometimes open [More]
Help! I am using my Samsung 40 inch TV as a second monitor. No matter what pixel config I do the screen is oversized. For example, if I use the Samsung as my main monitor the menu bar at the top is off the screen and I can barley see the tops of the [More]
The screen freezes and gets brighter and brighter until it becomes all white. If I move the screen of the laptop the display returns to normal for a brief second then starts turning white all over again. Anyone know what the problem could be? I have [More]
Hi Experts,      Can you please share your experience regarding in escalating high-prioritized tickets regarding extractions, Performance Issues and also load failures as per your working SLAs. What king of issues means in which scenario the business [More]
Hi, I installed oracle 10g express edition on Linux redhat 9 and I can't get going with it because the listener won't run. When I try /etc/init.d/oracle-xe start I get: Starting Oracle Net Listener. Starting Oracle Database 10g Express Edition Instan [More]
IIs there a way to send blocked or unknown numbers to voicemail?Contact your carrier. That's who you need to ask.Read other 2 answers [More]
First of all I am on a Mac using a Mobile Account. I have no admin control over this setup. Every 2 hours or the local environment syncs with the server and saves my 'computer'. The problem is when opening InDesign in the morning to start the day hun [More]
I get the following error when compiling ffmpeg-mt-git LD libavcodec/libavcodec.so.52 /usr/bin/ld: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../lib/libx264.a(common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when m [More]
Running on Windows 7, I need to change one of my variables. So I click Project -> Variables... Captvate freezes. Accepts no input whatsoever. It's as if the variables dialog were hidden. I tried stopping Captivate from Task Manager, TM says the progr [More]