?
Solved

TDBGrid and Multiselect with Quickreport

Posted on 1997-03-13
5
Medium Priority
?
406 Views
Last Modified: 2013-11-22
I have a TDBGrid with some data fields in it. Then I set the multiselect option to true in order to be able to choose several fields in the grid. And now, I want to tell QuickReport that he has to print a report I've previously created taking the data from the fields i have selected in the grid. How can I do that?
For Example: I have a grid with customers and I select 3 customers and I want my report (that prints the personal information of a customer) to print the information of only those 3 customers I have selected.
0
Comment
Question by:sime
[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
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:javiertb
ID: 1334749
You should copy those selected records to another table attached to a datasource so you can switch quickreport to connect this datasource to print them.
Hope this helps.
0
 

Author Comment

by:sime
ID: 1334750
But, how can I know which records I have selected in the grid ?
0
 
LVL 2

Accepted Solution

by:
javiertb earned 200 total points
ID: 1334751
You can browse the rows checking for selected ones with:

   if DBGrid.SelectedRows.CurrentRowSelected then
        // Some code here. i.e.:copy to your temp. table

0
 

Author Comment

by:sime
ID: 1334752
Hi, I have tried what you told me and it haven't resolved my problem yet. Please write me down what I have to write (source code) to copy one by one the records I have selected in the DBGrid, because with CurrentRowSelected I only get then Current Record and I want them all (I can't find any help about this feature). Thanks very much.
0
 
LVL 2

Expert Comment

by:javiertb
ID: 1334753
- Suppose you have 3 selected records.

 Table.Open;
 Table.First;
 while (not Table.EOF) do
 begin
    if DBGrid.SelectedRows.CurrentRowSelected then
      // copy to your temp table
      // i.e.: TableTemp.Append;
      //       TableTempField1.Value:=Table1Field1.Value;
      //       TableTemp.Post;  
    Table.Next;
 end

You can also use bookmarks to avoid losing previous database pointer.


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 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