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

Notifications

Announcements

No record found.

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 980

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,557 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
    Inge M. Bruvik Profile Picture
    1,105 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
    95,329 Super User 2025 Season 2 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
    980 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
    95,329 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans