Solved

Report Builder

Posted on 2004-08-09
7
1,113 Views
Last Modified: 2010-04-16
hello,
example:-
before display a report, a user may want to use some of the report filters like Sort by, Date, etc...

my question:-
if the user wants to sort the records according to the customer_id, how can i display a sentence "Sort By : Customer ID" in the report? or if the user wants to sort by customer_name the report also should display a sentence "Sort By : Customer Name"

I tried the "Variable" component in the report builder, but i failed the make it, may be i don't really know how to use that component....can any experts give me some guideline?

Thanks
josh
0
Comment
Question by:joshfly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 5

Expert Comment

by:Darth_helge
ID: 11760066
If you read the manual, you find out that you can add the rbprvDlg unit into your project. This unit contains the Report Preview window which you can manipulate. Then you can just add some buttons on the top panel on the form which manipulates your SQL Queries. Did you understand?
0
 
LVL 5

Expert Comment

by:Darth_helge
ID: 11760107
mine is located at C:\Program files\Borland\Delphi7\RBuilder\Tutorials\Complete\II. Applications\01. Reporting\rbPrvDlg.pas

just copy this into your project catalog, then add it to your project. Then you can manipulate the preview window just the way you want
0
 
LVL 5

Accepted Solution

by:
Darth_helge earned 45 total points
ID: 11760150
I didn't read your question good enough i think. You say filter BEFORE the display of a report? Here's what I do.

Drop these components at the form
type
  TForm1 = class(TForm)
    ppDBPipeline1: TppDBPipeline;
    ppReport1: TppReport;
    ADOConnection1: TADOConnection;
    ADOQuery1: TADOQuery;
    DataSource1: TDataSource;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

Get your ADOConnection right.
Connect your AdoQuery to the AdoConnection.
Write your SQL query in the SQL property of the ADOQuery. like 'select * from MyTable'
Connect The DataSource1 to the AdoConnection.
Connect The ppDBPipeline to the DataSource1.
Connect The ppReport1 to the ppDBPipeline.

As you can see I have two buttons here. The buttons sort by different columns from your table. The jyst add some text to the SQL Query you have written in the SQL property of the ADOQuery1.
Like This:

procedure TForm1.Button1Click(Sender: TObject);
begin
ADOQuery1.SQL.Text := ADOQuery1.SQL.Text + ' Order by MyColumn1';
ADOQuery1.Active := true;
ppreport1.Print;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ADOQuery1.SQL.Text := ADOQuery1.SQL.Text + ' Order by MyColumn2';
ADOQuery1.Active := true;
ppreport1.Print;
end;
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:joshfly
ID: 11768925
sorry, i mean i wants to display the sentence "Sort By : MyColumn_Name" in the report, the way you said just order the records. I want to display the report's filter in the report which the user had selected. can i?

Example :
if the user wants to sort the records according to the customer_id, how can i display a sentence "Sort By : Customer ID" in the report

Thank you
you sure will gain this points from me Darth_helge after solve this problem

josh ;)
0
 

Author Comment

by:joshfly
ID: 11769214
well..haha
i got the solution by myself already...
anyway thanks for your reply for my post...
i still award this points for you, im really appreciate for who spent their valuable time to slove my problem....thanks again Darth_helge

:)
josh
0
 
LVL 5

Expert Comment

by:Darth_helge
ID: 11770149
thanx. I guess I didn't understand your question good enough. what did you do then?
0
 

Author Comment

by:joshfly
ID: 11789871
oh...sorry for late reply..
it's easy, simply just rename the pplabel.caption only using coding.

:)
josh
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 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