multiple mysql databases for different clients

  • is jsreport can work with multi-tenant environments, such as multiple databases for different clients?, should I collect the data from the database firstly before I send it to the jsreport function?

  • administrators

    hi! yes, you can handle this in the best way you like, for example, you can collect the data from the database before calling render, this way jsreport keeps agnostic if it is data from a tenant or not and basically, your app decides how to fetch such data and what params you need to fetch the correct information linked to a specific tenant.

    the other option is that you use a db client you like in a jsreport-script beforeRender function, then you put there the logic you want to fetch the data about the tenant, of course, you will need to send some basic things to your report params like the tenant id/name for example so you can use it in the script to create your query. i think the best option is that you just handle in your app and just pass it to jsreport transparently

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.