Hack: 100 in 1 Report - Dynamic report layouts in Business Central

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024

Комментарии • 40

  • @rishichourey
    @rishichourey 3 года назад

    Custom Report Layout is beautiful functionality given by Business Central.
    We have used the same report ID of Sales Invoice and created 6 different formats of Sales Invoices for 6 countries :), Based on the company it will display to the corresponding layout only.

  • @anada1124
    @anada1124 3 года назад +1

    Thank you, Erik.
    Microsoft should make your solution as part of the standard report object.

  • @hugo_alves
    @hugo_alves Год назад

    This is a video i'd like to thumbs up a hundred times if i could!

  • @sonnyjim4047
    @sonnyjim4047 4 года назад

    Hi Eric, Great video and tried to change the standard Sales Invoice by changing trigger after creating a copy;
    trigger OnInitReport()
    var
    RLS: Record "Report Layout Selection";//*select custom layout custom
    begin
    //custom code
    Layout.Setrange("Report ID", 61306);//Layout declared as a variable at the end of this page
    if page.RunModal(61306, Layout) = action::LookupOK then
    RLS.SetTempLayoutSelected(Layout.Code)
    else
    Error('Please select layout');
    only thing is once the you select the layout from the new page "Select Layout" it goes to the standard request page and then when run the report (preview) it goes back to "Select Layout" page again and then when selected (for the second time) , report exports to PDF

    • @Hougaard
      @Hougaard  4 года назад

      You should be able to control that in a global variable.

    • @ehsanm64
      @ehsanm64 3 года назад

      Erik Hougaard Hi Erik , would you please tell me how can we do that with global variable?

  • @ercanismail3893
    @ercanismail3893 4 года назад

    I'm just starting my journey of learning development in AL. I would be tempted to copy the original request page and add a section there which lists the available layouts for the user to select plus the ability to make a new one.
    Great video as always!

    • @Hougaard
      @Hougaard  4 года назад +3

      You cannot do that, the layout is selected/fixed when then request page is shown. That's why it has to be done at OnInitReport() - That's the last chance.

  • @Genius5438
    @Genius5438 2 года назад

    Thanks Eric. Great Video. I tried using one report with multiple layouts like you did, however for some reason after running the report it showed me the layout but it also changed all the layouts of standard reports.

    • @Hougaard
      @Hougaard  2 года назад

      Really?

    • @Genius5438
      @Genius5438 2 года назад

      @@Hougaard Yes. But the solution was to do settemplayoutseletced('') after executing the report and all back to normal.

  • @artemkeller2571
    @artemkeller2571 Год назад

    Hey Erik! Thanks for this video. That helped. One thing - this method involves manually uploading layouts in "custom layouts" each time you want to modify layout. We are using "rendering" section inside report extensions to import different layouts. My question is - is it possible to choose which report to run by uploading them this way? Inside Report Extension it looks like this:
    rendering
    {
    layout("My Sales Order Confirmation")
    {
    Type = RDLC;
    LayoutFile = 'My Sales Order Confirmation.rdl';
    }
    layout("My Sales Order Confirmation Email Text")
    {
    Type = Word;
    LayoutFile = 'My Sales Order Confirmation Email Text.docx';
    }
    layout("My Sales Draft Invoice")
    {
    Type = RDLC;
    LayoutFile = 'My Sales Draft Invoice (for Sales Order).rdl';
    }
    }

    • @Hougaard
      @Hougaard  Год назад

      Be aware, that this video was recorded before reportextensions existed, and before BC could do layout selected with the rendering section .... Making this video obsolete :)

  • @ant1d0te
    @ant1d0te 4 года назад

    Layout is one of the easiest part if customer asks for changes.
    The main issue for customers is change of logic and grabbing fields from other tables (or even from existing if they weren't added to dataset).
    I hope MS provide some good looking Report Extension (they promised for next global BC release afair).

    • @Hougaard
      @Hougaard  4 года назад +1

      Yeah, but until we see something like reportextension, you have to use the substitute report functionality as seen here: ruclips.net/video/qleSGJQD148/видео.html

  • @meriahabdelmoneim1284
    @meriahabdelmoneim1284 4 года назад +1

    Great video. Very clear !

  • @chirangaranasinghe19
    @chirangaranasinghe19 2 года назад +1

    As a beginner, from which video I should start to learn ? is there any playlist for beginners. thank you

    • @Hougaard
      @Hougaard  2 года назад +1

      ruclips.net/p/PLnldREWlGR0vmyMwB5lmqWjK9KBMwn05s

  • @RogerSlides
    @RogerSlides 3 года назад

    Awsome tutorial Erik!

  • @vineethr2k7
    @vineethr2k7 3 года назад

    Thank you Erik for this trick

  • @IMAS-vf2ur
    @IMAS-vf2ur Год назад

    Nice tutorial. Do you know how to change the report layout programmatically which is from "Report Layout List" table?
    Thanks

    • @Hougaard
      @Hougaard  Год назад

      ReportLayoutSelection.SetTempLayoutSelected(LayoutCode);

  • @cioadvise6645
    @cioadvise6645 2 года назад +1

    Eric, my video studio does not show the AL File Wizard. Do I have to install anything to get that to work? I have run AL!Go already. Thanks in advance.

    • @Hougaard
      @Hougaard  2 года назад +1

      Did you install the AZ AL extension in VS Code?

  • @ricardo041996
    @ricardo041996 3 года назад

    Hi Erik, thank you for the useful videos. Is it possible to reduce the image size from your video? Sometimes I can't see so well the Problems notification area on VS Code. Thanks

  • @jnaneshc4302
    @jnaneshc4302 11 месяцев назад

    can you please do the report amount in words for multiple currencies without hardcoding
    please

  • @danykanaan286
    @danykanaan286 2 года назад

    Hi Erik thank you for your videos. I started Coding with AL 2 month ago and you are of great help.
    But saddly i have one problem with this solution right now.
    If I have set the SaveValues property in the request page to true it will run through the OnInit trigger again when clicking preview and open the Selection page again and then does not give me a proper preview of the report, but instead downloads a file with no doctype.
    I have set the SaveValues so the requestpage does not close when previeweing the document.
    Is there a solution to this problem? Should i use a global trigger instead of the onint (Like SelectReportLayoutCode)?

    • @Hougaard
      @Hougaard  2 года назад

      This solution has actually being adopted by Microsoft, so in version 21 you can select a layout out of the box.

  • @UweMicha
    @UweMicha Год назад

    Hi Erik, is it possible to make sub reports in a rdlc layouts for BC? Did you already made a video about that? I did't find it... In the ReportBuilder you can add a sub report but it ask for a URL to a given report.... (???)

    • @Hougaard
      @Hougaard  Год назад +1

      Sorry, I don't think that's possible :(

  • @businesscentral-explained1703
    @businesscentral-explained1703 3 года назад

    Thanks for the video!
    Is there any efficient way i can make a page action run a standard report - f.ex. the standard sales order confirmation with a specific layout? In that case i can not modify the init trigger in the report. Or is the only way i can do that by duplicating the report?

    • @Hougaard
      @Hougaard  3 года назад

      you can set the layout before calling the report.

  • @dittongo_au
    @dittongo_au 3 года назад

    amazing tutorial

  • @faaizahmed3146
    @faaizahmed3146 4 года назад

    Dear Erik, can i preview the report without using run request page??

    • @Hougaard
      @Hougaard  4 года назад

      Not that I'm aware of ...

  • @linojrasmolo7161
    @linojrasmolo7161 4 года назад

    Hi Eric,
    Can i directly call this custom layout using an action button?

    • @Hougaard
      @Hougaard  4 года назад

      Yes you can! Return.Run works fine with this report...

  • @vh8000
    @vh8000 3 года назад

    👍👍👍 Thanks

  • @bhagwanjijha1146
    @bhagwanjijha1146 3 года назад

    Great