Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Schedule to Destination - need to customize filename placeholder

Status
Not open for further replies.

khartman

IS-IT--Management
Dec 18, 2001
62
US
Hello everyone. A CE10 Pro (running on W2K servers) question. I need to customize one of CE's placeholders that are used in defining a filename. When defining a specified filename for reports you are scheduling to a DESTINATION, you can use Crystal's predefined placeholders in the filename (e.g., ID, Title, Extension...) The placeholder I need to customize is SI_STARTTIME. The current format of this placeholder is 'YYYY-MM-DD-HH-MM-SS' I have been asked that when creating the specified filename that the timestamp be in a very specific format:

Reporttitle-YYYYMMDD-HHMMSS-00.ext (where the "-00" is a constant).

I thought I could modify it in the DESTHELPER.CSP file but this page does not seem to affect anything. The code in this CSP page looks like the following:


// clean up all the %SI_NAME%, %SI_ID%, %SI_OWNER%, %SI_STARTTIME%
function ChangeToRealInstanceFileName( siName, siId, siOwner, siStarttime, frsFilename, fileName)
{

function ZeroInFrontOfSingleDigit( numVal)
{
if (numVal < 10)
return String( "0" + numVal);
else
return String( numVal);
}

fileName = fileName.replace(/%SI_NAME%/g, String(siName));
fileName = fileName.replace(/%SI_ID%/g, String(siId));
fileName = fileName.replace(/%SI_OWNER%/g, String(siOwner));

if(siStarttime != "")
{
var dateVar;
var dateString;

dateVar = new Date(siStarttime);
dateString = String( dateVar.getFullYear())
+ "-" + ZeroInFrontOfSingleDigit( dateVar.getMonth() + 1) // zero based
+ "-" + ZeroInFrontOfSingleDigit( dateVar.getDate())
+ "-" + ZeroInFrontOfSingleDigit( dateVar.getHours())
+ "-" + ZeroInFrontOfSingleDigit( dateVar.getMinutes())
+ "-" + ZeroInFrontOfSingleDigit( dateVar.getSeconds());

fileName = fileName.replace(/%SI_STARTTIME%/g, dateString);
}

if(frsFilename != "")
{
var ext;
var index = frsFilename.lastIndexOf(".");
if(index != -1)
{
ext = frsFilename.substr(index+1);
fileName = fileName.replace(/%EXT%/g, ext);
}
}

return fileName;
}
%>


To me this looks like where they are setting the format for the SI_STARTTIME placeholder - but apparently it isn't. I am hoping someone has an idea on this and can steer me in the right direction

Thanks,


Kenneth Hartman
Manager, EIS
Hughes Network Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top