Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-01

LazReport & Database

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Koenraad Lelong

Hi,

I was wondering if I found a bug in LazReport.
Like always, I put my database-components in a datamodule. Then I placed a frReport on a visible form. I started editing the report and I tried to place some database-fields on the report. Unfortunately, there were no fields available to place.

After experimenting for some time I found I had to place the dataset (or query) on the same form as the report. Then I can place database-fields on the report.

This is didn't try this an error or is this expected behaviour ?

Regards,

Koenraad Lelong.

Reply by email

Chris Kelling
Koenraad Lelong wrote 8 lines
Like always, I put my database-components in a datamodule. Then I placed a frReport on a visible form. I started editing the report and I tried to place some database-fields on the report. Unfortunately, there were no fields available to place. After experimenting for some time I found I had to place the dataset (or query) on the same form as the report. Then I can place database-fields on the report.

Is the unit you are defining the data module with in the USES statement of your form?

-Chris

Reply by email

Koenraad Lelong
to Chris Kelling
Chris Kelling wrote

...

Show quoted text 7 lines
Is the unit you are defining the data module with in the USES statement of your form? -Chris

Hi Chris,

Yes, the datamodule is in the uses-list of the form. I had a working TDBGrid using the same query on that form when I tried this.

Thanks anyway.

Koenraad Lelong.

Reply by email

Mattias Gaertner
to Koenraad Lelong
Show quoted text 14 lines
On 05-01-12 16:18, Chris Kelling wrote: > ... > > Is the unit you are defining the data module with in the USES statement > of your form? > > > -Chris > Hi Chris, Yes, the datamodule is in the uses-list of the form. I had a working TDBGrid using the same query on that form when I tried this.

Can you create a small example and a bug report?

Mattias

Reply by email

Koenraad Lelong
to Koenraad Lelong
Koenraad Lelong wrote 11 lines
On 05-01-12 18:07, Mattias Gaertner wrote: > > Can you create a small example and a bug report? > > Mattias > http://bugs.freepascal.org/view.php?id=21050 Koenraad

Hi,

With a new project, last week I tried to do this again. First with Lazarus 1.08, today with Lazarus 1.2 (downloaded and installed this morning). Still the same problem.
I looked in the bugtracker. There is a request for a new sample-project. Unfortunately I lost my password and the email-address is not valid anymore. The bugtracker states :

You need to first link TfrDBDataSet to a TDbf (which could be in a TDatamodule) and then link the TfrDBDataSet to the TfrReport via the Dataset property.

When you use the query on the same form as the report, this is *not* needed. And adding a TfrDBDataSet and connecting it to the query on the datamodule does not work.

FWIW, I'm running WinXP.
I do have a new project with the mentioned TfrDBDataSet. Can I upload it here ?

Koenraad.

Reply by email

Jesus Reyes
to Koenraad Lelong
Show quoted text 16 lines
With a new project, last week I tried to do this again. First with? Lazarus 1.08, today with Lazarus 1.2 (downloaded and installed this morning). Still the same problem. I looked in the bugtracker. There is a request for a new sample-project. Unfortunately I lost my password and the email-address is not valid anymore. The bugtracker states : > You need to first link TfrDBDataSet to a TDbf (which could be in a TDatamodule) and then link the TfrDBDataSet to the TfrReport via the Dataset property. When you use the query on the same form as the report, this is *not* needed. And adding a TfrDBDataSet and connecting it to the query on the datamodule does not work.

In your report you wrote that setting up the connection in code works, that means it's a problem at runtime, the response in note 72299 address the problem in that case, and as it written it works if you link TfrDbDataset etc.?

But now things are clearer as you say the problem is at design time, and yes, the issue can be reproduced. The problem here is LazReport (in form1) can't get an instance to Datamodule1.Dbf1 at Lazarus design time. At design time, the object inspector knows how to get an instance to a component residing in a external form/datamodule but LazReport designer at Lazarus design time doesn't know.

This is basically to Mattias, is it possible to register at design time data modules so they appear in FindGlobalComponentList? any other solution?

Jesus Reyes A.

Reply by email

Mattias Gaertner
to Jesus Reyes
[...] But now things are clearer as you say the problem is at design time, and yes, the issue can be reproduced. The problem here is LazReport (in form1) can't get an instance to Datamodule1.Dbf1 at Lazarus design time. At design time, the object inspector knows how to get an instance to a component residing in a external form/datamodule but LazReport designer at Lazarus design time doesn't know. This is basically to Mattias, is it possible to register at design time data modules so they appear in FindGlobalComponentList? any other solution?

FindGlobalComponentList is for the currently running application - the IDE itself.

Properties in the OI use the property editors. A TComponent property uses the TComponentPropertyEditor, which allows to select type compatible components from any open designer form including datamodules.

What property does not work?
Is this a problem in the OI or in LazReport?

Mattias

Reply by email

Jesus Reyes
to Mattias Gaertner
Show quoted text 18 lines
Jesus Reyes wrote: > This is basically to Mattias, is it possible to register at design time data modules so they appear in FindGlobalComponentList? any other solution? FindGlobalComponentList is for the currently running application - the IDE itself. Properties in the OI use the property editors. A TComponent property uses the TComponentPropertyEditor, which allows to select type compatible components from any open designer form including datamodules. What property does not work? Is this a problem in the OI or in LazReport? Mattias

Was a problem in LazReport, is now fixed, thanks.

Jesus Reyes A.

Reply by email