How to limit the characters in input field in crystal report - crystal-reports-2008

I am using crystal report 2008, i have a report and that has a input field called "Departure_no".
In this input field we can type maximum of four departure_no (Eg: 2345,234,2345,23456), if it exceeds this limit(more than 4 numbers-can count with 3 commas(,)), this input field should not allow to type further.
Is there any way to achieve this by formula or something else by crystal report??
Thanks in advance!!
Priya

try below
use alerts to show the message: I am showing on a database field
Go to Report--> Alert --> Create or modify alert
When a window is opened provide the following:
required name
Required message
Condtion when alert need to be displayed
You can give condition as
if Length(databasefield)> 4 //you need only 4 chars hence this condition
then true
else false
Click ok.
Now you will get message
Let me know of you are looking for something different

Related

Google Sheets getting Invalid error in drop down but item is on the list

In Google Sheets, I created a data validation cell to select different time slots. I am getting an error when choosing 6:00, 7:00, 8:00, 9:00 even tho all of them are in the list. Error says: "Invalid: Input must be an item on the specified list"
Added the data validation like this:
Thanks a lot in advance!
The file is here: https://docs.google.com/spreadsheets/d/1NSBx87sWScwe2Vtp9FOcH3BupvPJ_jzISUeAk6gSBOM/edit#gid=612415402
Make sure to actually pick a choice on the dropdown OR your input is exactly the same with the choice.
By default, when you manually enter 6:00-9:00 it automatically adds 0 in the beginning as sheets has detected your input as time.
So you should update your data validation list to use 06:00-09:00 instead so it matches when sheets adjusts your input when they are manually entered.

VS Reporting Services - [rsInvalidFormatString] The Format value for the textrun is not valid

I wrote code in SQL Server that gives the year, the month and some data for those months in separate columns. The column for month (MM) gives months in numeric digits (1 to 12).
The code I used was:
Select ....
,Month(IRDate) AS MM
,...
I created a report in MS VS Report builder and included all the data in table columns. The report runs fine. However, at the bottom I get the below warning message:
[rsInvalidFormatString] The Format value for the textrun
‘MM.Paragraphs[0].TextRuns[0]’ is not valid. Format specifier was
invalid.
I checked the formatting for that cell, it is set to default - No formatting.
In the report, I've set the parameter to have a default value as
=DateValue("September 01, 2016")
Would that be the issue? Maybe the default value is not the right format? I removed the default value and kept it as no specified value. Warning message still comes up.
How can I fix this?
Have you tried formatting the textbox properties that holds the MM value to be a number datatype with no decimal places?
Regarding your other question about the default parameter value, I have typically seen DateValue formatted as such: 9/1/2016
Also, is your parameter datatype set to Date/Time?
Apparently, the error message '[rsInvalidFormatString] The Format value for the textrun....' is a log message. Rectifying the problem does not take away the message because it is a log message. So even after you correct the issue, the message will still show.
The only way to remove that message is to simply restart Visual Studio. When Visual Studio starts back up, the log is cleared and you won't see the message any more.
"Who knew healthcare would be so complicated?" ;)

WebEdit and List Combo field Automation using UFT

Hi I am trying to Automate the input field for searching the equity on the website "https://www.nseindia.com/" using UFT. I am able to set value in the WebEdit field but I am not able to submit using UFT
Below is the descriptive code :
Set Obrowser = Browser("name:=NSE - National Stock Exchange of India Ltd\.")
Set oPage = Obrowser.Page("title:=NSE - National Stock Exchange of India Ltd\.")
oPage.WebList("html id:=QuoteSearch").Select "Equity"
oPage.WebEdit("name:=companyED","index:=0").Set "SBIN"
oPage.WebEdit("name:=companyED","index:=0").Submit
enter code here
Image of the field which is highlighted
Could you please help me in handling this type of input box which is shown in screenshot
I see that when you set a value in the search field we get a list of matching results. If you click on the appropriate result the search is performed.
Instead of submit try the following:
oPage.WebElement("html id:=ajax_response").Link("text:=.*SBIN.*").Click
This assumes there is only one match (you can fine-tune it if there are more).
Explanation:
We first look for the list of results that fit the search term (this is in a SPAN with id=ajax_response). Then, under that, we look for the Link that we want to click on. In this case there's only one match so the description doesn't really matter.

Report parameter validation message with Birt

I'm creating a BIRT report using certain parameters. I have an int parameter (Number of months) which values can be from 1 to 12.
I need to check if the value is bigger than 12. In such case it should show me a customized message and not an error like it is doing right now.
Error:
org.eclipse.birt.report.service.api.ReportServiceException: The validation for parameter "nummonths" fails.
Current script:
if (params["nummonths"].value > 12 )
{
false;
}
else
{
true;
}
I create reports in BIRT to upload it to IBM Maximo Asset Management system. Maybe there is a different way to solve this in Maximo.
Thanks for your time! Hopefully will help others.
You could create a dynamic text styled as a warning, and hide it (property "visibility") with an expression such
params["nummonths"].value <= 12
There is an example of a such approach here, if we select more than 10 countries or more than 10 indicators, a warning label is displayed at the top of the report.
An interesting point is, although a warning is displayed we can additionally create a rule to replace the wrong parameter value in a script such onCreate. This way the report can correctly run. For example in your case, we could do in a script:
if (params["nummonths"].value > 12){
params["nummonths"].value=12;
}
Alternatively, you could also drop some report elements in "beforeFactory" when the parameter is wrong.

Character length in single line edit filter PowerBuilder

My SQL code gives me over 10 000 rows, each containing client id, name, address and so forth. In my PowerBuilder 10.5 window I've set my DataWindow in which I'm retrieving my SQL code using id as retrieve argument. I have a Single line Edit (sle_id) in which the user can write an id and search by it. What I've figured out is that all of my clients have id's length of 8 characters and starting with either "46XXXXXXXX" or "7052XXXX". So to optimize my retrieve time I want to write a code in the clicked event of my "Start" button that is located in PowerBuilder window that would first check if the id starts with one of does two options: "46..." or "7052...". I assume I'd need to use length of the characters? For example, this is what I'd want...
IF sle_id.text STARTS with 46 or 7052 THEN retrieve
ELSE MessageBox ("INFO", "Your id must have begin with either 32 or 7052")
END IF;
Of course, I need something better then "Starts with". Much oblige for all the help!
there are some string functions in powerbuilder. I think you need this:
If( left(sle_id.text, 2) = "46" or left(sle_id.text, 4) = "7052" ) then
Best Regards
Gábor
I think you're trying to solve the wrong problem. Your database should have an index on client id. If the client id is unique use a unique index.

Resources