Hola,
Como nadie dio respuesta y como siempre me pasa, termino resolviendolo yo solo.
aqui les va la solucion por si alguien la requiere.
Para juntasr 2 o mas reposrtes (generados independientemente) en uno solo, se hace lo siguiente: Reportbuilder 11
declaras estas variables y componentes.
I: Integer;
SubList, RptList: TList;
MasterRpt: TppReport;
SR: TppSubReport;
function TForrmReportes.Reportes(): TppReport;
begin
SubList := TList.Create;
RptList := TList.Create;
RptList.Add(Reporte1); // donde reporte 1 y 2 equivale a cada reporte generado previamente(componente TppReport)
RptList.Add(Report2);
MasterRpt := TppReport.Create(Self);
MasterRpt.CreateDefaultBands;
MasterRpt.RemoveBand(MasterRpt.HeaderBand);
MasterRpt.RemoveBand(MasterRpt.FooterBand);
for I := 0 to RptList.Count - 1 do begin
SR := TppSubReport.Create(Self);
SR.SetReportProperty(TppReport(RptList[i]));
SR.Band := MasterRpt.DetailBand;
SR.PrintBehavior:= pbSection;
SR.Report.PassSetting := psTwoPass;
SR.ResetPageNo := True;
SubList.Add(SR);
end;
with MasterRpt do
begin
AllowPrintToFile := True;
ShowPrintDialog := False;
PDFSettings.Author := 'ReportBuilder';
PDFSettings.Title := 'Export to PDF Demo';
TextFileName := 'C:\MyPDFFile.pdf';
end;
MasterRpt.Print;
end;
Nota: Algunas lineas quiza no son necesarias, pueden ir quitando y probando
Tambien, si te marca algun error quiza sera necesario agregar algunas unidades manualmente en el Uses de tu unidad como por ejemplo (ppTypes, ppSubRpt, ppReport ..etc) en caso de que no esten.
espero a alguien le sirva.
__________________
No hay que Postear primero, hay saber Buscar..
|