Can we pass parameter into the report?

RachelSoonRachelSoon Member Posts: 202
edited 2005-11-07 in Navision Attain
Can we pass a parameter from a processing only report to a normal report?

My scenario :
I have 2 report, let say the processing only report as Report 1 and normal report as Report 2.

Report 1, which require ReqFilterField to be entered by the user. After the running the report 1, Report 2 need to be printed. The Report 2 needs the same ReqFilterField which were previously used for the Report 1.

I am wondering if i can pass those ReqFilterField in the Report 1 to the Report 2 rather than let the user key in the exactly same ReqFilterField for the Report 2.

The ReqFilterField could be the field in the dataitem or the variable in the option tab(the field in the request form).

Comments

  • Francis_MalengierFrancis_Malengier Member Posts: 28
    I solve this the following way :

    In report 2, I create the parameters as global variables. Then I make a function to set these parameters.
    In report 1, where you want the second report to be run, declare a variable for report 2 . First call the function to set the parameters(e.i report2.setparameters(x,y,z), after that run the report. Of course, you will have some kind of setrange or setfileter with the variables in report 2.
  • sharkssharks Member Posts: 22
    i did something similar but for calling a dataport, i had a command button in the form that called the dataport that had the following code:
    CLEAR(ImportQuoteLines);
    ImportQuoteLines.SetWorksheetNo("No.");
    ImportQuoteLines.RUNMODAL;
    CurrForm.UPDATE;
    

    Where ImportQuoteLines is my dataport.

    and then I had a SETRANGE in the dataport onpredataitem
    PurchaseLine.RESET;
    CLEAR(Line);
    
    PurchaseLine.SETRANGE("Document No.",DocNo);
    
    IF PurchaseLine.FIND('+') THEN
      Line := PurchaseLine."Line No."
    ELSE
      Line := 0;
    

    where DocNo comes from the function SetWorksheetNo(No : Code[10]) in my dataport (called from the form) and has just one line of code
    DocNo := No;
    
  • SaroSaro Member Posts: 58
    You can also embed report 2 in report 1, just copy the dataitems from report 2 into report one, you can set a boolean if you do not need to run the second part, this way you will also be able to use the getfilter(s) within your report to pass the filters from one dataitem to the other, also saves an extra object(in this case report) number in your liscence numbering
    Saro
Sign In or Register to comment.