Print a PDF from Business Central, that's easy, isn't it?

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • Find more information at my blog www.hougaard.com or follow me on / ehougaard
    Source code can be found here: github.com/hou...

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

  • @chriswatson2407
    @chriswatson2407 Месяц назад

    Fantastic. I have been suffering with trying to print 'stored' PDFs and this is perfect!

  • @GDSjokers
    @GDSjokers 4 месяца назад +1

    This was incredible.
    However, can you think of a real use scenario?
    I was thinking about cases where a client wants to print some pages with their printing layouts, and rdlc isn't user-friendly. You could have the code upload the file in memory to then be attached to the printed report layout.
    However, why would you go through all this when you can just attach the file anyway. Since this is additional, not merged into.
    Or just because it's cool? Yeah.

  • @FISS007
    @FISS007 4 месяца назад

    I think it didn't hold the stream because the trigger function goes out of scope before the next function is called, hence any member variable will get GCed and won't be available anymore.

  • @dustinbottcher9839
    @dustinbottcher9839 Месяц назад

    Can I use an Excel Template for my reports which includes macros?

  • @NickyLi
    @NickyLi 4 месяца назад

    Hello Erik, if we don't use the default report builder, do we have other ways to generate PDF from Business Central's data, if so, how do we format it?

  • @andreabonomi1484
    @andreabonomi1484 4 месяца назад

    Is it possible to use this method to attach a PDF at the end to an existing report (ex. an invoice)?

    • @Hougaard
      @Hougaard  4 месяца назад

      Maybe

    • @ant1d0te
      @ant1d0te Месяц назад

      I doubt it would be possible to handle easily. First you need to deconstruct initial pdf, take header and data part from it, then deconstruct additional pdf, taking data from it, then add footer part to have correctly formed pdf.

  • @redbrook1
    @redbrook1 4 месяца назад

    Nice 👍
    I guess without single instance set on the codeunit , you will have two separate instances, one instance instantiated by the report, and another instantiated by the event subscriber. They will have their own copy of the global variable.

  • @EquinoxDK
    @EquinoxDK 4 месяца назад

    I guess the local Instream is garbage collected as you leave the function, Global instream first when you are done with report. So it lives until after the DocumentReady event is triggered.

    • @Hougaard
      @Hougaard  4 месяца назад +1

      Well, the _InS := InS should prevent the garbage collection of the stream...

    • @EquinoxDK
      @EquinoxDK 4 месяца назад

      @@Hougaard I do not agree. That sets _InS to the same reference as the instream in the report var. And as it is garbage collected the _Ins is also GC'ed. So if it is a local var GC is called before the _InS var is used.

  • @mauriciovillatoro9361
    @mauriciovillatoro9361 4 месяца назад

    Very interesting.

  • @arunkumarpandiyan8481
    @arunkumarpandiyan8481 3 месяца назад

    sales order report PDF convert to sales order scenario Al code example code i
    am from India