Home » Developer & Programmer » Forms » How to filter/display particular file using text parameter while Browsing In D2K6i (Oracle 10g D2K 6i)
How to filter/display particular file using text parameter while Browsing In D2K6i [message #630928] Tue, 06 January 2015 06:12 Go to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

I have written a code on Button to browse the file i.e

--when_buton_pressed

declare
filename varchar2(1000);
begin 
filename := GET_FILE_NAME(File_Filter=> 'All Files,(*.*)');
:B1.SOURCE_PATH:=FILENAME;
end; 


when i press the button it displays me all file in current directory. for example
i am browsing a file in "TEMP" Folder and there are 100 files and out of 100 there is one file named orafaq.txt . it shows me all 100 files when i press Browse Button.

Now i am adding one text item and i will input a file name as parameter value.
My requirement is that it should show only that file which i have used in text item.

for ex:- value in text item= orafaq.txt
then it should display only orafaq.txt file when i press browse button.

Is it possible to achieve this target , if yes then plese tell me how.
I have attached sample .fmb file.
Re: How to filter/display particular file using text parameter while Browsing In D2K6i [message #630934 is a reply to message #630928] Tue, 06 January 2015 06:47 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Would substituting "(*.*)" with "(orafaq.txt)" do any good?
Re: How to filter/display particular file using text parameter while Browsing In D2K6i [message #630935 is a reply to message #630934] Tue, 06 January 2015 06:57 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

@LF I didn't get you , anyways substituting "(*.*)" with "(orafaq.txt) is not working.
Re: How to filter/display particular file using text parameter while Browsing In D2K6i [message #630950 is a reply to message #630935] Tue, 06 January 2015 11:21 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
filename := GET_FILE_NAME(File_Filter=> 'All Files,(*.*)');

This line of code instructs the "Open File" dialog how to filter files. You can only filter by filters supported by FILE_FILTER parameter. Since you already know the name of the file, use the FILE_NAME parameter instead of the FILE_FILTER parameter. Eg:
filename := GET_FILE_NAME(File_Name=>'orafaq.txt');


Craig...
Re: How to filter/display particular file using text parameter while Browsing In D2K6i [message #630958 is a reply to message #630950] Tue, 06 January 2015 23:30 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

@craig the solution you provided , only inputs file name in "File Name" field in "Open" Window, meanwhile while browsing file if i click on some other file or folder , it takes name of that file in "File Name" field. It doesn't hide other files.
so my requirement is still not fulfilled.
i have attached updated sample file. please check.
Re: How to filter/display particular file using text parameter while Browsing In D2K6i [message #630970 is a reply to message #630958] Wed, 07 January 2015 02:35 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
If it's a standard windows file browser then I very much doubt you can do what you want.
But if you're only interested in a single file that you know the name of why are you using GET_FILE_NAME at all?
Re: How to filter/display particular file using text parameter while Browsing In D2K6i [message #630986 is a reply to message #630970] Wed, 07 January 2015 07:00 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

i m not interested in a single file , there is a text item in which user inputs /selects file name, n that file name should be used as a parameter to display only that file while browing.
anyways i have found a solution on a trigger i have assigned value for source file:= 'C:\Folder-name\'||:block.text_item||'.file-extension' , and i have displayed hint at the bottom that "Kindly place all files in C:\Folder-name\.

Now user have no need to browse the file. file will be picked automatically.

anyways thanks all for your valuable feedbacks & suggestions. Smile

[Updated on: Wed, 07 January 2015 07:01]

Report message to a moderator

Re: How to filter/display particular file using text parameter while Browsing In D2K6i [message #630991 is a reply to message #630986] Wed, 07 January 2015 07:32 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
That was my point really. If you know the file name it's pointless to look it up, just assign it directly where you need it.
Previous Topic: Invoke Forms Builder (Version 9.0.4.0.19) on the (Solaris-8) command using Reflection X-Windows
Next Topic: How to use Marquee tag of HTML in Oracle forms
Goto Forum:
  


Current Time: Thu Mar 28 20:57:15 CDT 2024