Page 1 of 1

clear custom databases

Posted: Fri Aug 18, 2023 1:43 pm
by fridaystreet
we are using the following command in a react component to add a custom database type to the editor on load

Code: Select all

window.Stimulsoft.Report.Dictionary.StiCustomDatabase.registerCustomDatabase(options)
Is there a way to clear the existing registrations or check if the custom db is already registered before running this command? Currently each time the component renders it adds another instance of the custom db and the list of databases in the UI just keeps growing.

I realise we could try and manage this with some state, but that still isn't ideal as it might be out of sync. It would be better if we could just reset the list before registering or query the editor in some way to check if it is registered

Cheers

Re: clear custom databases

Posted: Mon Aug 21, 2023 10:32 pm
by Lech Kulikowski
Hello,

It is stored in the browser cache, you can clear it.

Thank you.

Re: clear custom databases

Posted: Wed Aug 30, 2023 3:01 am
by fridaystreet
any idea how?

or do you mean clear the entire browser cache? that can't be right surely. we'd be having to get the user to refresh the page every 30 seconds

Re: clear custom databases

Posted: Thu Aug 31, 2023 8:00 am
by Lech Kulikowski
Hello,

You can use the following code to check and remove unnecessary adapters:

Code: Select all

for (var i = 0; i < StiOptions.Services.databases.length; i++) {
                if (StiOptions.Services.databases[i].serviceName == "PostgreSQL" || StiOptions.Services.databases[i].serviceName == "Firebird")  // .....
                    StiOptions.Services.databases.splice(i, 1);
            }
Thank you.

Re: clear custom databases

Posted: Mon Sep 04, 2023 8:24 am
by fridaystreet
Great thanks appreciate your help

Re: clear custom databases

Posted: Mon Sep 04, 2023 12:01 pm
by Lech Kulikowski
Hello,

You are welcome.