Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: File Path/Name Viewing rpt on BOE server Post Reply Post New Topic
Author Message
statey603
Groupie
Groupie
Avatar

Joined: 14 Aug 2013
Online Status: Offline
Posts: 78
Quote statey603 Replybullet Topic: File Path/Name Viewing rpt on BOE server
     Posted: 11 Oct 2013 at 9:23am
We have the [File Path and Name] Special Field in our reports. When they execute on the server the name is a temporary name.  For example, report was added to server with name: [VENDOR_SERVICE_AUTH.rpt]. when the report is viewed, the File Path and Name show the name as [ps_21d07b4527f82c0.rpt]. We have many reports with similar names and layouts and wanted to use the name to confirm which report is run and from where. I am assuming this name is some sort of instance name.
 
I suppose we can hard-code the name on the report in a static text box, but am wondering if there might be some other way to approach this - using either Crystal Rpts variables or Server Configuration.
 
I appreciate any suggestions, etc.
 
- Bill
 
-bill
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Oct 2013 at 4:52am
the ideas that come to mind are to set the value via an input parameter, or directly through code (if an app is calling the report).

I've never used that Special Field before, so I am not familiar with it...but at the very best it would be a constant value, which is really about the same as hard coding it into the report.

You could also probably use the Title in the report summary, I am pretty sure that many of the reports here do that...but again, that is basically the same as hard coding.

HTH
IP IP Logged
statey603
Groupie
Groupie
Avatar

Joined: 14 Aug 2013
Online Status: Offline
Posts: 78
Quote statey603 Replybullet Posted: 14 Oct 2013 at 5:10am
thanks for your reply.
Here is what I ended up doing.
 
//------------------------------------------------------
// Formula: getPathAndRptNme
// Returns a string containing the Path and Report Name.
// NOTE: IF the report is running on the Crystal Server,
// use [Crystal Reports Server\] for the path
// because the real path is too long to display.
// Also, hard-code the report name because the filename
// special variable returns the temporary instance name.
// Append the temporary server report instance name for
// debugging purposes.
//------------------------------------------------------
IF Instr({@getPath}, "CrystalReports2011ProcessingServer") = 0 THEN
  // not running on the server
  // return the filename variable [same as Special Field: File Path and Name]
  filename
ELSE
  // running on the server
  // Hard-code the path and report name
  "Crystal Reports Server\POST_VENDOR_SERVICE_AUTH.rpt " 
    + chr(10) + chr(13)
    + "Temporary Instance Name: " + {@getFileNme}
//-----------------------------------------------------------------

 
//-----------------------
// Formula: getPath
// return everything up to the file name
//-----------------------
filename [1  to InstrRev( filename , '\')]
//-----------------------------------------------------------------
 
//-----------------------
// Formula getFileNme
//-----------------------
filename [ InstrRev ( filename , '\') + 1  to Length (FileName)]
//-----------------------------------------------------------------
 
 
 

 

-bill
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum