Solved

need a qreport expert urgently

Posted on 2001-08-11
12
261 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now