Dear Experts, I have made a tdl file for attaching a file. My Problem is that the Complete File Path with extension is not getting changed. Am hereby attaching the TDL kindly help.
It only changes when we are making the Full Path Blank then again we have to re select for the changes. So it is not changing / updating simultaneously while changing the File.
Dear sir, the code is very good just make changes as in save file field Set As : ($$LocaleString:$Filepath)+"\"+($$LocaleString:$FileName) and set always : yes thats it your code is best one regards Rajendra Mithari 9325509009
Dear All, I have made some changes but still not getting success. Kindly help. I have added two option for opening the file in the Voucher Level and Uploading it if needed. But how to set path ??? And the problem is the full path is not getting updated as and when it is selected or changed. [#Part: VCH Narration] Add : Line : Attc ;;[!Part: BankDet VCH Narration] ;;Add : Line: attachfile [#Form: Accounting Voucher] Add : Button : Open File [Button : Open File] Key : Ctrl + O Action : Exec Command: $Fullpath [Line: Attc] Field: Medium Prompt, Attinfo Local: Field: Medium Prompt: Info: "Want to Attach File ? " Space Top: 1 [Field: Attinfo] Use: Logical Field Storage : Enableprenarration Set as: If $$IsEmpty:$$Value then "No" else $$Value Sub Form: Attchdet Rep: $$Value = "Yes" [Report : Attchdet Rep] Form : Attchdet Form [Form : Attchdet Form] Parts: Attchdet Part Height : 15% Page Width : 90% Page On: Form Accept : CALL : TSPLSmpRefreshFile Add: Button : Upload File [Part : Attchdet Part] Line : attachfile [Line: attachfile] Fields : Short Prompt, Dirpath, Filename, Savefile Local : Field : Short Prompt : Info: $$LocaleString:"File Path" [System: UDF] Dirpath: String : 1101 FileName: String : 1102 Fullpath: String : 1103 [Button : Upload File] Key : Ctrl + S ;;Action : CopyFile:##MyDstFilePath: ##Fullpath Action : Exec Command: $Fullpath [Field: Dirpath] Use : Name Field Color: Blue Border: Thin Bottom Set As: ##TSPLSmpDirectoryPath Modifies : TSPLSmpDirectoryPath : True Tooltip : "Enter the folder path from where the files are to be listed" ;; Skip Forward: Yes Storage: dirpath On : sELECT : Yes : Modifies : #dirpath [Field: Filename] Use : Name Field Table : List of Files, Not Applicable , End of list Set Always : Yes Show Table : Always Align : Center Width : 40% Page Tooltip : "Select a file from the Table" Storage :FileName Modifies : TSPLFilename : True ;;On : sELECT : Yes : Modifies : #filename [Field: savefile] Use : Name Field ;;On : Focus : Yes : CALL : TSPLSmpRefreshFile ;;Table : Attchpath ;; Set Always : Yes ;; Show Table : Always ;; Align : Center ;;Set As : @@TSPLSmpDirectoryPath + "\" + @@Filenm Set As : $Filepath + "\" + $FileName Storage :Fullpath ;;Invisible : Yes [Field: openfile] Use : Name Field Set As : "Open" Key : Execute File ;;Skip : Yes Color : Black Print FG : Pale Leaf Green Border : TQ Width : 5 [Border: TQ] Top : Thick, Double Bottom : Thick, Double Left : Thick, Double Right : Thick, Double [Collection: List of Files] Title : $$LocaleString:"List of Files" Data Source : Directory : #TSPLSmpDirectoryPath Filter : TSPLSmpTextFiles Format : $Name, 25 Format : $FileSize, 15 ;;Format : $IsReadOnly, 15 Format : $LastModifiedDate, 15 Format : $LastModifiedTime, 15 [Collection: AttchPath] Variable : Filename Filter : TSPLSmpAttchFiles [System: Variable] TSPLSmpDirectoryPath : "C:\TDL" ;;[System: Variable] ;; MyDstFilePath : "D:\TAUFEEQ" [System: Formula] ;; Specify the required Directory Path TSPL Smp Directory Path : ##TSPLSmpDirectoryPath TSPL Smp File Name : ##TSPLFilename ;; TSPL Smp Text Files : $$TSPLSmpRefreshTable:#TSPLSmpDirectoryPath AND NOT $$IsDirectory:$Name AND (($Name CONTAINS ".txt" OR $Name CONTAINS ".xml" OR $Name CONTAINS ".sdf" OR $Name CONTAINS ".tdl") AND $Name NOT CONTAINS "tdlserver") TSPL Smp Text Files : $$TSPLSmpRefreshTable:#TSPLSmpDirectoryPath Filenm : $$TSPLSmpRefreshfile:#TSPLFilename ;; Dummy Function introduced to Refresh the Table dependent on the Previous ;; Field Value i.e., User Input [Function: TSPLSmpRefreshTable] Parameter : pTempVar : String 00 : RETURN : True [Function: TSPLSmpRefreshFile] Parameter : attchfile : String OO : RETURN : True ;; Variable declaration to hold the last updated Directory path [Variable: TSPLSmpDirectoryPath] Type : String Persist : Yes [Variable: TSPLFilename] Type : String Persist : Yes
[#Part: VCH Narration] Add : Switch : BankDetRcpt : BankDet VCH Narration [!Part: BankDet VCH Narration] Add : Line : attachfile [Line: attachfile] Fields : Short Prompt, dirpath, filename, savefile, openfile Local : Field : Short Prompt : Info: $$LocaleString:"Attach File." [System: UDF] Filepath : String : 1101 FileName : String : 1102 Fullpath : String : 1103 [Key : Execute File] Key : Left Click Action : Exec Command: $Fullpath ;; Action : CopyFile:##MyDstFilePath: ##MySourceFilePath [Field: dirpath] Use : Name Field Color : Blue Border : Thin Bottom Set As : ##TSPLSmpDirectoryPath Modifies : TSPLSmpDirectoryPath : True Tooltip : "Enter the folder path from where the files are to be listed" ;; Skip Forward : Yes Storage : Filepath [Field: filename] Use : Name Field Table : List of Files, Not Applicable , End of list Set Always : Yes Show Table : Always Align : Center Width : 40% Page Tooltip : "Select a file from the Table" Storage : FileName Modifies : Pathupdate : True [Field: savefile] Use : Name Field Set As : ($$LocaleString:$Filepath)+"\"+($$LocaleString:$FileName) Storage : Fullpath ;; Invisible : Yes Set Always: Yes [Field: openfile] Use : Name Field Set As : "Open" Key : Execute File ;; Skip : Yes Color : Black Print FG : Pale Leaf Green Border : TQ Width : 5 [Border: TQ] Top : Thick, Double Bottom : Thick, Double Left : Thick, Double Right : Thick, Double [Collection: List of Files] Data Source : Directory : #TSPLSmpDirectoryPath Filter : TSPLSmpTextFiles [System: Variable] TSPLSmpDirectoryPath : "D:\Taufeeq\Tally TDL's" [System: Formula] ;; Specify the required Directory Path TSPL Smp Directory Path : ##TSPLSmpDirectoryPath ;; TSPL Smp Text Files : $$TSPLSmpRefreshTable:#TSPLSmpDirectoryPath AND NOT $$IsDirectory:$Name AND (($Name CONTAINS ".txt" OR $Name CONTAINS ".xml" OR $Name CONTAINS ".sdf" OR $Name CONTAINS ".tdl") AND $Name NOT CONTAINS "tdlserver") TSPL Smp Text Files : $$TSPLSmpRefreshTable:#TSPLSmpDirectoryPath ;; Dummy Function introduced to Refresh the Table dependent on the Previous ;; Field Value i.e., User Input [Function: TSPLSmpRefreshTable] Parameter : pTempVar : String 00 : RETURN : True ;; Variable declaration to hold the last updated Directory path [Variable: TSPLSmpDirectoryPath] Type : String Persist : Yes [Variable: Pathupdate] Type : String Persist : Yes
Mr Ras Raj. The File is attached herewith. You will get an option for Opening as well as Uploading the file in the Sub Form of Attachment Field.
Show some error in Line No.81 "On : sELECT : Yes : Modifies : #dirpath" Sir, Please check & reply.. Thanks