Solved

Quick report

Posted on 2002-03-12
2
151 Views
Last Modified: 2010-04-05
I want to create a report using a query whose SQL property will be specified at runtime. What should i specify in the datafield properties of the qrdbtext fields at design time. Or should I assign the properties at runtime, and if so, how do I link the data fields and the query fields?
0
Comment
Question by:gi7mhl
2 Comments
 
LVL 3

Accepted Solution

by:
marcoszorrilla earned 100 total points
ID: 6856291
If you know the name of the fields that will be used but not the condition Where.

You create a persistent fields clicking right button over the Tquery componenent and then Add All fields, now you connect the QuickReport with the query and all the fields are availables.(The Query will be Active = True) for this purpose.

The Tquery component must have text in the strings property for example:
Select MyField1, Myfield2...
From MyTable;


In order to have the fields for your report.

Then this string will be override after your Where condition.

something like this:
Tquery1.Sql.Clear;
Tquery1.Sql.Add('Select x,x,x,x where xxxx from xxxx');
Tqyery1.Open;

cheers.
0
 

Author Comment

by:gi7mhl
ID: 6864562
Hi marcoszorrilla
In my query's sql statement i want to include the 'sum' function, together with other fields, The sum is from a seperate table from the table with the other fields. But I am getting the error "You tried to execute a query that does not include the expression 'field name' as part of an aggregate function" where field name is one of the fields, when i try to add the fields in the query's fields editor. Please help
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question