show getfilters on report

Hallo, I have a small problem: I use two dates (start and end) on a request-form and put them in a range (with setrange). After all I like to show this “Filters” on my report by using getfilters. Strange is that my created textfield is empty. I have used the same sort of code like in C/SIDE userguide. Anyone some suggestions? Regards Olaf

In order to discuss the problem, it will be a good thing that you send in short the code you use, because your discription isn’t enought. Is the date-range set to a dataitem or to a variable? at which step in your report you want to print the filter ?

Of course… onPreReport() filterPost := “Item Ledger Entry”.GETFILTERS; onPreDataItem() SETRANGE(“Posting Date”, PeriodStart, PeriodEnd); PeriodStart / PeriodEnd (global, type=date, taken from request form)

this is the wrong statement order filterPost is filled before the filters are set filterPost can be filled in the OnPreDataItem

Maybe the problem comes from the data filled in by he request-form I put the two dates into the request-form and want to show these two filters on the report. By pushing the preview button I post the filters to the report, or not?

nearly, Application Designers Guide says that the filters you give in RequestForm are set by starting the PreDataItem-Trigger. But you try to get the filter in the OnPreReport-Trigger and this trigger is execute before the PreDataItem-Trigger, so your solution could not work. Try the line filterPost := “Item Ledger Entry”.GETFILTERS in the PreDataItem-Trigger of “Item Ledger Entry” and print it in the header of this dataitem.

Hallo, thanks for your answer sound logical… I think I centralized the problem: My getfilters string works if I use some of these filters in tables but my start and enddate are filled in the tabpage “options”. This works for filtering but not for printing.

it will work for printing if you follow Hans-Dieter’s advice. Structure your code like this: OnPreDataItem-Trigger: SETRANGE(“Posting Date”,PeriodStart,PeriodEnd); filterPost := GETFILTERS; Then you can print the content of your filterPost-variable in a section of the dataitem “Item Ledger Entry” you have to apply your filter first to the table, before you can retrieve it with GETFILTERS again… :slight_smile:

Thanks Beaver, sometime it is hard something to explain …

Beaver is totally right, the order was the point. Thanks both.