Link to home
Start Free TrialLog in
Avatar of mokule
mokuleFlag for Poland

asked on

QuickReport Problem

Hi,
I've got a project written in Delphi 5.
I've got a problem with TQRExpr fields when opened this project in Delphi 7.
When I try to use Expression Wizard, the Select Dataset listbox is empty.
What is the reason and how to solve it?

mokule
Avatar of Ashok
Ashok
Flag of United States of America image

I have use QuickReports may times, but not recently.
Can you try this?

Create new project, drop Quickreport, and use TQRExpr.
In Expression Wizard try to Select Dataset....

Ashok
Avatar of mokule

ASKER

But the problem is that my Datasets located in DataModule are not visible. The Select dataset list box is empty.
When i place some dataset on the same form as report it is visible in this listbox.
But I want to have datasets in data module
mokule
implementation

uses Unit2;   // replace Unit2 with name of your Data Module unit name here....

 mokule,

Do you have your data module unit name in implementation of your QuickReport form?

Ashok
Avatar of mokule

ASKER

Yes, I've got this declaration
Datasets are visible for TQRDBText but not for TQRExpr.
Have You got Delphi 7? Can You try the solutions You suggest?
mokule
Here at work, we have Delphi 7, but QuickReport components are not installed.

When I go home, I will try to fix the problem.

Ashok
Avatar of mokule

ASKER

It has nothing to do with my problem
by reading the article, it seems to me that you
do not have to specify Datset for TQRExpr.

Only specify Dataset for TQuickRep component.

I have to try this at home.

Ashok
Never mind my previous post.

Ashok
Avatar of BlackTigerX
BlackTigerX

you do have a dataset (ADOTable, ADOQuery, etc) on your form or in a datamodule, which is in the uses clause (after Interface)
right?
Avatar of mokule

ASKER

Yes,
I have datasets (ADOTable, ADOQuery, etc) in a datamodule, which is in the uses clause.
I've tried after Interface and implementation with no success.

I'll be grateful for any example using TQREpr with Dataset from other units, in Delphi7

Anybody using QuickReport in D7?

mokule
SOLUTION
Avatar of Ashok
Ashok
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mokule

ASKER

Missed shot :(
At least it did not cost anything for trying, right?

Ashok
Avatar of mokule

ASKER

Not quite, it costs time.
At the moment I think that I resign from using TQRExpr.
I must do the same using ADOQuery, though it costs me quite a lot of work.
Seems there is no choice :(
mokule
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
another workaround if you must (not using qrexpr) is to simply use a TQRLabel, and use the band's "beforeprint" event to populate the label.  e.g.  qrlabel1.caption := unit3.table1PRODUCTNAME.AsString;
if it's any consolation, I know there is a way to do QRExpr
does the quickreport have a "datamodule" (no.. not dataset)  property or something?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can u not simple type in (instead of select from a combo) like

datamodule1.adoquery1

?

(currently no delphi on hand)
Avatar of mokule

ASKER

to kretzschmar
  unfortunately it doesn't work

to calinutz
  by Your method I can use expressions with fields from only 1 dataset in a report , am i right?

mokule
mokule

If you give more detail about "what is your expression string?", someone can better help you.
I have never had to use QRExpr so I did not have any problem.

Whatever you are trying to do can be achieved by just using QRLabel.

Just like TheRealLoki suggested.

Have you tried  Jacco solution if you want to use QRExpr ?  (which is trying to use Datamodule at runtime)

Ashok
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mokule

ASKER

to cula99

can You be so kind and supply an example, what should I write in an Expression?
Suppose my datamodule is DM1 my table is atFirma and fields fir_nazwa1, fir_nazwa2
condition: atFirma IS NOT TQuickRep DataSet

I've tried
Expression := atFirma.fir_nazwa1+atFirma.fir_nazwa2;
or
Expression := DM1.atFirma.fir_nazwa1+DM1.atFirma.fir_nazwa2;

result Unknown function atFirma.fir_nazwa1 or Unknown function DM1.atFirma.fir_nazwa1

mokule

This is when atFirma IS TQuickRep DataSet

QuickReport1.DataSet := DM1.atFirma;

QRExpr1.Expression := atFirma.fir_nazwa1+atFirma.fir_nazwa2;

but if not try to use CompositeReport where will you assign atFirma to TQuickRep2.DataSet and join it with first

Čula
Avatar of mokule

ASKER

This not what I've expected, but thanks for Your efforts.

mokule