I have column its name 'owner' and its has the following vlaue
ownerName
--------
Koni
Sally
Jimmi
Jone
Sami
and i want to print this value in crystal report as following using formula
ownerName
Koni
--Sally
----Jimmi
------Jone
--------Sami
thank you for any help
This can be done by using the following formula criteria:
If (RecordNumber > 1) Then
ReplicateString("-", RecordNumber) + {DatabaseFieldName}
Else
{DatabaseFieldName}
Related
How to find non-ASCII symbols in a string ? (We are using DB2)
We have tried following select statement but it is not working.
SELECT columnname
FROM tablename
WHERE columnname LIKE '%[' + CHAR(127) + '-' + CHAR(255) + ']%'
COLLATE Latin1_General_100_BIN2
I guess you were trying to use CHR() function, instead of CHAR(), which is a data-type.
If you are using a newer db2 version, that has REGEXP functions, you can try using REGEXP_LIKE() function.
Follow an example from samble db:
SELECT EMPNO, LASTNAME FROM EMPLOYEE WHERE REGEXP_LIKE(LASTNAME,'[E-H]')
EMPNO LASTNAME
------ ---------------
000010 HAAS
000020 THOMPSON
000050 GEYER
000060 STERN
000090 HENDERSON
000100 SPENSER
000110 LUCCHESSI
000120 O'CONNELL
000140 NICHOLLS
000170 YOSHIMURA
000180 SCOUTTEN
000190 WALKER
000210 JONES
000230 JEFFERSON
000250 SMITH
000260 JOHNSON
000270 PEREZ
000280 SCHNEIDER
000290 PARKER
000300 SMITH
000310 SETRIGHT
000320 MEHTA
000330 LEE
000340 GOUNOT
200010 HEMMINGER
200220 JOHN
200240 MONTEVERDE
200280 SCHWARTZ
200310 SPRINGER
200330 WONG
30 record(s) selected.
All names selected contains letters from E to H, as specified by the search-pattern.
As I didn't have any row containing such ranges.. I updated one of the rows, adding chars 169 and 174 to it.
Update employee set LASTNAME = ('LEE' || chr(169) || chr(174)) WHERE LASTNAME = 'LEE'
and, using this REGEXP_LIKE function:
SELECT EMPNO, LASTNAME FROM EMPLOYEE WHERE REGEXP_LIKE(LASTNAME , '[' || CHR(127) || '-' || CHR(255) || ']')"
EMPNO LASTNAME
------ ---------------
000330 LEE©®
1 record(s) selected.
Regards
Hi I am using Crystal Report 2008 to create a report. I need to convert the following oracle SQL query to Crystal Report record selection formula.
Oracle Query is :
AND
(
UPPER(920_SEARCH_REPORT.HANDICAP_TYPE) LIKE UPPER(:HANDICAP_TYPE)
OR UPPER(920_SEARCH_REPORT.SKSKODENR) LIKE UPPER(:SKSKODENR)
)
I have convert this to formula like following way :
and
(
isnull({?Hancicap_Type}) = true
or ((UpperCase({?Hancicap_Type}) Like ("*"&UpperCase({920_SEARCH_REPORT.HANDICAP_TYPE})&"*"))
or (UpperCase({?SKSKODENR}) Like ("*"&UpperCase({920_SEARCH_REPORT.SKSKODENR})&"*")))
)
But data is not showing when crystal report executes. But the sql query returns one record.
Can anyone help me to solve the problem.
You need to use the proper syntax for parameters: {?parameter_name}.
...
AND
(
( UPPER(920_SEARCH_REPORT.HANDICAP_TYPE) LIKE "*" + UPPERCASE({?HANDICAP_TYPE}) + "*")
OR
( UPPER(920_SEARCH_REPORT.SKSKODENR) LIKE "*" + UPPERCASE({?SKSKODENR}) + "*")
)
i have a report I am trying to modify in Crystal. It has a data field that has a formula in it, but I want to use another formula.
how to convert above crystal synax to basic syntax in crystal report
IIF ({rpl_bal_bundlelabels.recordcode} = "2",0 ,
IIF ({rpl_bal_bundlelabels.StdOdd} = "OS",
IIF ({rpl_bal_bundlelabels.totalsupply} > {rpl_bal_bundlelabels.standard},
IIF (({rpl_bal_bundlelabels.totalsupply} mod {rpl_bal_bundlelabels.standard}) > 0,
{rpl_bal_bundlelabels.totalsupply} - (({rpl_bal_bundlelabels.totalsupply} \
{rpl_bal_bundlelabels.standard}) * {rpl_bal_bundlelabels.standard}) ,
{rpl_bal_bundlelabels.standard} ) ,{rpl_bal_bundlelabels.totalsupply} ) ,
{rpl_bal_bundlelabels.BundleCopies} ) )
create a new formula
paste the text
correct the syntax, if necessary
set the result to formula =
My problem are same with this question
here
I tried the solution at that question but it only work if all the parameter has value, but when there are no value the Birt Report output this error
The following items have errors:
Table (id = 4):
+ Can not load the report query: 4. Errors occurred when generating the report document for the report element with ID 4. (Element ID:4)
Can you guys help me?
Thanks
In that example when the parameter has no value the query is not modified from what you put in the query text box. You could also do something like:
1- put a query in like select * from mytable
2 - Then put a beforeOpen script like:
if( params["myparameterval"] ){
this.queryText = this.queryText + " where col1 = " + params["myparameterval"].value;
}else{
this.queryText = this.queryText + " where col1 = hardcodedvalue"
}
I have a switch statement in a Crystal Report that looks like this:
stringvar tag := {table1.field1}; //contains a string value
select tag case
'First Value': {table1.field3}
'Second Value': {table4.field9}
default: 'Unknown';
But when I try to save the formula, I get this error:
---------------------------
Crystal Reports
---------------------------
The remaining text does not appear to be part of the formula.
---------------------------
OK
---------------------------
And it highlights the formula beginning with the single quote before the word "Second" in my example.
What stupid syntax error am I making?
Shouldn't this be written as...
select (tag )
case 'First Value': {table1.field3}
case 'Second Value': {table4.field9}
default: 'Unknown';
?
Note, I just looked the syntax online; I'm not a Crystal Reports specialist...