Return data type in Crystal syntax formula
Post Author: gpeters
CA Forum: Formula
How do you control the data type a Crystal formula returns? I'm relatively new to Crystal. I'm developing a formula, and initially I'm having it return Boolean values. However, my intent is to have it eventually return a string value. Now, it seems that no matter what I do, this formula is determined to only return a Boolean value. Should I have used Basic syntex instead? Very frustrating to be fighting syntax stuff.
Post Author: SKodidine
CA Forum: Formula
If you could copy your formula here then it would paint a better picture to help you out. In general, you can change the data type to string (totext) and also to number (tonumber) in a formula. It all depends on what you are trying to accomplish.
Similar Messages
-
Data type of Crystal syntax formula
Post Author: gpeters
CA Forum: General
How do you control the data type a Crystal formula returns? I'm relatively new to Crystal. I'm developing a formula, and initially I'm having it return Boolean values. However, my intent is to have it eventually return a string value. Now, it seems that no matter what I do, this formula is determined to only return a Boolean value. Should I have used Basic syntex instead? Very frustrating to be fighting syntax stuff.Post Author: CoolTowers
CA Forum: General
Generally strings are used with text such as address blocks, names, etc. Crystal interprets anything in quote marks as a string; then you just add them together.
You can try the ToText function to convert other data types to a string data. For example:
"Thanks for purchasing" + ToText({lastyear.sales}) + "in parts last year".
Look under the Function Tree box under Strings, then ToText for ways to use the function. -
Hi,
I'm a beginner in Java and am want to find out all the different return data types that can be used in a method declaration.
At the moment I know of void and static, is there a page on the web I can go to in order to find all the different return types??
Thanks in advance for your help.I'm new myself, so must not understand the question or the answers. I thought methods could return any datatype, reference or primitive. This method takes info from a dialog box (two combo boxes, a textfield and a password field) and encapsulates the data into a return type User for delivery to another class, for subsequent use in making a jdbc connection:
public User setUser()
return new User((String)driverFields.getSelectedItem(),
(String)urlFields.getSelectedItem(),
userName.getText(),password.getPassword());
[\code] -
Formatting dates and return date type
Hi,
I am working with SQL Server 2012 with English(United States) language set, it's not posible change this parameter.
If I execute this sentence
declare @d
date='06/22/2015'
select @d
Response:2015-06-22 (yyyy-MM-dd)
I want to obtain 22-06-2015 (dd-MM-yyyy) with type date.
I have tried with format(@d,'dd/MM/yyyy') and convert(varchar,@d,103) but these functions return varchar and after the order in Excel doesn't work about date.
I have tried too
declare @dvarchar(10)='22/06/2015
select parse(@dasdateusing'es-ES')asResult
The response is the same
Response:2015-06-22 (yyyy-MM-dd)
How can I obtain "22-06-2015" in data type?
Thanks,I want to obtain 22-06-2015 (dd-MM-yyyy) with type date.
A data of type "date" don't have any format as it, it's just a (internal numeric) value; it's always the frontend which format's this value.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Return data type mapping in Java sp.
Hi,
I have a java stored procedure returning a long[] as return value. I have been searching internet for solution for how to construct its Call Spec but nothing.
Is anyone knowing this, drop some lines , please.
Thanks first.Hi,
I have a java stored procedure returning a long[] as return value. I have been searching internet for solution for how to construct its Call Spec but nothing.
Is anyone knowing this, drop some lines , please.
Thanks first. -
Hi,
I have a web service method which returns Date type value.
That method is used by a j2me client.
But j2me web services does not support Date type.
Are there any possible ways that I can get around this limitation?
Thanks,
Chamal.Hi Rohit, the input of ws is a structure like this:
date
installationNr
sid
userID
.Workload
..aDataVol
..aDbTime
..bsteps
..client
..cputime
..dsteps
..QuequeTime
..respTime
..sDataVol
..sDbTime
..steps
..userAccnt
..usteps
It returns nothing...
When I call this ws after I have used all generated classes in model error is:
Array Property [Item] in class [none] must not have NULL elements. This is restricted by schema description.
I invoke this ws with XmlSpy and I see that there is a tag <item> after tag workload, and item contains the next tags. So there's one level that generated classes don't see.
any ideas?
thanks
Andrea -
What is the data type of the value returned by the List box prompt in crystal
Post Author: Mudit Kothiyal
CA Forum: Formula
Hi all,
I am creating a report which has a list box prompt. When I am selecting a single value from the list box the report is working fine, but when I am selecting multiple values its not returning any data( although data is there). Does anyone know how the prompt values are passed to the report query by the crystal. I kno it passes the value to the report as an array. But how does it pass the value to the report query.
I am using command query to fetch data from the DB.
Crystal Report Version: Crystal Report XI R2.
DB: Oracle 10g
Also does anyone know how to pass the values of the list box prompt to the report query in comma seperated format.
Thanks & regards,
MuditPost Author: rcoleman
CA Forum: Formula
In regards to the latter part of your question
The following examples are applicable to Basic and Crystal syntax.
The examples assume that list is a String array consisting of the 3 elements: "Chocolate", "Vanilla" and "Strawberry".
Join (list)
Returns the String "Chocolate Vanilla Strawberry".
Join (list, "***")
Returns the String "Chocolate**Vanilla**Strawberry".
Not sure about the first part of your question,sorry. -
How to have a member formula to reference a text data type member?
Hi there
I am just wondering how do you use a member formula to grab the text in a text data type member?
Our situation is that we have a text data type member in the Accounts dimension (called Project Manager). This is a free text field users can input a project manager's name. However, for our reporting purposes we want to report the Project Manager next to a list of Accounts (i.e. in the same row). The way we have tried to achieve this is to create dynamic calc text data type members in the Version dimension that simply refer to the Project Manager account using the reference function (->).
Although this works, when we run a report we get a number (assuming this is just the reference ID to the RDBMS field) instead of the actual name. We have set the dynamic calc member to text data type as well. We are using a planning connection as well.
Does anyone know how to make this work?
ThanksAre you talking about FR reports, does it display the text if you reference the original member using a planning connection, if it does then it probably looks like you can't do it using the method you are trying as it is an essbase formula and in theory it will just return a number.
Cheers
John
http://john-goodwin.blogspot.com -
Crystal reports converting varchar 254 to memo data type
Hi All,
We are still using Seagate Crystal Reports 7.5 for some of our reporting. I have a problem that hopefully someone can help with. One of our connections is to ODBC- AR System ODBC Data Source.
In that data source there are fields defined as varchar 254 (confirmed by DBA),
But Seagate is calling them memo fields- which is causing problems since you canu2019t use memos in selection criteria or formulas.
This happened after the field names were renamed. I noticed when the newly named fields were not showing as an option to map the old name fields to- because by default it looks for same data type, after unchecking same data type option the fields showed for mapping but wrong data type makes them useless. I canu2019t even convert them to string with formula field.
Any input would be greatly appreciated.
Thanks-Hi,
Yup, this was a problem with versions prior to 10. If a field was longer than 254 characters, Crystal handled them like Memos and you cannot use them in formulas.
The only suggestion I can offer would be to upgrade. Crystal can now use memos in formulas and no longer has a 254 character limit on strings. So your charcter fields will remain as charater and not changed to Memos.
Good luck,
Brian -
Diffrent Data Type & Formula in Cross Tab
Post Author: ade
CA Forum: General
I using crystal reports 8.5. I make cross tab like this to viewing reportsSubject Evaluation Aspect Score1 Score2 Score3 Score4 Score5 Math Conceptual Understanding 80 75 70 80 A Problem Solving 77 80 90 67 BEnglish Reading 89 80 86 80 A Wring 80 80 70 85 Bfrom the table above, there are 2 types of different data they are numeric and string.In the using of logical "if" in cross tab is not allowed to use different data type and I don't understand on it... would you please help me, what shoul I do then?Yes it is possible.
It would be easier in CR2008 where you have the ability to add Calculated Members.
In previous versions you would need to create a variable for each year and using the GridRowColumnValue function assign the current value to a variable. You would then need to add a second summary field as a "dummy" summary and in the Display string formula declare the variables and manipulate the values as you like and finally convert the output to string. -
Crystal Syntax "Like" Statment on date searches.
Post Author: smilbuta
CA Forum: Data Connectivity and SQL
Hello,
I am currently developing an application using VS2005 and Crystal Reports.
I wish to pass a Crystal Syntax statement to the report that searches for like dates in a date column in a SQL 2005 Database..
The statments as follows.
crystalsyntax = "{EQ_Equipment.equipment_warranty} like '2009'"
I get returned an error saying string expected??
so i tested diferent formats, and if i use this string i get only one record returned out of a known test group of 10 records.
"{EQ_Equipment.equipment_warranty} Like DateValue('2009')"
so im unsure what im doing wrong. Any advice would be apreciated.Post Author: Jagan
CA Forum: Data Connectivity and SQL
LIKE is used to compare strings. You're trying to compare a date with a string. That's why it says "string expected".
I'm not sure what the result of DateValue('2009') is, but it's pretty certain that what you've then got is a date (warrenty) being 'liked' with a date, so both are being implicitely converted to strings first.
What you could do is explicitely convert the warrenty date to a string in a format of your choice (don't rely on the implicit format) and then LIKE that with '2009'.
Or change your statement to Year() = 2009 but this might result in Crystal doing the hard work instead of the database.
Best would be to test that the warrenty date is in the year range, so that you can still use any index that might exist on the warrenty date column. See the help on 'in range operator'. e.g. in DateValue(<year>, 01, 01) to DateValue(<year>, 12, 31) -
Crystal Data Conversion Issue (Error converting data type varchar to datetime)
Hi,
I can run stored procedure without error in SQL Server using my personal credentials as well as database credentials.
I can also run Crystal Report after connecting to Stored procedure without error on my desktop using my personal credentials as well as database credentials.
But when I upload the crystal report in BOBJDEV and when I run using database credentials report fails saying that "Error in File ~tmp1d1480b8e70fd90.rpt: Unable to connect: incorrect log on parameters. Details: [Database Vendor Code: 18456 ]" but I can run the crystal report successfully on BOBJDEV using my personal credentials.
I googled (Data Conversion Error Message) about this issue & lot of people asked to do "Verify Database" in Crystal Report. So I did that, but when I do it I am getting a error message like this:
Error converting data type varchar to datetime.
Where do you think the error might be occurring? Did anyone faced this kind of issue before? If so, how to resolve it?
(FYI, I am using Crystal Reports 2008, & for stored procedure I have used SSMS 2012 )
Please help me with this issue.
Thanks & Regards.
Naveen.hello Naveen,
since the report works fine in the cr designer / desktop, we need to figure out where you should post this question.
by bobjdev do you mean businessobjects enterprise or crystal reports server? if so please post this question to the bi platform space.
-jamie -
Data type column size does not match size of values returned
I've tried searching but couldn't find what I was looking for, sorry if this has been answered or is a duplicate.
I am using the (Java) method below to get the column definitions of a table. I am doing this through an ODBC connection (using Oracle ODBC driver) and I have NO CHOICE in the matter.
The problem I am having is that one particular column has a column size is smaller than the size of the data it purportedly holds (ie attendance_code = varchar size 3 but data value is "Absent". I suspect the data is actually a look up to situation, where my attendance_code column has a value of 'ABS' and Oracle goes and fetchs the "Absent" value.
My issue is that the meta data returned from ODBC is the actual column definition (ie varchar(3) and not varchar2(10) for example).
The resultset metadata has a size of 3 for the column in question, and querying the schema also yields 3 for that column.
How do I resolve this? I do not have access to all_columns table etc. I have to do it using ODBC metadata only.
I've tried recreating the situation using the Oracle XE DB, but as I am not familiar with Oracle, I do not know how to recreate this scenario (which would then lead me to test other options with ODBC).
TIA.
The select I am using is SELECT * FROM <tableName>.
public ArrayList<SchemaColumn> getColumnsForTable(String catalog,
String schema,
String tableName) {
ArrayList<SchemaColumn> columns = new ArrayList<SchemaColumn>();
ResultSet rs = null;
try {
DatabaseMetaData metaData = connection.getMetaData();
rs = metaData.getColumns(catalog, schema, tableName, "%");
SchemaColumn column;
while (rs.next()) {
column = new SchemaColumn();
column.setName(rs.getString("COLUMN_NAME"));
column.setDataType(rs.getInt("DATA_TYPE"));
column.setTypeName(rs.getString("TYPE_NAME"));
column.setColumnSize(rs.getInt("COLUMN_SIZE")); <-------- this is the value that is coming back smaller than the data it actually returns
column.setDecimalDigits(rs.getInt("DECIMAL_DIGITS"));
column.setNumPrecisionRadix(rs.getInt("NUM_PREC_RADIX"));
column.setNullable(rs.getInt("NULLABLE"));
column.setRemarks(rs.getString("REMARKS"));
column.setDefaultValue(rs.getString("COLUMN_DEF"));
column.setSqlDataType(rs.getInt("SQL_DATA_TYPE"));
column.setSqlDateTimeSub(rs.getInt("SQL_DATETIME_SUB"));
column.setCharOctetLength(rs.getInt("CHAR_OCTET_LENGTH"));
column.setOrdinalPosition(rs.getInt("ORDINAL_POSITION"));
columns.add(column);
} catch (Exception e) {
Log.getLogger().error("Could not capture table schema");
closeResultSet(rs);
return columns;
}I can't say I've ever seen a case where a column held more data than it was declared as, and would have to file that under "see it to believe it" category.
Even if that somehow were the case, I'd expect the ODBC driver to return what the column is defined as anyway, not the data. The data changes with every row, but I'd expect the table metadata to be consistent, and refer to the table definition.
For grins though, can you provide system.out.println output of the metadata, and also a "describe xxxx" from sqlplus if you can, where xxx is the table name?
ie,
while (rs.next()) {
System.out.println("column name is " + rs.getString("COLUMN_NAME"));
System.out.println("data type is " + rs.getInt("DATA_TYPE"));
..etc..
Greg -
How can i add formula to waveform data type?
I want to interpolate my acquired data in terms of voltage to temperature. For this i need to use polynomial equation, but i am not able to directly attach formula node to the waveform data type. I want to know how can i add formula node to waveform data, and then also have it real time.
One additional thought that may be helpful. Once you get the Y component of the waveform graph you are going to attempt to wire this into a formula node. You can do one of two things with that array. Put a for loop around the formula node and index the array into and out of the for loop. This allows you to do scalar math on the data. It is also possible to index and array in a formula node. The following KnoledgeBase demonstrates how to do this: http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9d72b6069346942386256a0d00604ed4?OpenDocument
-
Function returning string. Data type question
Hello all,
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
Our database has a parent record master_member_record_id & and children of those records member_record_id. I wrote a function which returns the master record for the child.
eg. get_master(member_record_id). simple enough.
I have wrote the opposite of this also, get_member_records(master_member_record_id). Obviously this function has multiple records to return so I have it set to return a listagg string with ',' separation. They want to be able to use this function as follows:
select * from member_table where member_record_id in (get_member_records(master_member_record_id));
or something similar, I realize this is a data type issue here, wondering if this is even possible. What do you think?
Thanks in advance for your criticism/help,
ChrisMy disagreement is with how pipeline table functionality is used.
Instead of this (what it sounds like the OP is doing but returning CSV format)
create or replace type TClientIdArray is table of number;
create or replace function GetClientIDs( parentID number ) return TClientIdArray is
array TClientIdArray;
begin
select
client_id bulk collect into array
from master_table
where parent_id = parentID;
return( array );
end;A pipeline would look as follows:
create or replace type TClientIdArray is table of number;
create or replace function GetClientIDs( parentID number ) return TClientIdArray pipelined is
begin
for c in (select
client_id
from master_table
where parent_id = parentID ) loop
pipe row( c.client_id );
end loop;
return;
end;The first method is in fact more sensible in this case, especially when used from PL/SQL. A single SQL call/context switch to get a list of client identifiers. The issues with the first method are
- cannot effectively deal with a large data set of client identifiers
- would be suboptimal to use this function in subsequent SQL
- if called by a client, a ref cursor (not collection) should be returned
But assuming that the list of client identifiers are needed to be stepped through via complex PL/SQL app processing, using a (small) array is fine (assuming that concurrency/locking is not needed via a FOR UPDATE on the select that identifies the client identifiers to process).
A pipeline in this case does not do anything better. It introduces more moving parts - as a native PL/SQL can no longer be used to get the collection and step through it. A TABLE() SQL function is needed, a SQL statement, and more context switching.
The pipeline is simply an unnecessary layer between the code wanting to use the client identifiers and the SQL statement supplying the client identifiers. This approach of SQL -calls-> PIPELINE -calls-> MORE SQL is invariable wrong - unless the pipeline (PL/SQL code) does something very funky with the data from its SQL call, prior to piping it, that cannot be done using SQL.
If the "user" of that client identifiers is SQL code, then both the above methods are flawed. As this code is already SQL, why use PL/SQL to call more SQL code? Simply use the SQL code/logic that supplies the client identifier list directly in the SQL code that needs the client identifiers. This means something like SQL JOIN, EXISTS, or IN clauses.
Maybe you are looking for
-
Auto find tracks not in playlists and delete them?
Is thre any way I can auto find all tracks that are not in any of my playlists and delete them all in one go?
-
India Localisation on R12.0.1
Dear ALL, We are on Oracle application 12.0.1 on solaris 9. We wanted to apply India localisation on this instance. while putting to 11i instance we followed the note 340169.1 to get the patch list. Pl suggest us the patches to get the india Localiza
-
Hello, We have implemented a distribution model to register changes in some infotypes for object types O, S, C, JF. One of the infotypes to be passed is 1001. It works for all the infotypes and objects, including infotype 1001, but there is a relatio
-
Problem in SAX XSD schema validator
hi I've tried this code to validate XML using xsd file: public static void validate(String xmlFilePath, URL schemaFileUrl) try SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false);//
-
Have restarted and redownloaded, didn't fix.