Focal Point
Creating a file to be used in my reporting application drop-downs

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

September 10, 2004, 08:44 PM
webfocuspgm
Creating a file to be used in my reporting application drop-downs
Working in Dev Studio/MRE 5.2.5

I want to create dynamic drop-downs but my tables are so large that it takes forever to populate them at the time a user runs the report. So I was thinking I could create several focexecs that I could schedule in ReportCaster to create files with my drop-down information. Maybe not the best way to do it, I'd love to hear other ways.

Anyway, I have the following code that creates a saved file

FILEDEF CARHLD01 DISK D:\ibi-dev\ibi\apps_srv\baseapp\carhld01.ftm
TABLE FILE CAR
PRINT MODEL
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE AS CARHLD01
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
ENDSTYLE
END

This seems to work fine.... I can see the file in my directory structure.

0 NUMBER OF RECORDS IN TABLE= 18 LINES= 18 ALPHANUMERIC RECORD NAMED CARHLD01


I then created a master file ... I did change the suffix to FIX.

FILE=CARHLD01, SUFFIX=FIX
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
FIELD=MODEL, ALIAS=MODEL, FORMAT=A20, TITLE='Model', DESCRIPTION='Model', $

Tried to run the following :
TABLE FILE CARHLD01
PRINT *
END

Get the following:
0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0


I'd appreciate any help telling me where I went wrong in all of this.......
or even if you have better ideas on how to get your drop-downs populated when you have VERY large files......

Thanks
September 13, 2004, 02:58 PM
TexasStingray
Try changing your filedef to

FILEDEF CARHLD01 DISK D:\ibi-dev\ibi\apps_srv\baseapp\carhld01.ftm (RECFM F LRECL 20

Be Sure that you have the filedef in the focexec that uses the print * also.

Good Luck
September 13, 2004, 03:44 PM
webfocuspgm
Thanks for the feedback That worked with the FILEDEF in the Print program.....

Is this really the only way to do this...? If the path ever changes we'd have to change all the focexecs that accessed the SAVE file. Is there another way that does not require the path to be "qualified" ?
September 13, 2004, 08:06 PM
webfocuspgm
After trying TexasStingray's advice..... it worked but the SAVE file was not available to all applications. The Filedef information needs to also be in the EDASPROF file. After I put the same FILEDEF syntax info here (per IBI) I was able to run the "sample data" option from the server.
September 14, 2004, 04:26 PM
susannah
a totally different perspective...
i agree with you and i create all my dropdown lists by ReportCaster procedures, as you suggest.
I create them as text files, filedef them to my server directory (i'm in a selfserv environment, so its to my inetpub/wwwroot directory)
AND..
when i make them, i create each line with the full html option text...example:
DEFINE FILE CAR
MYMODEL/A100=
'<OPTION VALUE="' | MODEL || '">' | MODEL | '</OPTION>' ;
END
FILEDEF LISTMODL DISK D:\INETPUB\WWWROOT\LISTMODL.TXT
TABLE FILE CAR
PRINT MYMODEL
ON TABLE SAVE (or HOLD) AS LISTMODL FORMAT ALPHA
END
..then in my launch page, i usually have the first option value specified as 'ALL' and it is SELECTED, then i call my listmodl file with a server-side include
<!-- #INCLUDE FILE "listmodl.txt" -->
so that means my launch pages are saved as .asp, not .htm.
The edasprof isn't involved at all. On creation, you don't need it. you can park a file anywhere you can map to. On execution, its billgates doing the work, and just my site needs to be able to find it.
I know you're in MRE, but maybe there's an idea here you can use.
(Webfocus really needs to be able to handle .asp pages, not just .htm )
September 14, 2004, 05:25 PM
Lloyd
Hey Sussanah, we have a similar setup but we don't use ASP. We use an imtermediate FEX that is called when our frameset loads. It Maps the hold files using filedefs. BTW this FEX also uses HTMfile to redirect our select frame to a predefined frame for our report, this has the added benefit of allowing us to re-use our selection criteria frames.
November 04, 2004, 01:30 PM
webfocuspgm
Ok I'm back - I have the file being created and I can do a TABLE FILE PRINT * from it. The data is there.

I am now trying to use this file in Dev Studio/Resource Layout as a DYNAMIC data source for my drop down box. This file is only being used for the drop-down. The report is using a different file. When I execute the program my drop down box remains empty. I thought all I needed to do inside Resource Layout, was identify it as a drop down box, designate Dynamic on the control values, and designate my source and field. What else needs set in order for it to read this file and populate my drop down box.

I suppose the question really is How do I initiate the read of my drop-down box file?

Any assistance is appreciated.... thanks....
November 04, 2004, 02:35 PM
<WFUser>
Try creating the file with HOLD FORMAT FOCUS. Resource Layout needs to be able to read the data and you don't want to be bothered with FILEDEFs. Make sure the FOC and MAS get created in your app directory, the point Resource Layout to that file for your drop down. This will work.
November 04, 2004, 05:47 PM
webfocuspgm
Thanks WFUser, I tried your suggestion and still no luck. This is what finally worked from an IBI tech. I had to enter my Dataset Location (filedef) information in the master file.
November 04, 2004, 06:07 PM
TexasStingray
What Version of DevStudio are you using? 5.3 has a lot of cool enhancements to it.
November 04, 2004, 09:54 PM
George Brown
At Loyola we picked up a trick from our consultant named John Calappi from IBI who helped us out...


DEFINE FILE LUR_ACTIVE_SUBJECTS
OPTION/A100='';
END
-* COMPUTE SUBJECT/A99 = '';
TABLE FILE LUR_ACTIVE_SUBJECTS
PRINT
OPTION
BY SUBJECT NOPRINT
ON TABLE HOLD AS SUBJECTS FORMAT ALPHA
END
TABLE FILE LUR_ACAD_GROUP_TBL
PRINT COMPUTE OPTION/A100='';
BY ACAD_GROUP NOPRINT
ON TABLE HOLD AS GROUPS FORMAT ALPHA
END
-HTMLFORM BEGIN















ENTER A TERM




CHOOSE AN ACADEMIC GROUP


CHOOSE A SUBJECT



CHOOSE REPORT FORMAT


















-HTMLFORM END
You can use either a define or a compute (both shown here) to generate the data for the dropdowns and the work is done with the
!IBI.FIL.FILENAME line. This .fex then calls the actual .fex which does the work. Each of the values used for the hidden input types can be found by right-clicking on the object in mre or dev_studio or you can use rlp to generate it for you.

The reason we use FOC_NONE for the "ALL" is that the focexec will ignore the line that contains that keyword.

I hope this helps more than hinders Smiler

This message has been edited. Last edited by: <Mabel>,