web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Creating multiple template based excel reports in one click

(0) ShareShare
ReportReport
Posted on by 1,021

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.

pastedimage1665763322545v1.png

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?

I have the same question (0)
  • Suggested answer
    Amit Profile Picture
    2,563 on at

    Hi,

    Refer the below link

    https://erpconsultors.com/export-to-excel-report-in-business-central/

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    No if you want to store them on your local drive.

    But you can customize it to store them in onedrive or azure blob storage.

  • Suggested answer
    YUN ZHU Profile Picture
    101,995 Super User 2026 Season 1 on at

    Hi, A workaround is to just click Download once. Pack the files into a zip file.

    More details:

    https://yzhums.com/20030/

    Hope this helps.

    Thanks.

    ZHU

  • Indira88 Profile Picture
    1,021 on at

    yzhums 

      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.

    pastedimage1665763322545v1.png

    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.

    pastedimage1665763322545v1.png

    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]
  • Suggested answer
    YUN ZHU Profile Picture
    101,995 Super User 2026 Season 1 on at

    Hi, Sorry I don't have your environment, you can debug it step by step.

    It looks like there may be no value in the RecRef.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,028 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,366 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,175 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans