Options

(not possible)- generic table

ReinhardReinhard Member Posts: 249
HI I want to learn how to use recordRef. Specifically:

automated reports must skip past the reqForm, but filters are still necesary, so we have to filter the table and then pass it in to the report. But there are different reports with different tables, so I don't want to use a table variable, since I have to specify the subtype.
createPDF(intReport : integer, recRef : recordRef)
//set up PDFCreator as printer... then:
REPORT.RUNMODAL(ReportID,FALSE,TRUE,recRef);

this won't work... since it is expecting a record and not a recordRef

I hope you understand my question. Thanks for your time!

Answers

  • Options
    XypherXypher Member Posts: 297
    The process in which I create PDFs using PDFCreator is...
      1. Call a function to activate PDFCreator.
    /color][color=red]strFilePath[/color] := [color=darkredPDFPrinter(strFileName : Text)

    2. Apply filters etc etc print report. (At your own leisure; remotely from PDFPrinter function.)
    2a. (PDFCreator::eReady reverts printer back to default system printer and terminates DLL instance)

    3. /color][color=red]FoundIt[/color] := [color=darkredWaitForFile(strFilePath : Text, intSeconds : Integer)

    4. Attach to E-mail, Load into Table as BLOB, .... etc


    Sorry for the colours... I got bored.
  • Options
    ara3nara3n Member Posts: 9,256
    unfortunately reports cannot accept recRef as you found out.

    You can still use recRef in your function, it's just you have to write a huge case statement and copy the filters to actual rec variable and then call the report.


    There is also one more issue with reports in that you can only pass one record to it.
    So if you have a report with two dataitem with filters, you can only pass on record.


    I would rather take another approach.

    I would modify the reports and add a function to get the parameters an apply them to dataItems instead, only if you are running under NAS.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    ReinhardReinhard Member Posts: 249
    hmmm yes thank you all.
  • Options
    garakgarak Member Posts: 3,263
    take a look at this.
    It could be help.
    Do you make it right, it works too!
Sign In or Register to comment.