Printing from DBGrid

Printing from DBGrid in Delphi Single User Apps topic (part of our Pascal and Delphi Coding group).
Quick Search:
Printing
Printing DBGrid
|
|
Mido
|
Hi all, I have two forms .... the first one I used ADOQuery to search the Table and put the result in the DBGrid at the same form, when I press the button I should see the result of searching in the second form in the QReport . any Idea ???? Thanx
|
Posted 20 years ago (Thread Starter)
|
|
About Mido |
|
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #1710, 4 reply
Thread Started 4/10/2001 9:08:00 PM
View Counter=2113
Last Reply Posted 1/7/2021 11:45:55 PM)
|
|
|
Location=-- USA
|
|
 |
|
Mido
|
Dear Sir,
Thanx for your reply , but I didn't got what you said .. infact I didn't know how to do it and where should I write it, so could you please exaplaine more. Thanx again
Regards
|
Posted 20 years ago (Thread Starter)
|
|
About Mido |
|
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #1745 (Level 1.1)
Reply to 1710
Thread Started 4/15/2001 8:09:00 PM
View Counter=2
|
|
|
Location=-- USA
|
|
 |
|
Scott Wehrly
Prestwood IT
(Inactive)
Las Vegas, NV USA
|
Well, here's a simple question.
Is the QReport on the second form linked to a TDataSource that points to the ADOQuery on the first form? Perhaps that's the problem.
This ususally trips folks up the first time they try it. Be sure that the uses section of the QReport form includes the form with the ADOQuery on it.
In the DataSource's DataSet attribute, the ADOQuery may not show up in the drop-down list, but you can type in the reference as a member of the first form, like in this example:
Unit QForm; ... MyQuery : TADOQuery; ... Unit ReportForm; ... RptSource : TDataSource; ...
RptSource.DataSet := QForm.MyQuery;
|
Posted 20 years ago
|
|
About Scott Wehrly |
|
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #1714 (Level 1.2)
Reply to 1710
Reply Posted 4/11/2001 4:15:00 AM
|
|
|
Location=Las Vegas, NV USA
|
|
 |
|
Scott Wehrly
Prestwood IT
(Inactive)
Las Vegas, NV USA
|
O-o-o-k-a-a-a-y-y... Well, I can't know what your unit names or component names are, so I have to just provide a generic example to demonstrate what I meant. I see now in the code example I showed above that I didn't make it clear enough (and I got the RptSource wrong...). Let me break it down better. I can't do screen shots in this forum, so you'll have to do with lines of code. __________________________________________________Let's take the one form with the TADOQuery, and the DBGrid. I think it would look something like this: Unit QForm; type TMyQForm = class(TForm) MyQuery : TADOQuery; MySource : TDataSource; MyGrid : TDBGrid; ... (other components)with attribute settings that probably look something like this: MySource.DataSet = MyQuery MyGrid.DataSource = MySource MyQuery.Active = TrueOkay? This is something like what you should already have on the first form. __________________________________________________Now, about the second form. Here's a guess at what should be there: Unit ReportForm; type TRptForm = class(TForm) MyReport : TQuickRep;Okay...mea culpa. Here's where I screwed up.The QuickReport has a DataSet attribute. Since the TADOQuery doesn't sit on this form, you have to qualify the name using the name of the unit it resides in. In the DataSet attribute of the TQuickRep (MyReport), you type: QForm.MyQueryIn code, this would be typed as: MyReport.DataSet := QForm.MyQueryIf the TADOQuery is Active, or you used the Fields Editor to populate the form with TField components for the TADOQuery, you should be able to select DataField components for all of the QuickReport's Database variables. For instance, let's say that you have a TQRDBText component on the QuickReport labeled as " First Name". And let's say that the TADOQuery includes a FirstName field, assigned to a TStringField component named MyQueryFirstName. In code, you would assign the QuickReport's Database field to the TADOQuery's corresponding field like this: QRDBFirstName.Data:= QForm.MyQueryFirstName__________________________________________________I hope that this is enough.
|
Posted 20 years ago
|
|
About Scott Wehrly |
|
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #1749 (Level 1.3)
Reply to 1710
Reply Posted 4/16/2001 5:15:00 AM
|
|
|
Location=Las Vegas, NV USA
|
|
| |
Most Recent Post
|
PS_3278
|
It is hard to understand how these searches and the backend of a server is working. You can use samedayessay to draw out the relations of different things. Since you use technology then you make your jobs easier.
|
Posted 49 days ago
|
|
About PS_3278 |
|
Membership pending.
Member subscribes to this thread with a verified email.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #18335 (Level 2)
and Parent is 1710
Reply Posted 1/7/2021 11:45:29 PM
|
|
|
Location=-- --
|
|
Thread #1710 Counter |
2113 |
Since 4/2/2008
|
|
|