Crystal Reports 6.0 Error Code 997 - crystal-reports

Can anyone describe "Crystal Report Engine Returns Error Code 997" for Crystal Reports 6.0?
Googling proved futile.

Are you using a long datatype in the data source?
If your theory is right, and if you have the long datatype in either a CONNECT BY, GROUP BY, or ORDER BY clause, that could be the culprit. From what I have read, the ORA-00997 error is as follows:
ORA-00997: illegal use of LONG datatype:
Cause: A value of datatype LONG was used in a function or in a DISTINCT, WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be used in a SELECT clause.
I have seen Crystal Reports bubble up unhandled SQL Server errors before, so it's possible.

Related

Crystal Reports Record Section not returning same data as sql

I found a solution that another Tech had posted:
New Formula:
{Product.Size} <> “xsm” or IsNull({Product.Size})
Unfortunately, when preview your report, you will find that this doesn’t work. That is not because of a mistake in our logic but rather, what I consider to be a bug in Crystal Reports. If I took this exact same condition and applied it to the database records using a query analyzer or querying tool, I would see the blank records. Unfortunately, Crystal is not allowing the null values to come through even though our formula says that they should.
The trick to circumventing this bug is to put the IsNull() check FIRST in the formula.
Thus, if we rearrange the condition to this:
IsNull({Product.Size}) or {Product.Size} <> "xsm"
WORKED LIKE A CHARM
Problem is, if I select criteria for the second OR statement ({HiredRate.UTRANSDOC}startswith{?TransYN}) and NO for the first ({HiredRate.UTRANSWEB}startswith{?WebYN}) I get only one record that meets the TransYN criteria. If I switch places in the formula putting ({HiredRate.UTRANSDOC}startswith{?TransYN}) 1st I get all of the data.
When I run the SQL query I get all of the data no matter what order they are in. The Crystal Preview only gives me all of the data on the first from the OR section.
The only thing that stands out looking at the data from SQL is that the one record Crystal is returning has YES in the Transdoc field and the Transweb field is blank. All other records show YES for Transdoc and NULL for the Transweb field.
Here is the Crystal Record Selection Formula
{HiredRate.CONTSUPREF} startswith {?LanguageCombo}
and {HiredRate.ONDATE} = {?ProjectDate}
and {HiredRate.ACTVCODE}= "SIG"
and {HiredRate.RESULTCODE} = "CLM"
and (
{HiredRate.UTRANSWEB}startswith{?WebYN}
or {HiredRate.UTRANSDOC}startswith{?TransYN}
or {HiredRate.UTRANLANL0}startswith{?LanloYN}
or {HiredRate.UINTCONSEC}startswith{?InterpYN}
or {HiredRate.UINTCONF}startswith{?IntConfYN}
or {HiredRate.UINTOPI}startswith{?OPIYN}
)
Here is the SQL query Crystal is using:
SELECT HiredRate.DEAR, HiredRate.CONTSUPREF, HiredRate.LASTDATE, HiredRate.CONTACT, HiredRate.USOURCLANG, HiredRate.UTARGLANG, HiredRate.UTRANSDOC, HiredRate.UTRANSWEB, HiredRate.UTRANLANL0, HiredRate.UINTCONSEC, HiredRate.UINTCONF, HiredRate.UINTOPI, HiredRate.ONDATE, HiredRate.ACTVCODE, HiredRate.RESULTCODE
FROM GoldMine_Main.dbo.HiredRate HiredRate
WHERE HiredRate.CONTSUPREF LIKE 'ENG>SPA%' AND (HiredRate.ONDATE>={ts '2012-04-01 00:00:00'} AND HiredRate.ONDATE<{ts '2013-04-06 00:00:00'}) AND HiredRate.ACTVCODE='SIG' AND HiredRate.RESULTCODE='CLM' AND (HiredRate.UTRANSWEB LIKE 'NO%' OR HiredRate.UTRANSDOC LIKE 'YES%' OR HiredRate.UTRANLANL0 LIKE 'NO%' OR HiredRate.UINTCONSEC LIKE 'NO%' OR HiredRate.UINTCONF LIKE 'NO%' OR HiredRate.UINTOPI LIKE 'NO%')
ORDER BY HiredRate.DEAR, HiredRate.CONTACT
This is happening because the {HiredRate.UTRANSWEB} is null - the rest of the expression is therefore evaluating as null in Crystal, even though (logically) it shouldn't.
When the first two or conditions are swapped around, the {HiredRate.UTRANSDOC} condition evaluates as true and the rest of the expression is short-circuited - which is why records are then selected.

JasperReports parameters works in iReport but fails on JasperReports Server (II)

