Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

RBuilder.ini

edited March 2009 in General
Hi
How can I prevent RBuilder.ini file being created/updated in the windows
system folder?
The help says to change the iniStorageType property in the report
designer but I cant find that property anywhere.
I have RB 10.06 and Delphi 2007
Any Ideas
Thanks
Bruce

Comments

  • edited March 2009
    Hi Bruce,

    At design time the RBuilder.ini file will always be stored in the WinSys
    directory. This can cause issues with Vista installations so for the latest
    version of ReportBuilder (RB 11) we changed the default location to the
    ...\Local Settings\Application Data\... directory.

    Note that ReportBuilder 11 was our first Vista compatable release.

    At runtime, using the enduser designer (TppDesigner object) you can manually
    control where the RBuilder.ini file is stored on your users' machines using
    the IniStorageType and IniStorageName properties. Also for RB 11, we added
    a new type "IniNone" allowing you to prevent any ini file from being used.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2009
    Nico Cizik (Digital Metaphors) wrote:
    Thank you Nico for your help - I'll upgrade to RB 11.
    Cheers
    Bruce
  • edited October 2009
    Hello,
    there are many entries here about the RBuilder.ini issue, so not sure where
    to post. This one seems to be ok too.

    I had the same problems, but figured out how to change / use the
    IniStorageType and IniStorageName properties.
    One thing I don't understand, though, is: how is the workflow of the
    accessing / usage of the iniFile in general?

    When does what happen? In what order? I have checked all help files I found,
    but without a proper result.

    1) In my case I have a form with a designer component on it. Before showing
    the designer in a panel, I call a procedure I made, to configure the
    deisgner. I.e. I'm hiding some toolbars, toolbuttons, menus there and so on.
    When it's the first time (no iniFile created yet), I would also like to show
    all remaining toolbars etc. and to order them according to my own default
    configuration I would like to offer the customer.

    After this the settings should be stored, also everytime the customer leaves
    the designer, to make sure the changes, he could have done, are stored too.

    Exactly this isn't working somehow.

    When the iniFile isn't there yet and I access lMenuBar :=
    myDesigner.Form.MainMenu; the first time in the procedure I made to
    configure the designer, the iniFile get's created, i.e. *before* I changed
    anything.
    After my changes are done, I would expect, that they are saved once I close
    the designer or something like that, but this isn't happening. So next time
    I open the designer again, the configuration is loaded, which was saved
    *before* I made my changes.

    Am I doing anything wrong? If so: what is it? How is it supposed to work?
    What should I do to achieve the goal?


    2) Also: theoretically the IniFile can be edited by the user manually. What
    should be done to make sure, that only components / elements are available,
    which I determined to be available for EndUsers and at the same time to make
    sure, that the changes the customer could have done *within* the designer
    are not overwritten with my defaults? I.e. that only the changes are
    "removed", which would make available some elements, which the EndUser
    shouldn't be able to see.

    Hope it's understandable. Let me know if it is not, so I can try to explain
    it better :)

    Kind regards,
    Mark


  • edited October 2009
    Hi Mark,

    I'm a bit unclear about the types of changes that are not being stored in
    the .ini file.

    Note that the .ini file only stores items such as toolbar location and
    visibility, window size, etc. If you are doing things like adding or
    removing menu items/toolbars, you will need to preform this task each time
    the designer is loaded as it will not be saved in the ini file.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Nico,
    I know and that's what I would like to see being stored, though it didn't
    work.

    Before showing in panel I do such things as an example:
    if assigned(lDesignerMenu.ViewMenu.Toolbars.Items[4]) then
    begin
    lDesignerMenu.ViewMenu.Toolbars.Items[4].Visible := false;
    end;
    lDesignerMenu.ReportMenu.Groups.Visible := false;

    lAction :=
    lToolActionManager.StandardActions.GetActionForName('New');
    TCustomAction(lAction).Visible := False;
    lAction :=
    lToolActionManager.StandardActions.GetActionForName('Open');
    TCustomAction(lAction).Visible := False;
    lAction :=
    lToolActionManager.StandardActions.GetActionForName('Save');
    TCustomAction(lAction).Visible := False;

    lDesignerMenu.FileMenu.New.Visible := False;
    lDesignerMenu.FileMenu.NewReport.Visible := False;
    lDesignerMenu.FileMenu.Open.Visible := False;

    and so on.

    When I'm done, there are still some toolbars + button, menus etc. some are
    visible, some are not, so the first time I go ober the menu -> view ->
    toolbars and make toolbars like "Standard", "Size" etc. visible, put them in
    an order and then, when I close the designer, I would think, that those
    toolbars, or the datatree or an other element would be at the same place,
    have the same visibility how I left the designer last time. But that's not
    the case. Such changes aren't stored in the iniFile. It get's created /
    edite everytime I access the designer, but isn't being saved when I leave it
    and so the designer has everytime "wrong", old setting.

    Do I have to call a method to save the current designer state manually or
    so?
    Is showing in a panel the reason maybe?


  • edited October 2009
    Hi Mark,

    The .ini file will only store information about the designer that can
    actually be changed in the designer itself. For instance, if you open the
    designer, hide the entire "Draw" toolbar, then close the designer, that
    information will be saved in the .ini file.

    The hiding of individual toolbar items or menu items manually in code as you
    are doing below will not however be saved down in the .ini file. Under
    current design all the code you have below will need to be called every time
    the designer is opened to ensure that all items you want to keep invisible
    will remain that way.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Nico,


    That's exactly what is *not* working. I think I do realize, how it is
    supposed to work.
    What I want to do is:
    First time the form with the embedded designer is opened and the designer
    showed, I want to configure the designer and enable / disable / hide / show
    elements how I like them to be. So at that point the user has the
    configuration I want to offer him. Here I would think, that once the
    designer is closed, the information about it current status get ssaved in
    the ini-file, but it doesn't. Even if the user changes something afterwards
    within the designer, i.e. hiding a toolbar or showing one, those changes are
    not saved in the ini-file either.

    The ini-file only gets created, in case it's not there already. It doesn't
    get updated afterwards at all and the only information saved there is about
    the theme:
    [ThemeInfo]
    Office2007UserScheme=3
    ThemeName=Whidbey

    Nothing more.
    I don't think that's correct, is it?

    Mark
  • edited October 2009
    Hi Mark,

    I'm sorry, I apparently missunderstood the issue.

    Does this behavior only occur with the embedded Designer? If for instance
    you create a simple example with a non-embedded designer and change some of
    the settings as you are doing originally, is the .ini file updated?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Nico,
    no problem. It's often difficult to describe and english is not my native
    language, so I surely do write weird stuff sometimes, which can be easily
    missunderstood ;)

    While trying out what you suggested, I realized, that the difference between
    "Show" and "ShowInPanel" is, that after "Show" I have to close the designer
    at some point, so OnClose is probably executed. Using "ShowInPanel" I didn't
    call "myDesigner.Close" when closing my form, so the saving routine wasn't
    executed most likely. Now I do that and the ini-file is being updated.

    My fault... The solution was so easy and so close... I'm sorry for the
    trouble...

    Thank you for your help!

    Regards,
    Mark

This discussion has been closed.