Solved

need a qreport expert urgently

Posted on 2001-08-11
12
271 Views
Last Modified: 2010-04-06
Hi experts, I need some one who is an expert in qreport, what I need to do is how can I have the qreport arrange my report in month order: example if I were to select from my program from jan 99 to dec 99, I want it to show all of the details from the database(paradox) in months
eg.
    05/01/99  abc
    27/01/99  fff
--------
    02/02/99  def
    05/02/99  gjkfd
--------
    31/03/99  ddd
---------
    01/12/99  dfff
    12/12/99  hjlkfd

is there anyway that I could do this ???
your earliest help will be very much appreciated
0
Comment
Question by:vpr_ali
  • 9
  • 3
12 Comments
 

Author Comment

by:vpr_ali
ID: 6375316
oh I forgot mention that user must be able to customise the from to date... if qreport is too troublesome is there any other way ???
thanks
0
 

Author Comment

by:vpr_ali
ID: 6375323
oh I forgot mention that user must be able to customise the from to date... if qreport is too troublesome is there any other way ???
thanks
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6375325
Hi vpr_ali,

do you mean that you need separator line between different monthes?
And how do you plan to allow users customize period? Is it should be specail TForm to select period?

------
Igor
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:vpr_ali
ID: 6375345
how do user customise is they select the month "from to" edit box from the TForm1 and when they press process, the qreport should be able to show all the data from the months selected separated by months...
by the way the database tables in paradox is done in this way :
DebtorID, Year, Month, Amount

I want to to be able to select from to month from a particular year at it should show all records from that the selected date.
0
 

Author Comment

by:vpr_ali
ID: 6375348
and yes I do need the months to be separated

thanks
vpr_ali
0
 

Author Comment

by:vpr_ali
ID: 6375351
and yes I do need the months to be separated

thanks
vpr_ali
0
 

Author Comment

by:vpr_ali
ID: 6375353
what's wrong with ee today ??? keep posting my msg twice...
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6375362
Hi vpr_ali,

let suppose you have two editboxes "EFrom" and "ETo" and one editbox "EYear".

your Query1.SQL statement would be:

select * from TheTable
where Year = :y
and Month >= :mf
and Month <= :mt
order by Month

once user pressed "process" you need to assign parameters to Query1:

ReportName.Query1.ParamByName('y').AsString := EYear.Text;
ReportName.Query1.ParamByName('mf').AsString := EFrom.Text;
ReportName.Query1.ParamByName('mt').AsString := ETo.Text;


Next step is about QuickReport.
Drop TQRGroup there and set "Expression" property = "Month", then drop normal details band. In group header you can show  current month, in detail band rest of details.

------
Igor.

PS: About EE today. Do not press  "reload" button just after you post some message :-)
0
 

Author Comment

by:vpr_ali
ID: 6376821
ITugay, I had some changes in the db structure, what it actually is to sort by the date in the date format eg. from : 01/01/1999  to 12/31/1999 (month day year)
and it works if I were to do this:

select *
from Orders
where OrderDate >= '01/31/1999'
and OrderDate <= '12/31/1999'
order by OrderDate;

but not when I do this:

select *
from Orders
where OrderDate >= :dt
and OrderDate <= :df
order by OrderDate;

which I wanted so that user could select their own date selection

I keep have this error message when I try to set the SqlQuery to active:
'Type mismatch in expression'

btw this this is the code:

  SystemData.Query1.ParamByName('df').AsString := DFrom.Text;

  SystemData.Query1.ParamByName('dt').AsString := DTo.Text;

where DFrom.Text := '01/01/1999'
and DTo.Text     := '12/31/1999'

is there anyway that I could have them by day month year format ???

if you don't mind, could you please reply me on my e-mail vpr_ali@hotmail.com so that I could give you the source code...

---
vpr_ali




0
 

Author Comment

by:vpr_ali
ID: 6376826
oops correction on the sql command:

select *
from Orders
where OrderDate >= :df
and OrderDate <= :dt
order by OrderDate;
0
 

Author Comment

by:vpr_ali
ID: 6376844
ITugay, I manage to sort it out, it was actually not:
Query1.ParamByName,
but it works with :
Query1.Params[0].Value := DFrom.Text;

anyway, I had to rush at the moment, I will finalise this question before I assign the points as yet, (I still have another questions on QReport)

thanks for your help

--
vpr_ali
0
 
LVL 9

Accepted Solution

by:
ITugay earned 100 total points
ID: 6376918
hi,

Delphi help:

TQuery.ParamByName
.....
Call ParamByName to set or use parameter information for a specific parameter based on its name.

Value is the name of the parameter for which to retrieve information.

ParamByName is primarily used to set an parameter?s value at runtime. For example, the following statement retrieves the current value of a parameter called ?Contact? into an edit box:

Edit1.Text := Query1.ParamByName('Contact').AsString;
.....

you can send me source code to "igor@ns.kz"
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connection between libmysql.dll and MySQL Versions 7 97
When I am typing into a TEdit last word repeats 7 132
Performance of SQL statement 37 111
Base1 Encode/Decode 3 77
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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