Subject |
Re: report |
From |
Akshat Kapoor <akshat.kapoor@kapoorsons.in> |
Date |
Fri, 7 Feb 2025 15:55:42 +0530 |
Newsgroups |
dbase.getting-started |
Good Evening Charlie,
> I have a report that id like to use with a different database but the same tables. (located in the different database. I tried changing in the source code by changing the database name and database reference in the tables. Did not work. Started to cut the old tables but that screwed everything up. Is there an easy way to do this or do I have to bite the bullet and make the report from scratch? Thanks much.
Mervyn has already outlined a way. My current way is slightly different.
I use datamodules.
class inveDATAMODULE of DATAMODULE
this.VATRATE = new ADOQUERY(this)
with (this.VATRATE)
database = mcompany.adodb
sql = 'select recno,tax,vat,sat from vatrate'
requestlive = false
active = true
endwith
Part of the dmd code is pasted above.
mcompany.adodb is a database object points to different database at
different times (as per user requirement ).
It has been initialised much earlier in the program.
The only issue with this is datamodule can never be opened in designer.
I code it in editor and then drag and drop in the report.Since queries
are not edited frequently so this is not an issue.
Reports can be designed in designer without any hassle.
In the form do xyz.rep is all that is required.
At times setting parameters for query/requery() are the additional steps
(like setting the date)
or
Setting the printer properties are involved. But those steps do not
cause problems.
Regards
Akshat
On a side note.
If you send the report and blank table can try to remove database reference.
|
|