begin
ZipFileName := 'TimeSheetReport_' + Format(CurrentDateTime) + '.zip';
DataCompression.CreateZipArchive();[quote user="Indira88"]
Hi All,
Now that template based excel reports are pretty easy to generate in business central I have a question that maybe you could help.

The above is a list that the user would select multiple users and generate a template based excel report in one click shown in the action above.
present the user has to click download for each chosen resource,Can we generate the reports without clicking multiple times?
[/quote]
Resources.Reset();
CurrPage.SetSelectionFilter(Resources);
TempBlob.CreateOutStream(OutS);
If Resources.FindSet() then begin
repeat
Tsmgmt.SetResourceNoForManager(Resources."No.");
Tsmgmt.SetStartDate(StartDt);
Tsmgmt.SetEndDate(EndDt);
Tsmgmt.SetJobNo(JobNo);
TimeSheetDetail.SetRange(Date, StartDt, EndDt);
TimeSheetDetail.SetRange("Job No.", JobNo);
TimeSheetDetail.SetRange(DTResourceNO, Resources."No.");
TimeSheetDetail.SetRange(WorkTypeCode, 'REG');
If TimeSheetDetail.FindSet() then begin
TempBlob.CreateOutStream(OutS);
RecRef.GetTable(TimeSheetdetail);
FldRef := RecRef.Field(TimeSheetdetail.FieldNo("Time Sheet No."));
Report.SaveAs(Report::MultipleCustTSRprtHorizontal, '', ReportFormat::Excel, OutS, RecRef);
TempBlob.CreateInStream(InS);
xlsFileName := Format(TimeSheetdetail.DTResourceNO + ' ' + '.xls');
filemgmt.BLOBExport(TempBlob, STRSUBSTNO('TimeSHeetTemplate.xls', TimeSheetdetail."Time Sheet No."), true);
end;
until Resources.Next() = 0;
TempBlob.CreateOutStream(OutS);
DataCompression.SaveZipArchive(OutS);
TempBlob.CreateInStream(InS);
DownloadFromStream(InS, '', '', '', ZipFileName);
end;
end;
The above is the code i m using can u suggest what is wrong because I am getting an empty zip[quote user="Indira88"]
Hi All,
Now that template based excel reports are pretty easy to generate in business central I have a question that maybe you could help.

The above is a list that the user would select multiple users and generate a template based excel report in one click shown in the action above.
present the user has to click download for each chosen resource,Can we generate the reports without clicking multiple times?
[/quote]