How to find the field value for the check box?
<</Rect[263.571 330.311 273.323 338.812]/Subtype/Widget/F 4/P 30 0 R/T(AmountCollect)/DA(/ZaDb 18 Tf 0 g)/FT/Btn/Type/Annot/MK<</CA(8)>>/AP<</D<</COLLECT 148 0 R/Off 149 0 R>>/N<</COLLECT 147 0 R>>>>/AS/Off>>
I tried the following. But I am unable to mark the check box. Please help.
testForm.SetField("AmountCollect", "Off");
testForm.SetField("AmountCollect", "Yes");
testForm.SetField("AmountCollect", "0");
If the string values you're using aren't working, the check box probably uses different names for the appearance state. You can find the possible values of the appearance state using the GetAppearanceStates (see the Buttons example), or you can use iText RUPS to inspect the PDF and search for the names of the appearance states using a GUI.
PS: you can find the C# version of the examples of chapter 8 here.
testForm.SetField("AmountCollect", "COLLECT"); worked for me.
Reference post :
Get the export value of a checkbox using iTextSharp
Related
recently I stumbled upon one of the videos of Benjamin Schumann titled: What are dynamic and action parameters and when should you use them in your AnyLogic model.
I tried to further adjust the functions of dynamic and action based parameters for a problem of mine. Just to give a heads up, I am fairly new to Anylogic (only worked through that one book, and some minor projects and tutorials) and been decent in Java (been a few years since I've been actively working in Java but currentlystarting to get back in [still rusty]).
Regarding my actual problem, in the video Mr. Schumann has an agent with three parameters. One static, one dynamic and one action. In addition to that he has a variable (double) all set in his agent. On his main is a button to increment the value of the variable with the help of the parameters and to trace the lines in the console (= giving out a string if a certain threshold of the variable is passed).
I created a similar setting, however I happen to run into a lot of variable errors during time to time while compiling.
Here some example code snippets:
dynamic parameter p_Station of the type String
v_myFahrt < 222 ? "Wiesbaden Hbf" :
v_myFahrt < 442 ? "Wiesbaden-Biebrich Bahnhof Wiesbaden Ost" :
v_myFahrt < 663 ? "Wiesbaden-Mainz-Kastel Bahnhof" :
"Hochheim (Main) Bahnhof"
therefore my variable is called v_myFahrt, a double with the initial value of 0
action parameter p_durchFahrt with the default action:
v_myFahrt = v_myFahrt + 220;
and my Button on the main:
myAgent.p_durchFahrt();
traceln(myAgent.p_Station());
So basically it is a somewhat similar code as in the reference. I tried to than add another instance of the agent with a different set of "code" for the dynamic parameter (different Strings and values) as well as a different "code" for the action parameter (e.g. + 208 instead of + 220). To then wanting to trace the lines in the console with the button again.
I tried to add
myAgent1.p_durchFahrt(); traceln(myAgent1.p_Station());
to it.
But before I coul even run it, I keep getting the error "v_myFahrt cannot be resolved to a variable" for myAgent1. Inspecting the error it keeps referring to myAgent1 with the newly added code for p_Station and I can't seem to find a way around it.
What am I doing majorly wrong here?
it looks like you have created v_myFahrt in main, right? (that would explain your symptoms).
If yes, you should create it in MyAgent instead.
5250 emulator:
Hello everyone, I want an operator which will count that input fields as it is shown on attached picture. In this case i have 5 input field.
Thanks in advance and best regards
It can be done!
Download this source: http://www.code400.com/ffd.php
You can comment out the GETKEY section from FFDRPG as you won't need that and it will probably cause it to fall over anyway.
Also, rememember when you use the command, to put the record format name in as well as your display file name - don't just leave *FIRST in there or you'll just get the fields from the first record format in the display file.
EDIT:
You'll need to add an extra field to the ListDs data structure:
D ListDs DS
D SfFld 1 10
D SfType 11 11
D SfUse 12 12
D BufferOut 13 16B 0
D FieldLen 21 24B 0
D Digits 25 28B 0
D Decimals 29 32B 0
D FieldDesc 33 82
If you add the 3rd field SfUse, you can check whether it contains 'I' so you only count Input Capable fields.
Check out the QUSLFLD API https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/apis/quslfld.htm if you want to see exactly what information can be retrieved by this API.
The example in the download uses the most basic format FLDL0100 but more information can be retrieved if you ask for format FLDL0200 or FLDL0300 but they will take longer to execute and you shouldn't need the extra info to achieve what you're after.
I'm not sure if this is possible, but you might find some joy with the DSM APIs.
QsnQry5250 has a maximum number of input fields return parameter, but it may just show you the maximum allowed on the display rather than the number you have on your screen.
There's an example here https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/apis/dsm1g.htm
And the API documentation here https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/apis/QsnQry5250.htm
Sorry I can't be of more help - I've never used those APIs and can't think of another way to achieve what you're after.
If you tell us the reason you need to know the number of input fields on screen, we may be able to suggest another way to achieve what you want to achieve.
Damian
On running webdriver code control finds the dropdown clicks on it but selection of a value does not occur. I tried with "select by index" and "select by value" methods but no use. I think it sof type bootstrap dropdown.most posts direct to usage of aforesaid functions but im unable to use it . any help will be greatly appreciated.
50
100
200
300
400
500
We really need more information, including what programming language you are using, what code you are executing, and the HTML you are executing against. Looking at your comment in your original question, and without knowing any of the aforementioned, all I can suggest is selecting the times with XPATH. In Python it would be something like:
driver.find_element_by_xpath("//select[#ng-model='recordnumber']/option[#value='300']").click() # this would select the "300" item
Thanks for your effort but i found the solution . just we need to click on the dropdown and call sendKeys("value to be entered into the dropdown").
Eg: drp=findElement(By.xpath("dropdown element locator").click();
drp.sendKeys("value to shown in dropdown");
in Lucene.Net,i am creating the document for searching a word and want to display before 10 words and after 10 words.i have used TermVector.
Lucene.Net.Documents.Field fldContent =
new Lucene.Net.Documents.Field("content", content,
Lucene.Net.Documents.Field.Store.YES,
Lucene.Net.Documents.Field.Index.TOKENIZED,
Lucene.Net.Documents.Field.TermVector.WITH_POSITIONS_OFFSETS);
Can anyone help me how to find out the keyword position and extract nearest 15 words.
please send some code.
Thanks
Ashish
Ashish,
Check out the following link.
http://www.lucidimagination.com/blog/2009/07/18/the-spanquery/
Hitesh.
You should be looking at Lucene highlighter, it extracts a snippet of text surrounding the query term. This link gives an example.
I have added the footer Page x of y to my report, but the PAGE_COUNT doesn't seem to work.
Maybe the problem occurs because I have many subreports?
I get:
Page 1 of 1
Page 2 of 0
Page 3 of 0
Page 4 of 0
Any ideas?
Well, don't know elder versions but in JasperReports 4.5.1; you can define two text fields both includes $V{PAGE_NUMBER} variables. The one which has EvaluationTime: now shows current page number; the other one with EvaluationTime: report shows the number of total pages. A simple trick but works :)
Changing the evaluationTime="Report" solved the problem.
Summary: To have the page number and the page number in a TextField.
Step 1: Create a variable that indicates the number of the current page.
Settings:
* Name: CURRENT_PAGE_NUMBER
Variable class: Java.lang.Integer
Calculation: nothing
Reset Type: None
Increment type: Page
Variable Expression: $ V {CURRENT_PAGE_NUMBER} == null? $ V {PAGE_NUMBER}: $ V {PAGE_NUMBER} +1
Step 2: TextField Settings
Text Field Expression: "PAGE:" + $ V {CURRENT_PAGE_NUMBER} + "/" + $ V {PAGE_NUMBER}
Expression class: Java.lang.String
Evaluation Time: Auto
And that's all. No need to add anything to it to give you a result like: Page 1/3 | Page 2/3 | Page 3/3.
I found the solution.
http://jasperforge.org/tracker/index.php?func=detail&aid=2873&group_id=102&atid=612
But the book JasperReports for Java Developers (p 146) says that PAGE_COUNT is the total number of pages in the report. I guess the bug is in the book.
Actually It Is a BUG! And confirmed by developers.
See link:
jasper community bug tracker link
PAGE_COUNT is not correctly calculated, when using property on BAND: "Split Prevent"
our reports look like :
http://pastebin.com/m401fa41
1st part, interpreted during page generation, gives the # of the current page (evaluationTime="Now")
2nd part, interpreted at the end of the report , gives the total # of pages (evaluationTime="Report")
HTH
The solution is the follow :
We must not put $ { V PAGE_NUMBER }+ "/" + $ { V } PAGE_NUMBER in the same field.
the proper way is to put $ { V PAGE_NUMBER } in separated field and "/ " + $ { V } PAGE_NUMBER in the other field
it work for me
sorry for my english
I haven't access to the jaspercommunity (to check the link shared), but I do a good workaround :D
Use 4 texts, like this:
txtStatic1(Page) txtField1($V{PAGE_NUMBER}) txtStatic2(of) txtField2($V{PAGE_NUMBER})
Where:
txtField1($V{PAGE_NUMBER}) -> AVAILABLE TIME = PAGE
txtField2($V{PAGE_NUMBER}) -> AVAILABLE TIME = REPORT
It's works to me.