ppToolbarTBX SavePreferences
I have a simple report in my application but when my application
runs, it complains that it is unable to write the 'RBuilder.ini'. In
my debug log, it looks like the .ini needs to be written by the
ppToolbarTBX unit. How do I initialize this in my application
so I won't get this error? I am using the built-in preview for
the report.
Thanks in advance.
Andy
runs, it complains that it is unable to write the 'RBuilder.ini'. In
my debug log, it looks like the .ini needs to be written by the
ppToolbarTBX unit. How do I initialize this in my application
so I won't get this error? I am using the built-in preview for
the report.
Thanks in advance.
Andy
This discussion has been closed.
Comments
----------------------------------------------------
Tech Tip: RBuilder Ini Storage
----------------------------------------------------
For an end-user reporting application, use the TppDesigner IniStorageType
and
InitStorageName properties can to control how/where ReportBuilder stores
user
preferences.
For a reporting application that does not include the TppDesigner component,
the
settings can be configured programmatically.
1. To modify the location of RBuilder.ini
uses
ppIniStorage,
ppFileUtils;
procedure TForm1.FormCreate(Sender: TObject);
var
lsStorageName: String;
begin
lsStorageName := TppFileUtils.GetApplicationFilePath + '\RBuilder.ini';
TppIniStoragePlugIn.SetStorageName(lsStorageName);
end;
2. To modify the storage to use the Windows Registry
uses
ppIniStorage;
begin
// configure the ini storage to use the registry
ConfigureIniStorage(TppRegistry.ClassDescription,
TppRegistry.DefaultStorageName);
end;
procedure ConfigureIniStorage(aStorageType, aStorageName: String);
var
lIniStorageClass: TppIniStorageClass;
begin
lIniStorageClass := TppIniStoragePlugIns.GetClassForName(aStorageType);
if (lIniStorageClass <> nil) then
begin
TppIniStoragePlugIn.SetClass(lIniStorageClass);
TppIniStoragePlugIn.SetStorageName(aStorageName);
end;
end;
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
the permission to Administrator in order for the application to run,
but it would be better if I could set the .ini file to a user path. I think
this has something to do with the report designer. Please advice and
thank you in advance.
Andy
Thanks for the speedy response.
Andy
It is still giving me the same error. I tried putting the code in the
FormCreate
as well as in the .dpr but still complains that it is trying to write to the
Windows
folder. Any idea why?
Thanks in advance.
Andy
Maybe I need to put it in the initalization section? How would I do this?
It seems to bomb before the FormCreate event fires.
Thanks again.
Andy
What version of RB are you using? Check the Help | About box of the report
designer.
If you are not using RB 10.07, then try updating. I think we modified the
timing of when RBuilder.ini is first accessed, I do not recall in which
version we did.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
I am using version 10.02.
Andy