I am using the trial version. Based on your excellent previous assistance, I have created a report using an existing database and have successfully using a batch file with a command line to generate the report in PDF format and save it to a folder on the server.
Now I want to run the same report against a different database on the same server that has the same tables/views as the first one. In other words, I have a single report that I want to run against multiple databases, each with the same structure as the others. I tried copying the batch file and changing the connection string in it to use the second database. When I run it, the report is produced but it contains the data from the first database, i.e., specifying a different connection string in the batch file seems to have no impact. What am I doing incorrectly? Or is this scenario not possible? I would prefer to have only one report design that by changing the connection string in the batch file would allow the report to be used across all databases containing that same table.
Switching Connections
Re: Switching Connections
You can use the same .dcomp file and specify a new source or target as follows:
Please note that the /source and /target switches have higher priority than the Source and Target databases that were specified when saving a .dcomp file, so they will be just overridden.
If you are still unable to resolve the issue, could you please provide us the batch file before and after changes so we can provide you with further instructions?
Code: Select all
dbforgemysql.com /datacompare /compfile:"my.dcomp" /source...... /target....
If you are still unable to resolve the issue, could you please provide us the batch file before and after changes so we can provide you with further instructions?
Re: Switching Connections
I am not sure what datacompare has to do with what I am attempting. Here is the one line contained in my am.bat file, which I am using to attempt to change the connection associated with my designed report:
dbforgemysql /datareport /reportfile:"c:\users\glenn\my documents\dbforge studio for mysql\activemembers.rdb" /format:PDF /result folder:"c:\users\glenn\my documents\dbforge studio for mysql\reports\output\" /connection:gbyerly_lcc.www.foscms.com
When I run the report using that batch file, the result is the same as when I use the connection: gbyerly_lhm.www.foscms.com, which is the dataconnection used when I designed the report. I also tried typing in the connection string directly, rather than using the name from within dbForge, but the result was the same, i.e., the report displayed data from the previously used database, rather than the one associated with the new connection string.
dbforgemysql /datareport /reportfile:"c:\users\glenn\my documents\dbforge studio for mysql\activemembers.rdb" /format:PDF /result folder:"c:\users\glenn\my documents\dbforge studio for mysql\reports\output\" /connection:gbyerly_lcc.www.foscms.com
When I run the report using that batch file, the result is the same as when I use the connection: gbyerly_lhm.www.foscms.com, which is the dataconnection used when I designed the report. I also tried typing in the connection string directly, rather than using the name from within dbForge, but the result was the same, i.e., the report displayed data from the previously used database, rather than the one associated with the new connection string.
Re: Switching Connections
Before creating a data report, please make sure a default database is specified for the connection (right-click the connection and select 'Modify Connection...' from the main menu, then specify a default database in the 'Database' field of the 'Database Connection Properties' dialog box).
When creating a data report, you have to check that you specify a custom query and don't specify a database name with object names.
Once the *.rdb file is generated, you need to create a new connection and specify another database (that you want to be used for generating a new data report) as a default database for the new connection.
The new command line string should include a connection string and a password for the new server. A connection string can be obtained by right-clicking a connection and selecting 'Properties' from the popup menu.
Here is an example:
When creating a data report, you have to check that you specify a custom query and don't specify a database name with object names.
Once the *.rdb file is generated, you need to create a new connection and specify another database (that you want to be used for generating a new data report) as a default database for the new connection.
The new command line string should include a connection string and a password for the new server. A connection string can be obtained by right-clicking a connection and selecting 'Properties' from the popup menu.
Here is an example:
Please let us know if you succeed on this.dbforgemysql /datareport /reportfile:"c:\users\glenn\my documents\dbforge studio for mysql\activemembers.rdb" /format:PDF /result folder:"c:\users\glenn\my documents\dbforge studio for mysql\reports\output\" /connection:"User Id=root;Host=gbyerly_lcc.www.foscms.com;Port=3310;Database=new_default_database;Character Set=utf8" /password:"mypassword"