Board index » delphi » QR Reporting using data in a Structure (record)

QR Reporting using data in a Structure (record)

I am having problems creating a report in Quick Report. I have data in a
record (structure) that needs to be printed on a report. I have created
a report with a string band. I have placed QEXpr objects on the band to
handle the strings from the records structure. The data is all strings.

What is the best approach for reporting the data in the structure using
QR? Should I use a detail band instead of the string band? Should I use
QRLabels to display the text from the report?

Thank You,

Michael Townsend
michael.a.towns...@saic.com

--
MZ

 

Re:QR Reporting using data in a Structure (record)


On Thu, 02 Sep 1999 15:00:18 -0400, Michael townsend

Quote
<michael.a.towns...@cpmx.saic.com> wrote:
>I am having problems creating a report in Quick Report. I have data in a
>record (structure) that needs to be printed on a report. I have created
>a report with a string band. I have placed QEXpr objects on the band to
>handle the strings from the records structure. The data is all strings.

>What is the best approach for reporting the data in the structure using
>QR? Should I use a detail band instead of the string band? Should I use
>QRLabels to display the text from the report?

>Thank You,

>Michael Townsend
>michael.a.towns...@saic.com

>--
>MZ

Based on your question, I assume you will be printing from a
non-database situation and that you are printing only 1 record, not a
list of them. If that's wrong, please let me know since the answer
will have to be modified a bit.

First, make sure you set the property to True which controls
PrintIfEmpty. You'll not be hooking up the QuickReport component
itself to a database so nothing will print without the above.
Regarding what type of band, if you're printing only 1 page, it
doesn't really matter. You can just use a big title band to cover the
page and put QRLabels on it. You can set the value with code in each
component's OnPrint handler.

If you will be printing more than one data structure, then you'll have
to put code in the report's OnNeedData event to let it know when you
have run out of data.

Steve F (Team B)

Re:QR Reporting using data in a Structure (record)


Steve,
I am printing from a non-database situation (Delphi record/structure ) and I
am printing multiple records. I have put QRLabels
on a detail band. I am looping through the structure assigning the values of
the record cells to the text property of the QRLabels. Only the last record
is printing. See the brief snippet of code below:

type
   treptgrid = record
     cell0 : string[3];
     cell1 : string[3];
     cell2 : string[36];
     cell3 : string[7];
     cell4 : string[15];
     cell5 : string[15];
     cell6 : string[7];
     cell7 : string[3];
end;
var

  writeIn_arr :  array[0..max_reptdata] of treptgrid;
  reptdata : array[0..max_reptdata] of treptgrid;

procedure TFrmReport.print_QReport();
    begin
        QRgeneralcode:= TQRgeneralcode.Create(self);
        QRgeneralcode.QrlFilename.caption:= 'File:' + FrmGencode.Selectfile;
        For x := 0 to reptrecs do
            begin
                QRgeneralcode.QrlCode1.caption:= reptdata[reptrecs].cell0;
                QRgeneralcode.QrlCode2.caption:= reptdata[reptrecs].cell1;
                QRgeneralcode.QrlWriteIn.caption:= reptdata[reptrecs].cell2;
                QRgeneralcode.QrlOcc.caption:= reptdata[reptrecs].cell3;
                QRgeneralcode.QrlDate.caption:= reptdata[reptrecs].cell6;
                QRgeneralcode.QrlKeyer.caption:= reptdata[reptrecs].cell7;
            end;
        QRgeneralcode.Preview;
     end;

Thank You,
Michael Townsend
michael.a.towns...@SAIC.com

Quote
Steve Fischkoff (TeamB) wrote:
> On Thu, 02 Sep 1999 15:00:18 -0400, Michael townsend
> <michael.a.towns...@cpmx.saic.com> wrote:

> >I am having problems creating a report in Quick Report. I have data in a
> >record (structure) that needs to be printed on a report. I have created
> >a report with a string band. I have placed QEXpr objects on the band to
> >handle the strings from the records structure. The data is all strings.

> >What is the best approach for reporting the data in the structure using
> >QR? Should I use a detail band instead of the string band? Should I use
> >QRLabels to display the text from the report?

> >Thank You,

> >Michael Townsend
> >michael.a.towns...@saic.com

> >--
> >MZ

> Based on your question, I assume you will be printing from a
> non-database situation and that you are printing only 1 record, not a
> list of them. If that's wrong, please let me know since the answer
> will have to be modified a bit.

> First, make sure you set the property to True which controls
> PrintIfEmpty. You'll not be hooking up the QuickReport component
> itself to a database so nothing will print without the above.
> Regarding what type of band, if you're printing only 1 page, it
> doesn't really matter. You can just use a big title band to cover the
> page and put QRLabels on it. You can set the value with code in each
> component's OnPrint handler.

> If you will be printing more than one data structure, then you'll have
> to put code in the report's OnNeedData event to let it know when you
> have run out of data.

> Steve F (Team B)

--
MZ

Other Threads