Setting Directory in Report
Hi,
I've recently taken over development of a simple stock and accounting system written in Delphi and Fast Report 2.5 using DBISAM as the database.
The system is very stable but needs major overhaul. I'm getting round Fastreport fine (and I'm considering upgrading to version 3 once I can work out how to include DBISAM files directory into the report, like the datadriver in the powerpack )
Anyway my. what will probably be a minor problem is, all the directory name in the tfrDBIDatabase on the dialog page are hard coded 'C:\stock\data'. I now need to install the system on a number of different machines and these will not always be in the same directory. I now need to set the directory name via code, I've tried to get directory name set via the dictionary but I can't get it to work correctly.
The datapath and reporting path are held in the main control database if this is any help.
I hope the above makes sense.
Thanks in advance for any replies.
John
I've recently taken over development of a simple stock and accounting system written in Delphi and Fast Report 2.5 using DBISAM as the database.
The system is very stable but needs major overhaul. I'm getting round Fastreport fine (and I'm considering upgrading to version 3 once I can work out how to include DBISAM files directory into the report, like the datadriver in the powerpack )
Anyway my. what will probably be a minor problem is, all the directory name in the tfrDBIDatabase on the dialog page are hard coded 'C:\stock\data'. I now need to install the system on a number of different machines and these will not always be in the same directory. I now need to set the directory name via code, I've tried to get directory name set via the dictionary but I can't get it to work correctly.
The datapath and reporting path are held in the main control database if this is any help.
I hope the above makes sense.
Thanks in advance for any replies.
John
Comments
and use the onactivate event of the frdialog to set dbname or path to this variable
db1.datapathname := [dpath];
in delphi code where you call report
after loading report pass a value to the report variable
frreport1.loadfromfile('pathname+filename')
frreport1.variables :='+ ExtractFilePath(ParamStr(0))+';
It worked great
John