Requestform variables

Does anybody know where the entries in the requestform are stored (parameters for requested fields in the requestform) ? Can i access them in any way during the report runs ? Stefan Weinreich Billing Analyst

Hi Stefan, The parameters are not stored in an accessible way but you can set the parameters establishing filters or certain variables in the OnInitReport Trigger. Saludos Nils

Hey Nils, what i intend to do is to collect several reports written by our NSC, which all need the same parameters (customer, startdate, enddate) into one report (one report should execute the reports). Hence i need a possibility to run this reports with parameters, a user would enter if he would call the reports one by one. So i need a way to call the reports and to tell the the limiters. Calling the reports without executing the requestform is no problem. But how to enter the parameters ? Do you know how to establish that ? Stefan Weinreich Billing Analyst

Hi Stefan, if your reports could be started with a record then you just have to filter those records and start the reports from a trigger of your main-report. For example: SalesHeader.SETRANGE(“Document Type”,SalesHeader.“Document Type”::Quote); SalesHeader.SETFILTER(“Order Date”,’>%1’,DateVariable); REPORT.RUN(204,false,false,SalesHeader); This will only work if you want to filter on the main (not indent) DataItem of the report. If you need to filter on indent dataitem then define your reports as a variable of type report. You can create a new function on each report. In this funtcion you can set the filter for all data-items of the whole report. Call the function before running the report. (don’t ask for the sense of that example, just look at the technique): DefineFilterFunktion(Local1 : Text[30];Local2 : Text[30]) SalesLine.SETRANG(“Document No.”,‘Local1’); SalesLine.SETRANG(“No.”,‘Filter2’); -------------- InvoiceReport.DefineFilterFunktion(‘Filter1’,‘Filter2’); InvoiceReport.RUN; I know that Navision itself uses this way somewhere. Maybe somebody else can tell you where to find. Micha

thanks Micha, step by step i’m approaching the aim. My last hurdle is that there is defined a variable in the RequestForm of the executed report. This variable is a global variable of type date. Can i allocate this variable a value too from the calling report ? Stefan Weinreich Billing Analyst

Hi, yes, but only if you will do it like the second way and create a kind of “DefineFilterFunction”. Then you can define another local parameter and advise that value to your global variable. Micha

Hey Micha, i don’t know how to handle your last posting. Assume that i can alter the NSC-report. So i have to work only with my new report which calls the NSC-reports. i understand your first posting as 1. create a variable with type “report” 2. create a new function in the calling report. 3. set filters to the tables which are used in the NSC-reports 4. call the NSC-reports by using the report-variable okay, so far so good. But what do i have to do to allocate the variable in the NSC-reports a value from the calling report ? Can you give me an example ? thanks in advance Stefan Weinreich Billing Analyst

Hi Stefan, If I understand correctly, NSCReport is the Sub-Report? Ok, here we go NSCReport:


Var
  globDate : Date;  //Date you have on Request Form

Function DefineFilters (parDate : Date);
Begin
  globDate := parDate;
End;

Main Report


Var
  NSCReport : Report 51234;

Begin
  Clear (NSCReport);
  NSCReport.SetTableView (aRecord);
 **NSCReport.DefineFilters (310302d);**
  NSCReport.Run;
End;

Make sure that in NSCReport the SaverControlInfo Property is NOT set on the requestform. Otherwise the globDate variable will be overwritten with the stored value you last used rather than with the value passed from the main report. You might also want to read this: http://www.navision.net/forum/topic.asp?TOPIC_ID=1148&FORUM_ID=9&CAT_ID=3&Topic_Title=Report+scheduler&Forum_Title=Attain%2FFinancials+%2D+Developer+Forum Hope this helps With best regards from Switzerland Marcus Fabian Edited by - fabian on 2002 Mar 05 00:57:21

thanks to all. Now i understand how to provide the sending of parameters to other reports. Unfortunately i’m not allowd to change anything in a NSC-report. Hence i have no chance to set the date variable. But i’ve learned a lot with your examples. Stefan Weinreich Billing Analyst

But you could always save a copy of the NSC reports with new numbers and modify the copies. That is what I had to do when I was a user with a lame NSC. Paul Baxter

Of course, you’re right Pual. But at a certain point i need to change the NSC-Report to link my copied report to the existing ones. Stefan Weinreich Billing Analyst

No what I mean is don’t use the NSC reports but use your copies. You could always ask the NSC to add the functions to there reports sending them examples in a fob. We have such rules but it is to stop clients messing up the whole system and expecting us to maintain it. We have had reports totally rewritten by the client and they don’t work and they expect us to put it right at no cost to them. I’m rambling sorry!! Paul Baxter