Home Devices

Issue when Group.NewFile = True

edited July 2011 in Devices

Delphi 6, RB Server 11.08.

I have a report that is exporting to file, and the group's NewFile property
is set to True. This works as expected, where a file is created for each
group, and the suffix of the filename is the group's break value (e.g.
myreport.txt becomes myreport_1.txt, myreport_2.txt, etc).

However, I have a situation where this does not work correctly. The
directory I am exporting the files to is the user's Temporary directory, as
returned by the Windows API call GetTempPath. In my case (as is the same
within my whole organisation), my user directory name looks like this:


As you can see, Windows has created this directory by using my login name
and my domain name, separated by a full stop. I have seen this standard
behaviour on customer sites as well, and it is the same on Windows XP
through to Windows 7.

This causes a problem with the routine that adds the suffix to the filename.
I have identified the routine as function TppFileDevice.AddFileSuffix in

What this routine appears to be doing is looking for the first '.'
character, assuming this is the file extension separator. In the scenario
given above, this is not the case. What happens is that instead of getting a
file called:


I get:


It has added the suffix to the folder name, before the first period
character, instead of to the filename.



This discussion has been closed.