Creating a SQL Expression Formula
Post Author: edt11
CA Forum: Formula
I need to due a lookup on name(stored in a different table). I want to display the name result on the report.
I have tried using the following SQL:
SELECT distinct(a.short_name) FROM FUND A, FUND_EXTERNAL BWHERE A.FUND_NUMBER = B.CUSTODIAN_KEY
And I keep receiving an ORA-00936 error (Missing Expression). If there is a way to retrieve this info in a normal formula that would be great as well. But the SQL above gives me the results I am looking for so I didn't exhaust all solutions in the Formula Workshop.
Thanks
Post Author: edt11
CA Forum: Formula
I need to due a lookup on name(stored in a different table). I want to display the name result on the report.
I have tried using the following SQL:
SELECT distinct(a.short_name) FROM FUND A, FUND_EXTERNAL BWHERE A.FUND_NUMBER = B.CUSTODIAN_KEY
And I keep receiving an ORA-00936 error (Missing Expression). If there is a way to retrieve this info in a normal formula that would be great as well. But the SQL above gives me the results I am looking for so I didn't exhaust all solutions in the Formula Workshop.
Thanks
Similar Messages
-
SQL Expression Field - Combine Declared Variable With Case Statement
Hello All, I have been using Crystal & Business Objects for a few months now and have figured out quite a bit on my own. This is the first real time I have struggled with something and while I could do this as a Formula Field I would like to know how to do this as a SQL Expression. Basically I want to create a SQL Expression that uses a CASE statement but I wanted to make the code a little more efficient and employ a variable to hold a string and then use the variable in the CASE statement. The expression editor accepts the CASE statement OK but I don't know how to declare the variable. Please assist with the syntax?
This is what I have:
CASE
WHEN u201CDatabaseu201D.u201DFieldu201D = u2018Hu2019 THEN u2018Hedgeu2019
WHEN u201CDatabaseu201D.u201DFieldu201D = u2018Pu2019 THEN u2018PVIu2019
ELSE u2018Noneu2019
END
This is what I want:
DECLARE strVar AS VARCHAR(25)
strVar = u201CDatabaseu201D.u201DFieldu201D
CASE
WHEN strVar = u2018Hu2019 THEN u2018Hedgeu2019
WHEN strVar = u2018Pu2019 THEN u2018PVIu2019
ELSE u2018Noneu2019
ENDHi Todd,
Please use the following for loop; your problem will be solved.
Local StringVar str := "";
Local NumberVar strLen := Length ({Database.Field});
Local NumberVar i;
For i := 1 To strLen Do
if {Database.Field} <i> = "H" then str := "Hedge"
else if {Database.Field} <i> = "P" then str := "PVI"
else str := "None"; exit for
str
Let me know once done!
Thank you,
Ashok -
In crystal report 2008,I create a SQL Expression Fields,but how to write the SQL query in the formula workshop,
Edited by: nylethx1 ye on Jul 23, 2008 9:48 AMSelect count(*) from Table
Your query must return a unique value.
From Don: SQL Expressions were not designed to run SELECT statements. Use a Command object for selects.
Edited by: Don Williams on Nov 2, 2009 9:29 AM -
SQL Expression field with parameter
Hello,
I am trying to create a SQL Expression Field that will give me the maximum status date of an employee before a certain date entered in parameter.
ex: select max(status_date) from status where status_date < formula field or parameter
Since I can not put a paramter or a formula field in a SQL Expression field, I might need a template or an example of something that works ?
Thank's
Steph
Edited by: Stephanie Charest on Aug 4, 2008 7:59 PMOk,
The only way I found to get the maximum status date of an employee with the date entered in parameter was to litteraly put each employee ID, and Status Date in the Detail section.
Then in the select expert create the parameter date.
Then I created a running total field that counts the employees and resets on change of employee sorted by status date.
Then I created a formula that gets all the first occurences of this running total field and if the running total field equals 1, a new formula field shows 1 and if not (2 and more), it shows 0.
But I can't find the way to give me the total that I need for each group sections.
It's ok if the SQL expression field does not work, but I need to find a way to get the max date.
Thank's for your help for the SQL Expression field.
Steph -
Need to create a SQL Expression Field based on this query - or can someone tell me how to do it CR syntax?
SELECT Count("ordhdr"."ACCT_NO")
FROM ordhdr
WHERE (dt_in between '2011-01-01 and '2011-10-31')create a group, group off of account number.
Your select statement should be close to this.
in Date (2011, 01, 01) to Date (2011, 10, 31)
You can drop your fields into the detail section.
Right click the ordhrd select insert summary, group 1, and change it from sum to count.
You can suppress the details.
The corresponding SQL would look something like this.
SELECT `ordhdr`, `acct_no`, `DT`
FROM `Datasource name`
WHERE (`DT`>=#2011-01-01 00:00:00# AND DT`<#2011-10-31 00:00:01#)
ORDER BY `acct_no` -
Sql expressions field option not available in field explorer
Hello:
I would like to create a sql expression field in my report. however when I go to the field explorer panel, a sql expression fields node is not available to create one. Does anybody know why is this not an option?
Thank You Very MuchAlso if you are creating based off any stored procedure or View you can't see Sql Exprn under field explorer. I think it is also databse specific. What is the databse you are using ? also what is your datasource ?
Thanks,
Sastry -
Hello everyone,
I'm having trouble with this SQL expression that works in 8.5, and XI R2 runtime and designer, but I cannot edit the expression. As soon as I open the SQL Expression and click the X-2 check button, the error following
SQL Expression I'm trying to run:
(Select Distinct b1.CandEmploymentType
from ceistaffing a1
inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
Where a1.Staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID"
and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
The Errror I Receive After Clicking the X-2 button:
Crystal Reports
Error in compiling SQL Expression :
Failed to retrieve data from the database.
Details: ADO Error Code: 0x
Source: SalesLogix OLE DB Provider
Description: The multi-part identifier "CEIHRPROJECTEDACTUAL.STAFFINGCHAINID" could not be bound.
Native Error: [Database Vendor Code: 181797304 ].
OK
This is the SQL statement passed to the database:
SELECT (Select Distinct b1.CandEmploymentType
from ceistaffing a1
inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
Where a1.Staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID"
and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
If I reverse the order of the where clause as follows, I do not get the error
(Select Distinct b1.CandEmploymentType
from ceistaffing a1
inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
Where CEIHRPROJECTEDACTUAL."STAFFINGCHAINID" = a1.Staffingchainid
and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
This is the working SQL statement passed to the database.
SELECT (Select Distinct b1.CandEmploymentType
from ceistaffing a1
inner join ceisubmittal b1 on a1.submittalid = b1.ceisubmittalid
Where CEIHRPROJECTEDACTUAL."STAFFINGCHAINID" = a1.Staffingchainid
and b1.createdate in (Select max(b2.createdate) from ceistaffing a2 inner join ceisubmittal b2 on a2.submittalid = b2.ceisubmittalid where a2.staffingchainid = a1.staffingchainid))
FROM "sysdba"."CEIHRPROJECTEDACTUAL" "CEIHRPROJECTEDACTUAL"
I figured I would just reverse the where clause statements, but then I came to this one that I couldn't get to work:
(Select case when tmp.restartcount = 0 then 'F' else 'T' end from
(Select Count(b.restart) as restartcount from ceistaffing a inner join ceihrprojectedactual b on a.staffingchainid = b.staffingchainid
where a.candcontactid = (Select distinct candcontactid from ceistaffing a2 where a2.staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID")
and b.restart = 'T'
and a.createdate = (Select min(a1.createdate) from ceistaffing a1
where a1.createdate > (Select max(a3.createdate)
from ceistaffing a3
where a3.staffingchainid = CEIHRPROJECTEDACTUAL."STAFFINGCHAINID")
and a1.candcontactid = a.candcontactid)) as tmp )
I've burned an entire day trying to find some solution. Are there any patches out there that will fix this?
I'm running Crystal Report XI Release 2 SP2 - Version 11.5.8.826
Thank you, ...RobOkay, to simplify the illustration of the problem Iu2019m facing, Iu2019ve created a bare bones example as described below:
I've created a report that returns all contacts from our "CONTACT" table. On the report, I've created a SQL expression to return a count of all contacts with the similar last name, as shown below:
(Select count(a1.ContactID) from CONTACT a1 where a1.LASTNAME = "CONTACT"."LASTNAME")
When I try to save the SQL expression, I get this error:
Crystal Reports
Error in compiling SQL Expression :
Failed to retrieve data from the database.
Details: ADO Error Code: 0x
Source: SalesLogix OLE DB Provider
Description: The multi-part identifier "CONTACT.LASTNAME" could not be bound.
Native Error: [Database Vendor Code: 205193720 ].
OK
This SQL expression works fine in CRW 8.5, but no luck in XI R2 SP4 - As mentioned above in the thread, this seems to be an issue solely with how XI R2 is parsing the SQL Expression. If I remove the "A1" alias from my expression all is good, but that will not work for some of the more advanced SQL expressions I have that are using joins and sub queries.
What will it take to get this recognized as an issue worthy of a hot fix? I'm at a stand-still here, facing the unfortunate possibility of having to re-architect many of my reports. Please help.
Thank you, ...Rob
Edited by: Rob Bartram on Aug 6, 2008 3:45 PM -
How do change SQL Express's in my application?
How do I change an older application created under SQL Express 2005 to SQL Express 2008(R2)? I can run this application using Debug, but can't publish it because of the following message:
INSTALL LOG:
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.0.0 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package '.NET Framework 3.5 SP1', phase BuildList
Reading value 'SP' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5'
Read integer value 1
Setting value '1 {int}' for property 'DotNet35SP'
The following properties have been set for package '.NET Framework 3.5 SP1':
Property: [DotNet35SP] = 1 {int}
Running checks for command 'DotNetFX35SP1\dotNetFx35setup.exe'
Result of running operator 'ValueGreaterThanEqualTo' on property 'DotNet35SP' and value '1': true
Result of checks for command 'DotNetFX35SP1\dotNetFx35setup.exe' is 'Bypass'
'.NET Framework 3.5 SP1' RunCheck result: No Install Needed
Running checks for package 'SQL Server 2005 Express Edition SP2 (x86)', phase BuildList
Running external check with command 'C:\Users\Terry\AppData\Local\Temp\VSD8D4D.tmp\SqlExpress\SqlExpressChk.exe' and parameters ''
Process exited with code 1
Setting value '1 {int}' for property 'SQLExpressInstalled'
The following properties have been set for package 'SQL Server 2005 Express Edition SP2 (x86)':
Property: [SQLExpressInstalled] = 1 {int}
Running checks for command 'SqlExpress\sqlexpr32.exe'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionNT' and value '5.1': true
Result of checks for command 'SqlExpress\sqlexpr32.exe' is 'Bypass'
Running checks for command 'SqlExpress\sqlexpr32.exe'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of running operator 'ValueExists' on property 'Version9x': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.1.2': false
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': true
Result of checks for command 'SqlExpress\sqlexpr32.exe' is 'Fail'
'SQL Server 2005 Express Edition SP2 (x86)' RunCheck result: Fail
A prerequisite failed for Package "SQL Server 2005 Express Edition SP2 (x86)"
Package failed with message "This version of SQL Server 2005 Express Edition (x86) is not supported for the current processor
The above was highlighted by me to save you some scanning.
The following is what I have installed on my PC:
Terry 01Below messages are logged during installation
<install log>
Running checks for package 'SQL Server 2005 Express Edition SP2 (x86)', phase BuildList
Running external check with command 'C:\Users\Terry\AppData\Local\Temp\VSD8D4D.tmp\SqlExpress\SqlExpressChk.exe' and parameters ''
Running checks for command 'SqlExpress\sqlexpr32.exe'
<install log>
and screenshot also shows the same.
I am NOT an expert in Visual Studio but I would guess that when you have build your package, would have a checkbox somewhere to mention SQL 2005 as pre-requisite. something which should
say check for prerequisites for SQL server 2005 express edition??
On this machine, since you have SQL 2008 R2 installed, the check is failing and hence installation?
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle -
PL/SQL Expression of button
HI, please help me
how to create PL/SQL expression of button to redirect to another page in the application on Oracle 10 g
in PL/SQL i create this code but can not continue
BEGIN
select password from user where user_name='john';
if password='123' then
in the above page must be redirected to another page
end if;
END;
Edited by: 912303 on Apr 6, 2012 9:47 AMIs this query the 1st thing you do on the current page?
If so, then one way to do that would be to create a Before Header Branch to redirect to the target page and make the branch condition EXISTS
and enter the query
Select NULL
From user_table
Where user = 'John' and password = '123' -
Putting Parameter into SQL Expression or convert to formula Basic or Crystal
Post Author: yoschua
CA Forum: Formula
Hello,In my old report I got something like thisSELECT MIN(cast("ParDyn"."ParVal" as integer))FROM "result".ParDyn WHERE "ParDyn"."ParNo" = (SELECT Max("Piece"."ParDynNo") FROM "result"."Piece" WHERE "Piece"."RequestNo" = XPARAM1 And "Piece"."PieceNo" = XPARAM2) And "ParDyn"."ParIdent" = 'Trace.Assignment' This report are viewed from VB component - at old VB they read SQL from report, input XPARAM1 and XPARAM2 and put it into report again and the show report.Because now I want to make my aplication I convert this report to use it not only at this old aplication, but with CR Viewer too.I see I can not insert Parameter into SQL Statement, so I need to use Basic or Crystal Formula.I try to make something like this : minimum({ParDyn.ParVal})and {ParDyn.ParNo} = 0of cource zero should be exchange with next statement, but this not working.What I would like to get is only one record, I do not want get whale table into CR engine and then evaluate becouse this report must work on slow connection, so I need take from database only records witch I need. Can someone help me, or show how to insert into formula value as parameter taked from another table dynamicly ?? Best Regards Bartłomiej JóźwiakOk,
The only way I found to get the maximum status date of an employee with the date entered in parameter was to litteraly put each employee ID, and Status Date in the Detail section.
Then in the select expert create the parameter date.
Then I created a running total field that counts the employees and resets on change of employee sorted by status date.
Then I created a formula that gets all the first occurences of this running total field and if the running total field equals 1, a new formula field shows 1 and if not (2 and more), it shows 0.
But I can't find the way to give me the total that I need for each group sections.
It's ok if the SQL expression field does not work, but I need to find a way to get the max date.
Thank's for your help for the SQL Expression field.
Steph -
SQL Express 2008 R2 - CREATE DATABASE permission denied in database 'master'
I have created a setup application with SQLEXpress 2008 as a prerequisite. On test SQLExpress installs OK
after the application is installed it must create and install a database using a mixture of SMO and Scripting. I used SMO to add the current user (who is a Windows Administrator) as a Login to the SQL Express server.
Dim l As Login = New Login(srv, My.User.Name)
l.LoginType = LoginType.WindowsUser
l.AddToRole("sysadmin")
l.DefaultDatabase = "MASTER"
l.Create()
It fails on srv.CreateDatabase with error message "permission denied in database MASTER"
this thread talks about converting the server to single user mode before adding a login
http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/86daf5f5-d333-40b1-ae6f-0da052a96600
how is it possible to scrip this? there is no documentation i can find.
the database must be installed in the ProgramData folder. Is there a permissions issue with this. Do I need to assign permissions to this folder somehow?
bear in mind this will be a remote install and the user expects it work flawlessly. No manual interventionsif i connect to the sqlexpress instance (local)\SQLEXPRESSS using SQL Management Studio and try to modify the Windows User Login I get the error message:
"User does not have permission to perform this action. (Microsoft SQL Server, Error: 15247)"
how is this possible. it seems to be at an impasse. can't go forward or backward
Now try launching Managenment Studio by right clicking on shortcut and choosing "Run As Adminitstartor".
If above works then you are running on Windows 2008 family OS (Vista, 2k8 or Win7) which has
UAC feature.
If above does not work then you really don't have permission then follow below.
Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out
Start the instance of SQL Server in single-user mode by using either the
-m or
-f options. Any member of the computer's local Administrators group can then connect to the instance of SQL Server as a member of the
sysadmin fixed server role.
http://msdn.microsoft.com/en-us/library/dd207004.aspx
Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog: http://blogs.msdn.com/blakhani
Team Blog: http://blogs.msdn.com/sqlserverfaq -
"SQL Expression Fields" branch missing from Formula Workshop/Field Explorer
Hello,
I am using Crystal Reports XI R2 SP3. Some recent information I have seen suggests that I should use a feature called "SQL Expression Fields". If I search the built-in Crystal Report help for "SQL Expressions", on the help pages I see that there is a "SQL Expression Fields" branch in the left pane of the Formula Workshop, just under Formula Fields and just above Selection Formulas (it's unfortunate that I cannot embed a bitmapped screen print of this). The left pane of the Formula Workshop looks like this:
Report Custom Functions
Repository Custom Functions
Formula Fields
SQL Expression Fields
Selection Formulas
Formatting Formulas
However, in my local copy of Crystal Reports the SQL Expression Fields branch does not exist - the left pane of the Formula Workshop looks like this:
Report Custom Functions
Repository Custom Functions
Formula Fields
Selection Formulas
Formatting Formulas
Is there some special patch, add-in or plug-in that's necessary to enable this functionality?
Thanks in Advance,
Bob GardnerI set up a DSN to a local MS Access database and used it for an ODBC connection. Once connected, the SQL Expression Fields branch was available in Field Explorer and Formula Workshop.
But I am developing reports for an ERP system that uses Oracle 10g databases - I have no choice but to use Oracle 10g databases as data sources for my reports. I am not sure how to set up an ODBC connection to an Oracle database as I have never had to do so - will SQL Expression Fields not work with the native Oracle driver?
Thank you,
Bob Gardner -
First time an SQL expression is placed on report a DB SELECT executes
The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue). I'm using CR XI.
Symptom:
We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
Some Detective Work/More Info:
After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
Steps to re-create:
1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
2. Add a new "SQL Expression" to your report.
3. Drag and Drop your new "SQL Expression onto your report
4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
The Problem:
I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
Questions:
Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
Anybody else notice this and have a "work around"?This is a cross post of:
1st time an SQL expression is placed on report a DB SELECT executes
Please do not cross post. See the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
The above post has been moved to the Crystal Reports Design forum, thus locking this thread.
Ludek -
1st time an SQL expression is placed on report a DB SELECT executes
The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).
Symptom:
We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
Some Detective Work/More Info:
After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
Steps to re-create:
1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
2. Add a new "SQL Expression" to your report.
3. Drag and Drop your new "SQL Expression onto your report
4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
The Problem:
I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
Questions:
Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
Anybody else notice this and have a "work around"?Note that this is a "Lagacy Application Development SDKs" forum and as such it is dedicated to topics related to legacy SDKs, including the Report Designer Component (RDC), OCX, VCL, and Crystal Reports Print Engine (CRPE).
As your issue concerns the Crystal Report Designer (crw32.exe), transferring to the Crystal Reports Design forum:
SAP Crystal Reports
Ludek -
First time an SQL expression is placed on report a DB SELECT executes -CRXI
The same problem can be created using the normal Crystal Reports XI Release 2 developer environment and/or code (not only a code issue).
Symptom:
We dynamically auto generate SQL Expressions, Tables, Joins, Formula's and anything through C# and place it onto the Crystal Report through code via run-time user input in a web environment. I recieved a notification from one of my DB admins that crystal reports is causing massive memory consumption via unknown SELECT statements that have no joins and/or WHERE criteria.
Some Detective Work/More Info:
After using Microsoft "SQL Profiler" along with Crystal, I understand what is happening but don't know the "work around" to make Crystal stop executing the following SELECT scenario.
Anytime I create a new "SQL Expression" for the first time and then physically "drag and drop" it onto the report then Crystal is executing a "silent" SELECT statement against the database in the design environment. I'm calling it "silent" because I need MS SQL Profiler to see it happen. I'm guessing that this is used for validation or something but this is causing problems when automatically generating a report in a production environment.
Steps to re-create:
1. Open MS "SQL Profiler" and get it running. (will show Crystal Engine silently executes the SELECTS)
2. Add a new "SQL Expression" to your report.
3. Drag and Drop your new "SQL Expression onto your report
4. You will see that Crystal has created an SQL query and executed it against your database in design environment.
The Problem:
I can see under normal circumstances why you might want this funtionality (if it's actually used for the Crystal Engine to validate your SQL Expression). But, What also makes this functionality horrible is that on my behalf Crystal is creating these SELECT statements and using cross joins which is a major problem in a production environment. As a result, huge record sets are being created on our DB Server. I don't believe that this has any purpose in a production evironment when the cross-joins can create huge amounts of results just for the sake of Crystal Internally validating a new SQL Expression placed onto a report. It would be nice to disable this functionality in production. I don't know a "work around" since these SELECT queries are created on my behalf by the Crystal Engine at design time (via code auto generation in production).
Questions:
Can this functionality be disabled to prevent a production server from incurring the execution of these queries?
Anybody else notice this and have a "work around"?duplicate - please do not post multiple times
Maybe you are looking for
-
2 Octobers ago I purchased a Bamboo tablet that came with Corel painter and PSE 7. I recently got a new laptop and decided I wanted to put PSE 7 on my new laptop. I had a problem finding the program and still cant find it. It was in a box with my ser
-
Trying to get rid of the purple highlighting of websites I visited. Clearing history doesn't change things. Does every website you ever visit stay highlighted?
-
Developing mobile apps for the blackberry platform
Hello all I'm interested in developing mobile apps for the Blackberry smartphone and read that the best way to do it is with Java. Any advice on how to do this? I would be starting from scratch as I don't have a programming background but am keen to
-
I can't open files on the website that I've gotten them from previously. Help! I really need them for work. Two things I've changed recently: 1. One trusted website suggested getting Adobe Reader, which I did (version 11.0.03). 2. I upgraded from m
-
Weird scripts in corrupted RH9 project
Hi! I'm having trouble with a small 75-topic project in RH9. I just upgraded it from RH7 last month. The application runs on XP, service pack 3. The project file is located on a desktop and has a short access path (c:\RH9Projects\). I have in all 4 s