Cari Blog Ini

24 April 2013

How To Get Only Filename in Crystal Report

Apply To:
Crystal Reports 9.2

Problem:

How To Get Only Filename in Crystal Report




Step - Step : 


1. Example Report, filename = "AN-09-002-01.rpt"




in Preview Design


2. Create New Formula Name,



3. Then fill the Formula name, example : GetOnlyFileName

and click "Use Editor"



4. In Formula Editor, Fill the Formula Name = GetOnlyFileName,
with code below

---> right(filename,len(filename)-instrrev(filename,'\'))

then click "Save" and "Close"

5. Create a Label Name, example : "Formula Fields - GetOnlyFileName ="

6. Drag the Formula Fields Name "GetOnlyFileName", to Design Report

7. Next, see the Preview of Report.