In jasper reports for decimals we have some default patterns like (#,##0.###;#,##0.###-) for representing 111222333.12 as 111,222,333.12 .But know I want to know how I can get comma only one time that is 111222.333.12. Thanks in advance.
how to stop repetition of commas?
Related
I have a date field that shows as CYYMMDD. To get rid of the century I have just subtracted 1000000 to show the date as YYMMDD ex. 150814.
Now I want to add / between the numbers to show as 15/08/14.
How do I do this in the formula?
Thanks in advance!
There are few things to be considered here.
Simply right click on the date field once you place the same in crystal report, you will get options to format data. You can choose whatsoever suits you.
In case you go by your approach for substracting the number..., you can convert the number into strong and then can play with it.
Posting the links for the second point help.Split the number and modify in Crystal
I am developing a report in Crystal Reports 2011 that has 3 sub-reports pulling data from 3 different databases. I have a Multi-Value Parameter (String) in the main report that passes the input values to the 3 sub-reports which have the same Multi-Value String Parameter.
Sample Input Values are:
P000000030,
P000000930,
P000001730
The user does not want to input the leading alpha character and preceeding zeroes. They want to input the following:
30,
930,
1730
The sub-report pulls all of the records successfully if the user puts the entire string value in with the following Record Selection Criteria, but it does not work with the partial strings input:
{Command.Puchase Order} in {?Pm-?Reference}
Can anyone advise the syntax needed to pull the data in the subreport with the substrings as inputs?
Thanks in advance!
Thank you for your input guys!! I took a bit from everyone and came up with the following solution:
Create a column in the datasource that trimmed out the desired value --> ltrim(regexp_replace(a."po_num",'P',''),'0') as "Puchase Order2"
Modified my Record Selection Criteria to select for either column --> {Command.Puchase Order} in {?Pm-?Reference} or {Command.Puchase Order2} in {?Pm-?Reference}
I really appreciate your input! I am able to deliver the desired solution with your aid.
go ahead and create a formula that calculate the length of your parameter(len({?Pm-?Reference})) and place it suppressed on your report header. Then put below in your record selection formula
right({Command.Puchase Order},{your length formula}) in [{?Pm-?Reference}]
You could add the "number only" version of [Puchase Order] to your datasource...
cast(cast(right([Puchase Order], len([Puchase Order]) - 1) as int) as varchar(9))
as [Puchase Order Number]
...then use that in the select expert. I'm getting the number without the leading P, casting to int to remove the leading zeros, and then back to a varchar for the string comparison in Crystal.
You could do the same with a formula in Crystal reports. Then reference that formula in the select expert. Downside is having to repeat that in all 3 sub reports.
I'm designing a jasper report with the field type & text field type as double.
When run the jrxml file using jasperreports4.7.jar for excel format,
it'll add a single quote in numeric columns.
so i can't do any numeric manipulation in excel.but same is working fine in jasperreports3.jar.
is anyone facing the same issue?
pls help me
What you need to do is to define the field you want to print as an Integer or Double. (You must set your Report to java)
If I do not know yet what type of field is comming I am making, lets say 3 fields, one String, one Integer, one Double. Then I pass the info the what it is dynamically to another -meta-field.
In the designer I lay all 3 fields over each other. Seems to work.
In crystal reports I want to show the sum value of time objects, i.e. An employee worked in one month three days and on each day a variable amount of hours.
Is there anyway to sum a time field?
Or as a workaround I could use the time field as an integer, sum this and display. But then I would like to change the display format by using a formula. I cant find a way to include summary fields in a formula...
Thanks in advance
PS I am using CR 2011 (just the program not through VB or anything).
You cannot sum a date/time field. You will have to use datediff("n",{datetime1},{datetime2}) to get a time interval between two date/time fields in minutes.
To use a summary function in a formula, you can use this sum({#YourMinutesFormula},{FieldYouAreGroupingOn})
You may omit the second parameter if you want the summation over the entire report instead of a grouping level. Check the Crystal Reports help file for more details on Sum().
I'm getting an integer value as 2345 but I want to display it as 234.5
is it possible??
To get what you are looking for in a simple fix is like what kingpin stated above. Divide the value by ten. To do this just create a new formula in crystal by going into your field explorer and right clicking on the formula fields section. Under there should be a option to create a new formula. Then in window that comes up put the field you want to manipulate in the formula and then divide that by ten. And there you go. Now use the formula field in the report instead of the original field.
Here is a example of how it could look.
{Table_Foo.value_Bar} / 10
There is a field property for it. Don't have access to crystal reports at the moment, but I know it's there:
Crystal Report Provides an easy to use default thousand separator for numeric Fields. You can use it by checking Thousand Separator from Field Properties.
If you need a customized separator, check Customized Thousand Separator in Crystal Report.
You also might want to find some tutorials on the Crystal Reports themselves if you still have trouble.