Monday, April 22, 2013
How to convert Amount in Words using Crystal Report?
2:35 PM
How to Convert Amount (Currency) in words directly on Crystal Report.
Just Simply copy paste below code in your function.
To Create function follow the steps given below:
i) go to Field Explorer
ii) right click on Formula Fields click on New give specific name
iii) Formula Editor window will open just paste the Code given below
iv) Save & Close...
v) Just drag the Field to your specific required Location that done...
Changes to be made from your side is
i) vwCostTypes.UnitCost : This is a Database Field. Change as per your requirement.
Please note if you have Currency as Datatype in SQL DB than Do use ToNumber() function to convert it to number otherwise it will throw error of Number Required.
Please have the below code:
//#####################
//Created by Anup Shah.
//#####################
numbervar RmVal:=0;
currencyVar Amt:=0;
numbervar pAmt:=0;
stringvar InWords :="Rupees
";
Amt := ({vwCostTypes.UnitCost});
if Amt > 10000000 then RmVal :=
truncate(ToNumber(Amt)/10000000);
if Amt = 10000000 then RmVal := 1;
if RmVal = 1 then
InWords := InWords + "
" + towords(RmVal,0) + "
crore"
else
if RmVal > 1 then InWords := InWords + " " + towords(RmVal,0) + " crores";
Amt := Amt - Rmval * 10000000;
if Amt > 100000 then RmVal :=
truncate(ToNumber(Amt)/100000);
if Amt = 100000 then RmVal := 1;
if RmVal >=1 then
InWords := InWords + "
" + towords(RmVal,0) + "
lakhs";
Amt := Amt - Rmval * 100000;
if Amt > 0 then InWords := InWords + " " + towords(truncate(Amt),0);
pAmt := (ToNumber(Amt) - truncate(ToNumber(Amt))) *
100;
if pAmt > 0 then
InWords := InWords + "
and " + towords(pAmt,0) + " paisa
only"
else
InWords := InWords + "
only";
UPPERCASE(InWords)
//#####################
Saturday, April 20, 2013
How to insert null value into DateTime column?
2:08 PM
How to insert null value into DateTime column?
Please have a look at the below code...
Generally for Parameters you will write the commented code below....to insert the value in the respective parameters.
But If there is Date and having null value to pass you have to do bit different otherwise it will give error
of "Parameter missing..."
to overcome such error for the perticular scenario you have to write down the below written code.
Please have a look at the below code...
Generally for Parameters you will write the commented code below....to insert the value in the respective parameters.
But If there is Date and having null value to pass you have to do bit different otherwise it will give error
of "Parameter missing..."
to overcome such error for the perticular scenario you have to write down the below written code.
cmdnon.Parameters.Add("@orderedDate", SqlDbType.SmallDateTime);
//cmdnon.Parameters["@orderedDate"].Value
= this.orderedDate;
cmdnon.Parameters["@orderedDate"].IsNullable = true;
if (this.orderedDate == null)
cmdnon.Parameters["@orderedDate"].Value
= getNullDate;
else
cmdnon.Parameters["@orderedDate"].Value
= this.orderedDate;
this will remove your Error and successfully insert your expected null value into the Database.
Happy Coding!!!
Thursday, April 18, 2013
Display Check Box on Crystal Report Problem!
3:50 PM
Adding a Check Box to a Report.
To Display a checkbox on a report.
i) Create a formula to show checked and unchecked box.
ii) Please note the formula below...
if {MyField}=true then CHR(254) else CHR(168);
iii) Now Place your Field to Report at your required Location and change the font to Wingdings
iv) That's all....Great Job...;) Please have below symbol to change as per your choice and requirements. you can also have other symbols please check in Word to have the other symbols of the Font Wingdings.
Crystal Reports Error: "Invalid group condition"
3:36 PM
Error:
"Invalid group condition."
or
"This group section cannot be printed because its condition field is nonexistent or invalid. Format the section to choose another condition field."
This Bug arise only if you have bad group sectors like
i) Please do Database-> Verify Database
ii) Please check your Dataset provided to the Report for the actual field exists or not.
iii) Remove unused Group from your report
it will gone permanently...;)
Happy Coding...
"Invalid group condition."
or
"This group section cannot be printed because its condition field is nonexistent or invalid. Format the section to choose another condition field."
This Bug arise only if you have bad group sectors like
i) Please do Database-> Verify Database
ii) Please check your Dataset provided to the Report for the actual field exists or not.
iii) Remove unused Group from your report
it will gone permanently...;)
Happy Coding...
Tuesday, April 16, 2013
Anup Shah's invitation is awaiting your response
2:44 PM
|
Thursday, April 11, 2013
Invitation to connect on LinkedIn
11:55 AM
|

Thursday, March 14, 2013
Visual Studio 2010 Shortcuts ( 6. Tool Windows) Continue...
2:41 PM
Hello Guys!
This is very interesting I am gonna providing to you which helps you to manage as well as saves your time while coding
This is very interesting I am gonna providing to you which helps you to manage as well as saves your time while coding
6. Tool Windows | |
Ctrl+/ | Put cursor in the find/command box in toolbar |
Ctrl+k+b | Open code snippet manager window |
Alt+f11 | Open macro IDE window |
Ctrl+k+w | Open bookmark window |
Ctrl+Alt+k | Open call hierarchy window |
Ctrl+Shift+c | Open class view window |
Ctrl+Alt+a | Open Command window |
Ctrl+Shift+o | Open Output window |
Ctrl+Shift+e | Open Resource view window |
Ctrl+Alt+s | Open Server explorer window |
Ctrl+Shift+l | Open Solution explorer window |
Shift+Esc | Close Find & Replace Window |
Let me help to get more keys...
Happy Coding!!!
Subscribe to:
Posts (Atom)