Formatting graphic fields...
Post Author: DeafLeopard
CA Forum: Crystal Reports
I have a report in which I need to format a graphic field to display on one page. These fields contain visual proofs of ads that are sent to the customers along with their bills.
I can keep the field all on one page by leaving the "can grow" option as false, but large ads are squeezed to the point of being illegible while small ads are stretched to the point of being just as unreadable. Setting "can grow" to true looked great to me, but now they want to keep the ads on one page by making the ad stretch across, say, up to 3 or 4 columns. Is there any way to use the "can grow" option to spread the field across multiple columns on the same page? Any help is much appreciated.
Nevermind, I got it:
javax.swing.text.MaskFormatter fmt = null;
// A phone number
try {
fmt = new javax.swing.text.MaskFormatter("###-###-####");
} catch (java.text.ParseException e) {
ftfPhone = new JFormattedTextField(fmt);
Similar Messages
-
Format for fields in an internal table
DATA: BEGIN OF ITAB OCCURS 0,
AUFNR LIKE AFKO-AUFNR, " Purchase Order Number
PLNBEZ LIKE AFKO-PLNBEZ, " Part Number
BISMT like MARA-BISMT, " Old Material
LNO(2),
GAMNG LIKE AFKO-GAMNG, " Production Order Quantity
GLTRP LIKE AFKO-GLTRP,
VDATU LIKE VBAK-VDATU,
KWMENG LIKE VBAP-KWMENG,
MBDAT LIKE VBEP-MBDAT,
GBSTA LIKE VBUK-GBSTK,
PCTBS(5),
*CSHOT
"CDESC
END OF ITAB.
LOOP AT ITAB.
WRITE:/3 ITAB-AUFNR,
13 ITAB-PLNBEZ,
23 ITAB-BISMT,
LNO(2),
45 ITAB-GAMNG,
65 ITAB-GLTRP.
57 ITAB-VDATU.
*63 ITAB-KWMENG,
69 ITAB-MBDAT.
PCTBS(5),
*C
ENDLOOP.
I have a internal table and I have writing the itab in the write statement. I need to format the field in itab.
for eg:
itab-gamng(lenght as 5)
itab-gltrp(its a date) i just need the mm/yy how can I format it.You don' need to reformat the itab, just the fields before you write them.
<b>data: monthyear(5) type c.
data: qty(5) type c.</b>
LOOP AT ITAB.
<b>concatenate itab-gltrp+4(2) '/'
itab-gltrp+0(4)
into monthyear.
clear qty.
qty = qty + itab-gamng.</b>
WRITE:/3 ITAB-AUFNR,
13 ITAB-PLNBEZ,
23 ITAB-BISMT,
* LNO(2),
<b>*45 ITAB-GAMNG,
45 qty,
* 65 ITAB-GLTRP.
65 monthyear.</b>
* 57 ITAB-VDATU.
* *63 ITAB-KWMENG,
* 69 ITAB-MBDAT.
* PCTBS(5),
*C
ENDLOOP.
Regards,
Rich Heilman -
How can I format a field in the form creator?
How can I format a field in the form creator? It's putting the same text in all the fields within a table. I want each field within the table to have different text. As soon as you click out of the table, all the text is the same.
I even changed the fields from a text box to a drop-down list so a person can make their selection, which will be a quantity from 0-9. There are two of these such fields. You make your selection in each, click off the table and both fields show whatever I selected in field 1. The original Qty I selected in the bottom field was a 5 but it changed it to whatever is in the top field on it's own. I've added a screen shot.This behaviors usually happens when you create the fields but a copy paste command from one of the fields. The copy paste command assumes that your intentions is to maintain a copy of the field in two separate locations (e.i, a form field "company name" printed in each and every page of a multi-page form document.
Go to the properties fields of each field and make sure to assign unique form field names. -
How to create Using Formatted Text Field with multiple Sliders?
Hi i found the Java Sun tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html very useful, and it tells how to create one Formatted Text Field with a Slider - however i need to create Formatted Text Field for multiple Sliders in one GUI, how do i do this?
my code now is as follows, and the way it is now is scroll first slider is okay but scrolling second slider also changes value of text field of first slider! homework due tomorrow, please kindly help!
// constructor
label1 = new JLabel( "Individuals" );
scroller1 = new JSlider( SwingConstants.HORIZONTAL, 0, 100, 10 );
scroller1.setMajorTickSpacing( 10 );
scroller1.setMinorTickSpacing( 1 );
scroller1.setPaintTicks( true );
scroller1.setPaintLabels( true );
scroller1.addChangeListener(this);
java.text.NumberFormat numberFormat = java.text.NumberFormat.getIntegerInstance();
NumberFormatter formatter = new NumberFormatter(numberFormat);
formatter.setMinimum(new Integer(0));
formatter.setMaximum(new Integer(100));
textField1 = new JFormattedTextField(formatter);
textField1.setValue(new Integer(10)); //FPS_INIT
textField1.setColumns(1); //get some space
textField1.addPropertyChangeListener(this);
//React when the user presses Enter.
textField1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
textField1.getActionMap().put("check", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
if (!textField1.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField1.selectAll();
} else try { //The text is valid,
textField1.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
label2 = new JLabel( "Precision" );
scroller2 = new JSlider( SwingConstants.HORIZONTAL, 0, 100, 8 );
scroller2.setMajorTickSpacing( 10 );
scroller2.setMinorTickSpacing( 1 );
scroller2.setPaintTicks( true );
scroller2.setPaintLabels( true );
scroller2.addChangeListener(this);
textField2 = new JFormattedTextField(formatter);
textField2.setValue(new Integer(10)); //FPS_INIT
textField2.setColumns(1); //get some space
textField2.addPropertyChangeListener(this);
//React when the user presses Enter.
textField2.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
textField2.getActionMap().put("check", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
if (!textField2.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField2.selectAll();
} else try { //The text is valid,
textField2.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
// State Changed
public void stateChanged(ChangeEvent e) {
JSlider source = (JSlider)e.getSource();
int fps = (int)source.getValue();
if (!source.getValueIsAdjusting()) { //done adjusting
if(source==scroller1) {
System.out.println("source ==scoller1\n");
textField1.setValue(new Integer(fps)); //update ftf value
else if(source==scroller2) {
System.out.println("source ==scoller2\n");
textField2.setValue(new Integer(fps)); //update ftf value
} else { //value is adjusting; just set the text
if(source==scroller1) textField1.setText(String.valueOf(fps));
else if(source==scroller2) textField2.setText(String.valueOf(fps));
// Property Change
public void propertyChange(PropertyChangeEvent e) {
if ("value".equals(e.getPropertyName())) {
Number value = (Number)e.getNewValue();
if (scroller1 != null && value != null) {
scroller1.setValue(value.intValue());
else if (scroller2 != null && value != null) {
scroller2.setValue(value.intValue());
// ACTION PERFORMED
public void actionPerformed(ActionEvent event) {
if (!textField1.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField1.selectAll();
} else try { //The text is valid,
textField1.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
if (!textField2.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField2.selectAll();
} else try { //The text is valid,
textField2.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
...if :p3_note_id is null
then
insert into notes (project_id, note, notes_month, notes_year) So, p3_note_id is NULL.
Another option is that you have a trigger on table NOTES that generates a new note_id even for an update. -
Formatted Text field for File Extensions
Hi guys,
Is it possible to create formatted text field for file extension like it should accept *.bmp, .bmp, bmp. etc..... It is not necssary to be a Combo Box. TextField will work.
Thanks in advance.
AZGHARAny one here \Help\Help\Help ;-(
-
Formatted Text Field for getting Date
I need a text field to get Date. does anyone know where I can find such a thing?
all it needs to do is allow the user to type a date in dd/MM/yy format.
10x.in a jtable it has a problem - when I press tab to exit the field the date is not changed.
i set the on focus lost behaviour to commit, but still not working.
also, it allows me to enter 4823749823/02/02 - and it translates it to the right format - I'm interested in something more fixed - allows to enter only 2 digits for day, 2 digits for month,2 digits for year.
the relevent code I'm using is:
// a cellEditor that uses a formatted text field that holds a Date object
public class JFormattedDateCellEditor extends DefaultCellEditor {
public JFormattedDateCellEditor(final JFormattedTextField textField) {
super(textField);
textField.setFocusLostBehavior(JFormattedTextField.COMMIT);
textField.setHorizontalAlignment(SwingConstants.RIGHT);
textField.setFont(JUtility.theFont);
textField.setBorder(null);
textField.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
if (textField.getValue() == null) {
textField.requestFocus();
delegate = new EditorDelegate() {
public void setValue(Object value) {
textField.setValue((java.util.Date)value);
public Object getCellEditorValue() {
return textField.getValue();
//to set the cell editor:
column = collectionsTable.getColumnModel().getColumn(CollectionFrame_collectionsModel.DATE_COLUMN);
column.setCellEditor(
new JFormattedDateCellEditor(
new JFormattedTextField(
new DateFormatter(
new SimpleDateFormat("dd/MM/yy"))))); -
Hi All,
Is there any way that one can format a field as currency.
ie Aligned to the right with decimals - eg 1.00 NOT 1
Thanks
AlanHi,
Thanks for answer.
I can't even find those options.
I'm editing a form. Take options Edit | Edit Fields | Show Field Properties | that brings up a tabbed window with following tabs: General Appearance Position Options Actions.
Where do I find the options you mentioned?
Regards
Alan -
Unable to format print field on Smart Form
Hello,
I have a problem trying to format a print field so that it displays correctly.
The field in question is a display of a percentage (KOMVD-KBETR).
I currently have the following in a Program node:
IF NOT <KO>-KBETR IS INITIAL.
WRITE <KO>-KBETR CURRENCY <KO>-KOEI1 TO GV_KBETR .
ELSE.
CLEAR GV_KBETR.
ENDIF.
GV_KBETR has to be a character field for the WRITE to work. However if I use GV_KBETR in my TEXT node it appears some of the formatting options don't work on character fields. The one in question is (<)
I created a variable GV_KBETR_DISP type KBETR and added GV_KBETR_DISP = GV_KBETR to the program node above. Thisformats fine on the smartform. However using this setup I occasionally get an error when executing the smartform which I diagnosed that the GV_KBETR_DISP = GV_KBETR statement doesn't handle the data correctly if the data has a space in it.
Has anybody got any suggestions I could use to get round this problem?
Regards
Mike.Hi,
Why can't you use the field - KOMVD-KBETR to display ?
IF you want to map the currency to this currency format, then you can simply add it in the Gloabal defnition -> Currency / Qty fields tab.
If you do not want to display the initial value, then you can use the text formatting option
&symbol(I)& Suppress output of the initial value
Regards,
Selva K. -
Error Message - Value Entered Does Not Match Format of Field
I keep getting an error message in Adobe Pro X: "The value entered does not match the format of the field [JF13]".
I have JF13 programmed as follows:
On Calculate tab:
if(Number(this.getField("ck4").value) > 0) this.getField("JF13").value = Number(this.getField("FL019").value); else this.getField("JF13").value = " ";
It is programmed this way so if the user checks the check box before the field, only then will JF13 populate a value, which pulls from FL019. I also have the settings set to "number" because the data needs to display as a dollar amount $xxx.xx.
FL019 is a hidden field on the form which pulls a dollar amount from a Mainframe, and its settings are also set to "Number" :
I get four pop up windows with the above mentioned error message, and the only way to make the message stop is to remove the "number" format from the fields. However, when this is done, if any number which ends in a zero is entered, it cuts off the zero. This is not acceptable either.
Is there some sort of script I could add or some other way to prevent both the error message and the cutting off of the zero on JF13?
I am not very proficient with javascript, so any assistance would be appreciated!Thank you so much for your response!!
Forgive me for my lack of knowledge - but where exactly would I add that in the script?
I tried it like this:
if(Number(this.getField("ck4").value) > 0) this.getField("JF13").value = Number(this.getField("FL019").value); else this.getField("JF13").value = ""(empty string);
And I got an error saying I was missing a parenthesis. Should it go somewhere else or am I completely off? -
How can I format a field to have a Check Box in the center.
I am a new adobe user and I am creating a form in Adobe LiveCycle Designer. Most of what I needed to do I was able to figure out, but I cannot find a way to place a Check Box in the center of a chosen field. Each time I use the Check Box from the library it automatically places the Box in the center-right of the field. Then when trying to format the paragraph, I get no options about where I'd like the box to reside within the field. Is there a simple way to get a Check Box into the center of a Field or will I have to pursue other options. If I do have to pursue other options are there any ways to limit a text to an X and have it either be On or Off?
Thanks for your aid.This behaviors usually happens when you create the fields but a copy paste command from one of the fields. The copy paste command assumes that your intentions is to maintain a copy of the field in two separate locations (e.i, a form field "company name" printed in each and every page of a multi-page form document.
Go to the properties fields of each field and make sure to assign unique form field names. -
Formatting a field in the repetitive area of the Print Layout Design
Our quantity fields in the repetitive area print out with a decimal point and 3 spaces after the decimal point (i.e. 10.000). How can I change the format of these fields so that there are no decimals included (i.e. 10) when we print an order?
Thanks.
Edited by: Philip Eller on Jun 19, 2008 9:56 AM
Edited by: Philip Eller on Jul 3, 2008 3:11 PM*Mike,
You could use the Formula ABS( )
Add a Formula type field
In the Formula select formala ABS()
syntax: ABS(Field_xyz)..here field Field_xyz is your number field
If your value was 10.000 the result will be 10. This formula ignores the decimal part.
The formula ROUND could be used if you want to ROUND the value to the nearest higher or lower integer
Consider number 10.450
ROUND(Field_xyz,2) will give 10
ROUND(Field_xyz,1) will give 11
Suda -
Arrows in a text field / Common scroll for a jlist and a graphic field
I am developing a software which requires me to dynamically add arrows from one list entry to another(depending on the users respone) in a jlist.
Is there any method to do that directly or by means of two parralel fields(one for the list and other for the arrows) controlled by a single scroll????
Cheers!!!I don't understand the question, but read the Swing tutorial on "How to Use Lists" which shows the proper way to add and remove items from a JList:
http://java.sun.com/docs/books/tutorial/uiswing/components/list.html
If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
http://homepage1.nifty.com/algafield/sscce.html
Don't forget to use the "Code Formatting Tags", so the posted code retains its original formatting.
http://forum.java.sun.com/help.jspa?sec=formatting -
Number formatted Amount field not working in Excel 2010
Hi,
We have BI reports in EBS 11.5.10.2 designed using word 2007 RTF templates. The output is selected to write to Excel so that they can calculate on amount fields. Recently we upgraded to Office 2010 and the amount filed which has number format when downloaded to Excel will not allow to use functions like Sum. If i deleted the table column and add the column back, then it works. Is anyone runing into similar issues....Interesting to note this is still a problem, but even more interesting is as to why Excel works fine the first time you bring in the xsd, but not after you save it. I found information that says it's related to resolving externally referenced xsds,
which is fine, but again, why does it work the first ime and not the second? If it were a problem with external xsds then it should never work at all so I think that answer is bogus.
Something has to be getting corrupted on the save and it's not important enough to MS to spend the time to fix it. -
Format Tab - Field Properties (Special)
The format tab for field properties - Special - gives a phone number option which allows 10 numeric characters or spaces. UK Telephone number format is 11 numeric characters. Would be useful to have a pre defined UK phone format. If you try and create one using the 'arbitary mask' option - that does not permit a mix of numeric values or spaces - it only allows numeric values.
If one looks at the code Acrobat uses for formatting one would see that the JavaScript uses RegExp object to construct the needed pattern to test keystrokes, validation, and formatting. So it is possible for one to either field level or document level functions for other types of data to collect.
Beginning JavaScript for Adobe Acrobat has 3 chapters dealing with this subject. -
hi ! gurus this is my problem
i have a field in this format : 20021201 (date)
but a need in this format 01/dec/2002
and...
another field in this format 2314224 ( hour)
but ai need in this format 23:42:24
(sometimes the format is 45621)
but in fact it is 04:56:21
how justify blanks to left?
how i can get difference between two hours in this format ?
i work in servlets pages with as/400
thanks
thanks, by everything
samLook into the java.text.DateFormat and SimpleDateFormat classes.
Maybe you are looking for
-
Is it possible ro clean install Mountain Lion over Mavericks on a brand new mac mini
Is it possible to "clean Install" mountain lion over mavericks on a brand new mac mini
-
ATV no longer connects any mobile devices.
I can't connect to my ATV with my iphones or ipad. Home sharing is on on all my devices wifi is connected. I can get netflix with it I can connect with my macbook. But I can't use the remote app or connect with the ipod or pictures or movies. they we
-
Table Control Dropdown List Problem
Hi, I have this problem with my table control. I now have an input field (with input help) called: Reference Table, as well as a table control. What i need is to select the table names (select from the Reference table input help) and the field names
-
How can I open (and edit) multiple jpegs in camera raw?
I am able to open only one at a time. I tried holding the shift and command keys down to select multiple images and I cannot seem to do it. thank you
-
M2v & ac3 files to big for DVD Studio Pro
Hi everyone, Need help with large files. 1. Have full length 90 minute soccer game of my son filmed with HDV Camera. 2. Imported into final cut pro 6. 3. Edited and exported high res mov file which is came out at 20.45GB. 4. Open in compressor and us