fralx / LimeReport

Report generator for Qt Framework
http://limereport.ru/
Other
403 stars 154 forks source link

default database connection name #445

Open MrAhmedSayedAli opened 1 year ago

MrAhmedSayedAli commented 1 year ago

how to set custom database connection name from code by code like report->dataManager()->setReportVariable("custom_connection_name",EasyQtSql::SqlFactory::getInstance()->getDatabase("CLOUD").connectionName())

report->dataManager()->setDefaultDatabasePath()

image

MrAhmedSayedAli commented 1 year ago

i just make temp fix for me add qh->setConnectionName(replaceVariables(qh->connectionName()));

https://github.com/fralx/LimeReport/blob/f73342dc20414bb1ef97b396757cdda3b43861ae/limereport/lrdatasourcemanager.cpp#L1020

and if (!QSqlDatabase::contains(replaceVariables(connectionDesc->name())))

https://github.com/fralx/LimeReport/blob/f73342dc20414bb1ef97b396757cdda3b43861ae/limereport/lrdatasourcemanager.cpp#L977