I have a very similar problem to the one described at [JasperReport parameters works in iReport but fails on JasperServer] post.
The report works properly within the iReport environment using Preview option but fails within JasperReports Server
The comments suggest that iReport does not create the InputControl within JR Server. So I verified that the server contained the proper InputControl (that apparently solved their issue).
The input control called sk serial selection :
ID: ic_sk_serial
Name: sk serial selection
Type: Single Select Query
Mandatory: false
Read Only: false
Visible: true
Query resource:
From repository (pointing to *q_sk_serial* see below)
Value and Visible columns:
Value column: id
Visible query columns: serialnr
The input control query called q_sk_serial (populate the inpute control with a list of alphanumeric serial numbers, items are unique):
select id,serialnr from "public"."serials" order by serialnr;
The parameter name:
ic_sk_serial
The report query:
select * from "public"."datas" datas where datas."serialnr" like $P{ic_sk_serial}
In my case, input control seems to work properly in both environments (within iReport preview and JasperServer): I populate a list of items coming from the same database; I see that dropdownlist as expected within iReport but also on with JR Server.
Within iReport, the drop-down list returns the correct selected value in a report parameter which lead to the correct report. In JasperReports Server I only get a "The report is empty" message. So I tend to think the report parameter is not properly passed through within JasperServer.
Hardcoding the "Input control" output value, shows expected report.
Side note: I am using iReport 4.7.1 in compatibility mode with JasperReports Server 4.5.0.
I would be glad to hear if anybody ran into the same problem?
How can I debug further the report execution in JR Server?
Is compatibility mode susceptible to cause that issue?
What about the input parameter type? I use a query that return a string. However my input data type is text (closest match to string). My parameter type is java.lang.string. Does this make sense?
Actually that is a simple bug:
I just found out that:
value column: id
Should be
value column: serialnr
Still, I do not understand why the report was working in preview mode? Such big mistake should fail on preview no?
In anycase thanks to everybody to lead to my mistake ;)
In my point of view, there are two types of parameter within a jasper report including: Report parameter and Dataset Paramter.
Firstly, you must create both parameters and then map the one of Dataset to the one of Report.
I encountered the same problem to you thus that resolved my case.

Crystal Reports V11 Showing different boolean values per machine

I'm getting a weird issue with Crystal - I have a basic report that displays records dependant on a boolean value ('open') being true. However, on some PCs it works fine, on others it just shows displays a blank report.
Having done a bit of checking into this, viewing the SQL query seems to indicate that there's an issue with how Crystal is interpreting the boolean value on different machines.
If we select 'Show SQL query' on each of the machines, the ones that don't work show the boolean section as:
`support`.`open`=1
The ones that work show:
`support`.`open`=.T.
...which seems more realistic due to the datasource being a VFP table via an ODBC driver.
I can't quite figure this one out - I suppose it's possible it's something to do with the ODBC driver. Does anybody have any clues as to why this might be happening?
Thanks
The boolean should be directly interpreted through the ODBC... I would change the query to just have
Where 'support.open'
If logical, it will only be .T. / .F. or true / false or 1 / 0... Let the ODBC handler handle it for you.
--- Edit via comment.
I wasn't referring to Crystal's report formula, but the query... But if thats the issue in Crystal, I would change the query that is RETRIEVING the data to be...
IIF( support.open, "YES", "NO " ) as ItemIsOpen
VFP OleDB / ODBC should recognize the IIF() and return the column to a string of "YES" or "NO " respectively... Then use the "ItemIsOpen" column in your report instead of the "support.open" column.

SSRS 2008 passing multiple parameters Oracle 10g backend

after several years of using Cognos, we are in process of testing conversion of Cognos Reports (8.3) to SSRS 2008 reports. we use Oracle database version 10g. in many of our reports we are converting we pass multiple values in parameters, however i cannot get this working in SSRS pointing to the Oracle datasource.
i have created parameter and set it to allow multiple values. these columns are integer types. the SQL filter is set as follows for example, where vendor_id IN (:Vendor_id). yet when I test the SQL, i get errors. i enter parameter values as comma-seperated for example, 102, 105, 107. errors as follows.
ORA-01722: invalid number
i've tried wrapping value in single, double quotes with same result. is there a different format to meet oracle syntax requirement? does multiple values only work for SQL server databases?
thanks in advance.
joe
As pointed out in this post, multi value parameters are concatenated and used as follows:
Select * from Table WHERE column1 in (:CommaSeparatedListOfValues)
http://consultingblogs.emc.com/stevewright/archive/2009/08/14/14763.aspx
So Vendor_id has to be Varchar2. I guess you have the data type of Vendor_id as integer?.

Crystal Reports XI with Oracle Function wm_concat()

Within Crystal Reports XI I'm trying to have a SQL Expression Field with Oracle 10g function wm_concat(column_name). It appears that Crystal Reports XI is not handling this function properly. If I execute the function wm_concat() within the database, it works fine, however, when trying to use it in Crystal Reports it displays a blank page. Whats interesting is that this field is within a sub-report, yet the whole report displays as a blank page.
Crystal Reports can tell at design-time that this function is valid (It doesn't let you save the SQL Expression if its not valid). So its a runtime error. I have also tested using various Oracle functions such as TO_CHAR() and REPLACE() and these all work fine with Crystal Report SQL Expressions. Any ideas?
WM_CONCAT isn't a built-in function, and isn't necessarily installed with a database.
You could try WMSYS.WM_CONCAT, as the function is actually owned by the WMSYS schema.
You may need to add a specific grant. By default, if it is there, it has EXECUTE granted to PUBLIC but your DBA may have revoked that and replaced it with specific grants.
I couldn't get WM_CONCAT to work; Since the queries execute flawless in Oracle, but not in Crystal Reports I would assume it is something within Crystal Reports. I ended up having to make a PL/SQL Stored Procedure and call it from the Crystal Report. I called the Stored Procedure from a SQL Expression Field within Crystal Reports.