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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Revision Number 1

Status
Not open for further replies.

Jimdeb03

IS-IT--Management
Dec 10, 2002
89
US
I would like to print the Revision Number onto my reports in CR 9 but haven't found a formula or function to do so. There's an entire listing of Document properties under Functions in the Formula Editor except for printing out the Revision Number.

Is it possible to print the Revision Number onto a report?
thanks,
Jim
 
Hmmm - I've never thought about printing the revision number (sometimes looking at those statistics is not a good thing....). I took a look at this, and could see no way to do it using a normal function or formula - however, this info is available to Crystal if you write a report using 'File System' as the data source. While I haven't tried this to see if it would work, I guess you could develop a subreport that used 'File System', with selection criteria to only reflect the name of the main report, and pull in the revision number that way.

Peter Shirley
 
If you name your reports with a version # or letter as a suffix, e.g., Participant Characteristics-B, then you just need to add the "Special Field" called "File Path and Name" or the Report Title (if you make a habit of using this field under File->Summary Info) to your report. There is a revision number in the Statistics tab in the same screen (in 8.0), but this gets updated every time you save, so might not reflect what you as a designer would consider a whole new version. Not sure whether Peter is referencing that number.

-LB
 
LB - yep, I was referring to the revision number in the statistics tab - I'm pretty sure that's the revision number Jim was referring to as well. I can't see anyway within the Crystal Designer to include the revision number, but I know it is one of the atributes available when you report from the 'LocalFileSystem' under 'More Data Sources'. That's why I was thinking a subreport could get this value pretty easily.

Peter Shirley
 
Very nice suggestion Peter. I created the report as you suggested and linked it into the main report. Works like a charm.

You mentioned that you haven't tried it yet, so here is the method that I needed to use to get it to link up correctly.

I wasn't able to get it to work using just FileName as my formula. The concatenation in the subreport of the directory and file wasn't cooperating. I needed to strip off the directory information in the main report.

I created a formula in the main report:
stringvar path:=FileName;
stringvar flip:=StrReverse (path);
numbervar slash:=instr(flip,"\")-1;
stringvar output:=right(path,slash);
output:=mid(path,length(path)-slash+1,slash)

I then linked the file name in the main report to the File Name field in the sub report.


There wass an oddity though. In the summary info of my report shows the revision at 130, but in the sub it shows as 120. ?????


Mike
 
Hmmm - that's strange - glad it worked though. I guess I was just thinking of forcing the path and file name as selection criteria within the subreport, but your method should allow the subreport to be used in any mainreport.

Peter Shirley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top