Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

Hello WF family, I seek your help and wisdom. Im having an ...


Jan Vostr

Recommended Posts

Hello WF family,

I seek your help and wisdom.

Im having an issue with multi values from HTML to FEX. In 8105 it worked like a charm but 8207 it does not.

User can pass multiple values from HTML document for example: they want to search for JAGUAR or JENSEN like this:

 

but it does not work. I have used the old trick that Ive deleted the selected values

and switched control from listbox to the textarea and checke MULTIPLE

 

with variable set like this

 

Code is below

 

TABLE FILE IBISAMP/CAR

PRINT

CAR.ORIGIN.COUNTRY

CAR.COMP.CAR

CAR.CARREC.MODEL

WHERE CAR.COMP.CAR EQ &CAR.(OR(<No Selection,_FOC_NULL>,<CAR,CAR.COMP.CAR>|FORMAT=A16)).CAR:.;

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

 

do you have any idea what could go wrong Seems that it does not pass the multiple values. Any idea, please

Thank you very much

Jan

Link to comment
Share on other sites

I want to clarify some thing.

Youve mentioned a HTML document that should pass selected values but your sample fex has auto-prompt.

And that auto-prompt just displaying two options (it is a static list) :

 

No Selection

CAR

Is that intentional It does not give a list of all car.

 

If you have a HTML page that should pass the parameter, have you bind them back to the fex

Migrating pre-8207 to 8027 HTML pages needs to have the parameters binded (linked) back.

Link to comment
Share on other sites

Hi MartinY,

thanks for you answer.

Thats static list, well it is kinda intentional because if you mount it in the HTML then it looks like this

 

image.png964283 9.45 KB

 

It is a listbox by default from the FEX, right And all I do is delete those values in the input control and change it to the textarea that user can type their own values

otherwise it looks like this

 

image.png1021344 10.7 KB

 

 

I hope it is more understandable.

And what do you mean by

 

Migrating pre-8207 to 8027 HTML pages needs to have the parameters binded (linked) back.

 

 

image.png1035409 8.44 KB

 

This CAR report above is made in 8207 and all (in this case only one param) is binded.

Thank you

Link to comment
Share on other sites

Hi David,

thank you for your reply and here it is.

As you can see It just passes JAGUAR, JENSEN without IN or OR Syntax

TABLE FILE IBISAMP/CAR

PRINT

CAR.ORIGIN.COUNTRY

CAR.COMP.CAR

CAR.CARREC.MODEL

WHERE CAR.COMP.CAR EQ JAGUAR, JENSEN;

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

END

0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0

Link to comment
Share on other sites

Running the below does display a real auto-prompt selection for Cars

TABLE FILE CAR

PRINT

CAR.CARREC.MODEL

BY CAR.ORIGIN.COUNTRY

BY CAR.COMP.CAR

WHERE CAR EQ &CAR.(OR(FIND CAR.COMP.CAR,CAR.COMP.CAR IN CAR|FORMAT=A16)).Car Selection:.;

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

If I create a new HTML page, add a report where a reference the above,

HTML definition

 

If I execute the HTML it result in below where All have been selected

 

image.png400587 7.89 KB

 

Generated code

Link to comment
Share on other sites

Jan,

Passing text value as is will not work with an EQ condition because no CAR value (record) match that text.

Using text area as input parameter often need to validate (and sometime reformat) the values passed.

Why not using a selection list instead Dont change it as a text box

That way you are sure that received values are good and properly formated with quotes and OR between values.

Link to comment
Share on other sites

MartinY,

that is not an option. Users were allowed to type their own values since the table/column contains more than 1000k of records.

And I think that you are using dynamic values from the field since you have FIND in the WHERE condition and that is not the same what I need.

Here you can see how it works in 8105m and It works like a charm like that. You can type anything you want and you will get the results if the value matches and record. I have found this method long time ago since this function was not native in WF

 

image.png1760940 64.8 KB

Link to comment
Share on other sites

The following seems to work.

Pay attention to first six lines and the WHERE clause

-*-* To manage no value provided by user, default to _FOC_NULL

-DEFAULTH &CAR = '_FOC_NULL'

-*-* To manage the case where the user provide only a space (blank) as parameter

-SET &CAR = TRIM_(BOTH, ' ', REPLACE(&CAR, ' ', ''));

-*-* To manage the multi-selection : replace the coma by quotes and a OR

-SET &CAR = IF &CAR.EVAL EQ '' OR '_FOC_NULL' THEN '_FOC_NULL' ELSE REPLACE(&CAR, ',', ''' OR ''');

 

TABLE FILE CAR

PRINT CAR.CARREC.MODEL

BY CAR.ORIGIN.COUNTRY

BY CAR.COMP.CAR

WHERE CAR EQ &CAR;

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

Link to comment
Share on other sites

Thanks MartinY,

I just made almost the same just a simplified version and it works

-SET &NEW_CARD = REPLACE(&CAR,',',''' OR ''');

TABLE FILE IBISAMP/CAR

PRINT

CAR.ORIGIN.COUNTRY

CAR.COMP.CAR

CAR.CARREC.MODEL

WHERE CAR.COMP.CAR EQ &NEW_CARD.(OR(<No Selection,_FOC_NULL>,<CAR,CAR.COMP.CAR>|FORMAT=A16)).CAR:.;

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...