Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Label does never appear :-(

edited April 2002 in General
Hi, I Have a little problem.

I want to preview a report, and this is my code.

In the FormActivate of myu form when I select the options to print I cretate
te report like this:

ReportCue := TppReport.Create(Self);
With ReportCue do
begin
AllowPrintToArchive := True;
AllowPrintToFile := True;
AutoStop := False;
CachePages := False;
Columns := 1;
DataPipeline := PipeCue;
DeviceType := 'Screen';
Language := lgSpanish;
ModalCancelDialog := True;
ModalPreview := True;
Name := 'ReportCue';
PassSetting := psTwoPass;
With PrinterSetup do
begin
Copies := 1;
DocumentName := 'Report';
Duplex := dpNone;
MarginTop := 0;
MarginBottom := 0;
MarginLeft := 0;
MarginRight := 0;
Orientation := poPortrait;
PaperHeight := 754;
PaperName := 'A4';
PaperWidth := 1123;
PrinterName := 'Default';
end;
SaveAsTemplate := False;
SavePrinterSetup := False;
ShowAutoSearchDialog := False;
ShowCancelDialog := True;
ShowPrintDialog := True;
Tag := 0;
Template.FileName := 'C:\Report.rtm';
Template.LoadFromFile;
Units := utScreenPixels;

Reset;
DetailBand.DataPipeline := PipeCue;
BeforePrint := RCueBeforePrint;
end;


On PreviewButtonClick:
ReportCue.PrintReport;

Before Clic the button, I have to select with three Checkbox if I like to
print some labels.

the code is that:
lbDebe1.Visible := cbDebe.Checked;
lbHaber1.Visible := cbHaber.Checked;
lbSaldo1.Visible := cbSaldo.Checked;

This code is in ppDetailBand1BeforePrint Event, but it doesn?t work.

My problem is that I can?t make those labels 'invisible' , and if the
checkboxes aren?t checked, they would not be visible.

Can You Help Me?

Note: Sorry about my poor english.

Comments

  • edited April 2002
    First you should setup your report in the form's Create method since the
    form's activate method is called every time the form receives focus. Also
    the template stores all the settings of the report and the settings you
    specify will be overriden anyway when the templats is loaded, which means
    that you don't have to specify all the settings manually as you do below.
    Finally, since you are loading the report from a template, make sure that
    the objects you are referencing, that is the label objects, are indeed
    connected to the report.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.