How Convert amount to rupees and paise in words in Devexpress Xtrareport - devexpress

I want to convert the summery of devexpress report to words. I found a question 'convert amount to rupees and paise in words format in c#' here convert amount to rupees and paise in words format in c# But i dont know how to use the code for devexpress report to convert the number to word? Please help me how to do.

if you're using the end-user-designer (not the visual studio), i may suggest to register custom function 'RupeesToWords' for binding expressions.
in this new function implemetation you may write your custom code.
in the XRLabel's summary expression specify the expression like this
RupeesToWords(sumSum(Value))

Assuming you were to display this value in an XRLabel, you could handle the XRLabel's BeforePrint event and set the Label's text to the result of the code you've already found for the conversion process.

Related

ASP.NET: How to validate a number input and format it with thousand separator on fly?

On ASP.Net form, I have a couple input fields which only integer allowed and maximum is 8 digital. right after entering value to the textbox field, it will check the validation. after passing the validation, it will format it with thousand separator. all these happen on fly.
I use Regular Express to do the validation. for example: Regex="^-?\d+{0,8}$".
My question is: I can use this regex to check the input and format it with thousand separator, but when hit save button, it fails on validation(Page.IsValid) because the textbox value will show number with commas(,).
For example: since the field only takes integer,when user enter 20000, it pass regex check at first, but after it format with 20,000 it fails the validation.
So how can I make this work? Thanks.
You can try custom validator
How to: Validate with a Custom Function for ASP.NET Server Controls

Convert multiple gridview date fields into one format

I'm spinning my wheels right now and what I'm pretty sure is an easy answer, I just can't see at the moment. What I'm attempting to do take two sets of converted dates in a database and I want to present them in a grid view as one single date format.
Right now the two date formats are as follows:
YYYYMMDD
mon dd yyyy hh:miAM/PM
I want to convert them all into one format. For giggles, lets just convert them all to 112 (YYYYMMDD).
Now I want to present this all in the same SELECT statement that populates my gridview with other columns of data of various forms lots of text, data entry, long characters, etc.
The thing I haven't been able to wrap my head around is how to put this into a SELECT statement that includes all the rest of the information that populates the gridview.
So a normal SELECT statement (into all nvarchar(max) fields...the table is formed this way because we deal with lots of non standard data importing like Unix) would look like this (this is just a sample database):
SELECT [record_number], [price], [product], [description], [date_of_order], [customer_id] [comments]from sample_database
When presenting the 'date_of_order' field, I figured I need to use a CAST or CONVERT with the proper conversion numbers. However, after looking online I'm scratching my head on how to do this as most of the somewhat relevant information is focused around converting with the GETDATE option instead of leveraging the date that's already written to the database (the information is entered on a different part of the website).
I'm just looking for a pointer or a suggestion in the right direction to use a SELECT statement in my gridview (along with all of the other fields) that can convert any/all of the entries into one common date format. I know I'm missing something simple here but I don't know what.
I should note that I don't want to change them in the Database just when presenting them in the Gridview.
Use the following Convert SQL Function around all of the date fields you require, be warned that this can cause errors if the value is not a correctly formatted date.
CONVERT(datetime, [OldDate], 112)
Found here.
Also look here for more information on the Convert Function

Mathematical expression in Crystal Reports

I have two fields in a Crystal Report. Open and InProgress. Each field is a result of a separate command.
In my report, I have bound {Open} and {InProgress} to a text field. I want to create a third field with an expression like {Open} - {InProgress} that will calculate the difference.
Can I do this with such an expression, if yes how can it be acomplished?
I found a decent solution. If there is a better way, I will gladly accept that as the answer.
What I did was create a Formula Field, then put the expression I had above {Open} - {InProgress} into that field. I can now use the formula field in the report.

Control input of SQLite attribute to date format only.

I have been reading all about converting TEXT fields into date formats and ways to use Python to create date objects but my question remains.
My table has a dateTime column that is specified as TEXT, I would like to build a constraint that forces input to be in dateTime format, but as SQLite doesn't do dates (as I would like) I haven't worked out how to do it.
My current ideas: 1. Limit number of characters
2. Set separate attributes for day, month and year and constrain their domains
3. It is silly to do this on the database side just do it in the user interface
I would appreciate your opinions on these or other options.
Thanks :)
I've been trying to solve the same issue and the method I came up with was to use the date/time functions to parse the value and check that it hasn't changed. Essentially the following:
CREATE TABLE dts_test (
dts TEXT CHECK (dts IS datetime(dts))
);
If the default format is not what you want you can use the strftime or similar to design whatever format you want, but it must be something that the built-in date and time functions can parse.

Problem databinding an ASP.Net AJAX toolkit MaskedEditExtender

I have a database that contains a date and we are using the MaskedEditExtender (MEE) and MaskedEditValidator to make sure the dates are appropriate. However, we want the Admins to be able to go in and change the data (specifically the date) if necessary.
How can I have the MEE field pre-populate with the database value when the data is shown on the page? I've tried to use 'bind' in the 'InitialValue' property but it doesn't populate the textbox.
Thanks.
We found out this morning why our code was mishandling the extender. Since the db was handling the date as a date/time it was returning the date in this format 99/99/9999 99:99:99 but we had the extender mask looking for this format 99/99/9999 99:99
Mask="99/99/9999 99:99:99"
the above code fixed the problem.
thanks to everyone for their help.
Are you referring to the asp.Net Ajax toolkit extensions at:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx
If so have you checked that your data is coming back in the correct format? It will have to match your date format in order to be displayed.

Resources