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

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:53AM
    typically create a variable in report dictionary no expression name dpath
    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))+';

    ;)
  • edited 2:53AM
    Thank you for your help.

    It worked great ;)


    John

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.