Focal Point
[CLOSED] STRREP issue in dialog manager

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4627092795

January 20, 2011, 11:28 AM
Enigma006
[CLOSED] STRREP issue in dialog manager
Hai all

Can some one help me with html composer to get this?

my manager wants an adhoc form. i had all controls, list boxes etc. but he needs one control which shows all available fields that report has and user needs to select what fields he want in the report.

i tried using double list control but it outputs the strings with quotes and OR in between.

is there any way to achieve this without much coding and with GUI?

Thank you..

This message has been edited. Last edited by: Kerry,


8.1.05
HTML,PDF,EXL2K, Active, All
January 20, 2011, 11:46 AM
Alan B
The double list control is okay.

In the called focexec STRREP the ' OR ' to ' '. I think the quotes are okay, but could also use STRREP to remove.

Then PRINT &variable

Problem is the sort order...


Alan.
WF 7.705/8.007
January 20, 2011, 11:50 AM
Enigma006
Thanks Alan. I am working on same for now.
Can you provide any sample code to remove OR using those functions?

And I dont think sort order is a problem. User can sort the fields using those arrows in double list control.
so it quotes and OR are remvoed it table request should print the fields in that sort order.


8.1.05
HTML,PDF,EXL2K, Active, All
January 20, 2011, 01:29 PM
ABT
be aware this is a much bigger request than he probably thinks it is...


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
January 20, 2011, 02:14 PM
Enigma006
Can someone help on this please?


8.1.05
HTML,PDF,EXL2K, Active, All
January 20, 2011, 03:31 PM
Enigma006
I almost got it to work but not sure what problem is happening with STRREP in dialog manager
DEFINE FILE CAR
F1/A100 = '&C2';
F2/A100 = STRREP(100,F1,2,'OR',1,' ',100,F2);
END
TABLE FILE CAR
PRINT 
CAR
F1
F2
END


this worked when
&C2 
is MODEL OR CAR OR COUNTRY.
I got F2 as MODEL CAR COUNTRY.

But when I used the same in dialog manager it gives me error.

  
-SET &C3 = STRREP(&C1LENGTH,&C2,2,'OR',1,' ',&C1LENGTH,&C3);


Can someone help plz?

Thanks

This message has been edited. Last edited by: Enigma006,


8.1.05
HTML,PDF,EXL2K, Active, All
January 20, 2011, 04:31 PM
Enigma006
This worked but when I replace last parameter A100 with A&C1LENGTH, it gives me error. any clue?


8.1.05
HTML,PDF,EXL2K, Active, All
January 20, 2011, 04:35 PM
Francis Mariani
STRREP does not like a blank replacement character.

You could try the following:

-SET &C2 = 'MODEL OR CAR OR COUNTRY';

-SET &C3 = STRREP(&C2.LENGTH, &C2, 2, 'OR', 0, 'X', 100, 'A100');

-TYPE &C3

Between each value is ' OR '. Since you're only replacing the 'OR' there will be two blanks between each value, so the replacement string can have a length of zero, with the X as a dummy character that is not used.

Beware of using STRREP to replace 'OR' - this will mess up a value such as 'OREGON'.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 20, 2011, 04:44 PM
Tom Flynn
quote:
This worked but when I replace last parameter A100 with A&C1LENGTH, it gives me error. any clue?

Use 'A|&C1LENGTH'

And, heed Francis's warning...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
January 20, 2011, 05:29 PM
Enigma006
This is still giving error tom. it says &c1length not found
quote:
Originally posted by Tom Flynn:
quote:
This worked but when I replace last parameter A100 with A&C1LENGTH, it gives me error. any clue?

Use 'A|&C1LENGTH'

And, heed Francis's warning...



8.1.05
HTML,PDF,EXL2K, Active, All
January 20, 2011, 05:39 PM
Tom Flynn
You can't put partial code here, we are not mind reader's.

I will "now assume' that the the values coming in are in &C1. If so, the syntax is incorrect, it s/b:

'A|&C1.LENGTH'


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
January 21, 2011, 03:21 AM
GamP
quote:
Beware of using STRREP to replace 'OR' - this will mess up a value such as 'OREGON'

This can be overcome by replacing the OR with the trailing and leading space, as follows:
-SET &C2 = 'MODEL OR CAR OR COUNTRY';
-SET &C3 = STRREP(&C2.LENGTH, &C2, 4, ' OR ', 1, HEXBYT(32,'A1'), &C2.LENGTH, 'A&C2.LENGTH');
-TYPE &C3



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 21, 2011, 11:59 AM
Francis Mariani
Nice trick with the HEXBYT.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server