Issue when Group.NewFile = True
Hi,
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:
C:\Users\Jason.DOMAINNAME\AppData\Local\Temp
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
ppFilDev.pas.
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:
C:\Users\Jason.DOMAINNAME\AppData\Local\Temp\myreport_1.txt
I get:
C:\Users\Jason_1.DOMAINNAME\AppData\Local\Temp\myreport.txt
It has added the suffix to the folder name, before the first period
character, instead of to the filename.
Jason.
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:
C:\Users\Jason.DOMAINNAME\AppData\Local\Temp
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
ppFilDev.pas.
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:
C:\Users\Jason.DOMAINNAME\AppData\Local\Temp\myreport_1.txt
I get:
C:\Users\Jason_1.DOMAINNAME\AppData\Local\Temp\myreport.txt
It has added the suffix to the folder name, before the first period
character, instead of to the filename.
Jason.
This discussion has been closed.
Comments
This issue was fixed for RB 12. We hope you will consider upgrading to
the latest version. Below is a link to all the new features included
with RB 12.
http://www.digital-metaphors.com/rbWiki/General/What's_New/RB_12
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com