Hallo,
ich habe es einmal mit Fastreport nachgebaut. Auch hier sehe ich keine Möglichkeit in der Breite über den normalen Bereich (sprich auf neuer Seite) zu drucken.
page.EndlessWidth hat keinen Einfluss.
Delphi-Quellcode:
procedure GridPreview(Grid: TDBGrid);
var
page: TfrxReportPage;
band: TfrxBand;
memo: TfrxMemoView;
// cross: TfrxCrossView;
masterBand: TfrxMasterData;
i, x: Integer;
CurrentLeft, CurrentTop : integer;
BMark: TBookmark;
begin
// Make sure that report is clean.
GridRep.Clear;
// Set dataset range properties
dataset.RangeEnd:= reCount;
dataset.RangeEndCount:= grid.DataSource.DataSet.RecordCount;
// Add dataset to report
GridRep.DataSets.Add(dataset);
// Add a page
page:= TfrxReportPage.Create(GridRep);
page.CreateUniqueName;
page.SetDefaults;
page.EndlessWidth := True;
page.Orientation:= poLandscape;
// Add a report title band
band:= TfrxReportTitle.Create(page);
band.CreateUniqueName;
band.Top:= 0;
band.Height:= Abs(Grid.Font.Height) + 10;
// Add object to the report title band
memo:= TfrxMemoView.Create(band);
memo.CreateUniqueName;
memo.Text:= 'Test';
memo.Height:= Abs(Grid.Font.Height) + 10;
memo.Align := baWidth;
// Add masterdata band
masterBand:= TfrxMasterData.Create(page);
masterBand.CreateUniqueName;
masterBand.DataSet:= dataset;
masterBand.Top:= band.Top+band.Height+1;
masterBand.Height:= (Canvas.TextHeight('A') + 10);
// Add objects on master data
x:= 0;
for I := 0 to Grid.Columns.Count - 1 do
begin
// ShowMessage(IntToStr(i)+'___'+Grid.Columns.Items[I].Field.FieldName);
if (Grid.Columns.Items[I].Visible) then
begin
memo:= TfrxMemoView.Create(masterBand);
memo.CreateUniqueName;
// Connect to data
memo.DataSet:= dataset;
memo.DataField:= Grid.Columns.Items[I].FieldName;
memo.SetBounds(x, 0, Grid.Columns[I].Width, (Canvas.TextHeight('A') + 10));
x:= x+grid.Columns[I].Width;
memo.Frame.Typ:= [ftLeft, ftRight, ftTop, ftBottom];
memo.GapX:= 3;
memo.GapY:= 2;
end;
end;
GridRep.Showreport; {or Preview if you prefer}
end;