run report function after locate the report id in runtime

OliverTOliverT Member Posts: 37
edited 2013-01-21 in Navision DOS
hi!

we try to run reports and there functions ... but the report id is located during the runtime!

so it's not possible to use global/local variables ... and
report.run(...)
  or
report.runmodal(...)
don't have the functionality to run functions within the report ...

has anybody an idea how to solve this problem?

greets, tafferKakao :roll:

Comments

  • OliverTOliverT Member Posts: 37
    ehm ...
  • WarfoxWarfox Member Posts: 53
    hmmm
  • RobertMoRobertMo Member Posts: 484
    no go...
    not possible...

    how many differrent reports do you expect to be run.
    if <10 (<20...) you can make them all globals and use a large CASE statement...
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • RobertMoRobertMo Member Posts: 484
    what about if you code your functions as Codeunits ?
    then you can call your functions using CODEUNIT.RUN(123,rec);
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • OliverTOliverT Member Posts: 37
    all about ... 22 reports in 28 different forms.

    why we want to do this? if this would be possible, we don't need to spent any attention to customer individual reports ...

    everey report-id would be written in a table (together with a unique code) ... the form should now run a codeunit (instead of a report) ... the coudenit just needs a code and could run the report ...

    on this way we only need to change the value of an integer-field in the new table instead of changing everey form that runs the original report :wink:

    when i would write a coudeunit which runs the report-functions, we would need to spent this one codeunit nearly as much attention as we need to spent now for customer individual reports ...

    i need a reportref (like the recordref) ... perhaps this will be available in navison 4 :lol:
  • aandriesaandries Member Posts: 8
    In the mean time.. I am working with version 5 ... No ReportRefs as far I can see.

    Did this problem even got solved?
    I have the same problem now.


    A.
  • CalicoCalico Member Posts: 31
    I had a similar problem and came across this topic while searching the forum. My solution has been to use a SingleInstance codeunit. The code that runs the report first runs a function in the codeunit to set the report parameters; each report runs another function in the codeunit to check if the parameters have been set and if so retrieve them; after the report is run, the code that has run it runs a third function in the codeunit to clear the parameters.
Sign In or Register to comment.