Board index » delphi » can't print record I want printed

can't print record I want printed

Hi all---

D4
Paradox 7

I am trying to print one record at a time using QReport, it's built-in
Printer Setup and Print buttons.

My table record is using Autoincrement as it's primary key.  One
drawback to using Autoincrement is that when you delete a record from
the table, the number/index/primary key is also deleted and not
replaced.  So when you have 10 records, and you delete  item number 8,
you'll have 9 records, and the record numbers will be 1, 2, 3, 4, 5, 6,
7, 9, 10.
WHen you add a new record, it will be item number 11. However, now your
total record is 10.

So my problem is when I want to print item number 9, I can't tell lthe
printer setup to print 9 to 9, I have to say record 8 to 8, because now,
9 is considered record number 8.  I hope this is not confusing.

So how can I make it easier for the users who aren't aware of this?  I
have about 600 records and have deleted some during the making of the
application.  So my primary key is at 638, although I only have 622
records.  Of course, when I want to printe item 638 (last record), I
have to tell the printer setup to print record 622.

Any input on this is much appreciated.  I know you all know how the
autoinc works but I just needed to get if off my system :)

What I was trying to do as an alternative was to scroll to the record I
want to print, hit the qreport, then print, but record number 1 is
always the one that's being printed.

Thanks in advance,
maria

 

Re:can't print record I want printed


Quote
On Wed, 09 May 2001 10:45:35 -1000, maria <ma...@gem.com> wrote:
>What I was trying to do as an alternative was to scroll to the record I
>want to print, hit the qreport, then print, but record number 1 is
>always the one that's being printed.

Clear the "DataSet" property of the report.   It will then print the
current record only.

regards
Colin Acheson

Re:can't print record I want printed


Hi there---

I did what you suggested, but it still prints just the first record.
I cleared the dataset property of the report, result was record 1 was still
being printed.

Cleared the dataset properties of each QRDBText, nothing was printed at all.

How do you call the print command after clearing that dataset?  Maybe this
is where the problem lies.  .print or currentrecord.print or something?

TIA,
maria

Quote
" (Colin Acheson)" wrote:
> On Wed, 09 May 2001 10:45:35 -1000, maria <ma...@gem.com> wrote:

> >What I was trying to do as an alternative was to scroll to the record I
> >want to print, hit the qreport, then print, but record number 1 is
> >always the one that's being printed.

> Clear the "DataSet" property of the report.   It will then print the
> current record only.

> regards
> Colin Acheson

Re:can't print record I want printed


Hi Maria,
What Colin  meant was to clear the Dataset property of the
TQuickRep itself. Keep all your QRDbText components pointing
to the appropriate Dataset and Datafield ...
before printing locate to the record of the Dataset manually
and all the QRDbText controls will print only the current
record field contents ...
hope this helps ..
regards
angshu

Quote
"maria" <ma...@gem.com> wrote in message

news:3AF9BD9F.B731A433@gem.com...
Quote

> Hi there---

> I did what you suggested, but it still prints just the
first record.
> I cleared the dataset property of the report, result was
record 1 was still
> being printed.

> Cleared the dataset properties of each QRDBText, nothing
was printed at all.

> How do you call the print command after clearing that

dataset?  Maybe this
Quote
> is where the problem lies.  .print or currentrecord.print
or something?

> TIA,
> maria

> " (Colin Acheson)" wrote:

> > On Wed, 09 May 2001 10:45:35 -1000, maria
<ma...@gem.com> wrote:

> > >What I was trying to do as an alternative was to scroll
to the record I
> > >want to print, hit the qreport, then print, but record
number 1 is
> > >always the one that's being printed.

> > Clear the "DataSet" property of the report.   It will
then print the
> > current record only.

> > regards
> > Colin Acheson

Re:can't print record I want printed


Hi there---

I am still confused.  I cleared the dataset property of the QuickRep
itself. I even cleared the Datasource's dataset property, but still,
when I print, it only prints the first record.
Note that I am printing from the preview window of the quickrep form.

When I go to the QuickRep.preview, try to scroll to the next record, it
seems that there are no other records except the first record.

By the way, what do you mean when you say "before printing locate to the
record of the Dataset manually and all the QRDText controls will print
only the current record field contents"?

TIA,
maria

Quote
angshu wrote:
> Hi Maria,
> What Colin  meant was to clear the Dataset property of the
> TQuickRep itself. Keep all your QRDbText components pointing
> to the appropriate Dataset and Datafield ...
> before printing locate to the record of the Dataset manually
> and all the QRDbText controls will print only the current
> record field contents ...
> hope this helps ..
> regards
> angshu

> "maria" <ma...@gem.com> wrote in message
> news:3AF9BD9F.B731A433@gem.com...

> > Hi there---

> > I did what you suggested, but it still prints just the
> first record.
> > I cleared the dataset property of the report, result was
> record 1 was still
> > being printed.

> > Cleared the dataset properties of each QRDBText, nothing
> was printed at all.

> > How do you call the print command after clearing that
> dataset?  Maybe this
> > is where the problem lies.  .print or currentrecord.print
> or something?

> > TIA,
> > maria

> > " (Colin Acheson)" wrote:

> > > On Wed, 09 May 2001 10:45:35 -1000, maria
> <ma...@gem.com> wrote:

> > > >What I was trying to do as an alternative was to scroll
> to the record I
> > > >want to print, hit the qreport, then print, but record
> number 1 is
> > > >always the one that's being printed.

> > > Clear the "DataSet" property of the report.   It will
> then print the
> > > current record only.

> > > regards
> > > Colin Acheson

Re:can't print record I want printed


Quote
> I am still confused.  I cleared the dataset property of
the QuickRep
> itself. I even cleared the Datasource's dataset property,

This isnt required .. just clear the Dataset Property of the
Quuickrep but keep the Dataset and Datafield properties of
the QRDBTexts intact ..

Quote
> By the way, what do you mean when you say "before printing
locate to the
> record of the Dataset manually and all the QRDText
controls will print
> only the current record field contents"?

I meant to locate to the desired record manually .. like
query1.locate(FIELDNAME, FIELDVALUE,[])

.. if u set the Dataset prperty of the quickrep .. quickrep
will scroll from the BOF to EOF of the dataset by itself
which is something u dont want here //

Hope this helps ..
regards/angshu

Other Threads