Want to display filter Value on Report.

JAYESHJAYESH Member Posts: 290
HI Experts,

I want to know how to display value which we put to filter records on the Reports Heading Section.

For eg . I put filter on Date field - 010101..010107 at report run time.

I want to display 010101..010107 on the Report Heading.

I request you to please share your ideas.

Thank you
JAYESH PATEL

Comments

  • themavethemave Member Posts: 1,058
    use this report as an example

    try report 10143 Item list
    it prints the item filter that was set

    basically create a text variable called ItemFilter

    then on the pre-report trigger put

    ItemFilter := Item.GETFILTERS;

    then place on the header of your report the field
  • SavatageSavatage Member Posts: 7,142
    Search forum for "GetFilters" for lots of posts
    http://www.mibuso.com/forum/search.php

    you can also read the C/side Ref Guide about GETFILTERS

    also you can also look at other standard reports that do what you ask, to see how they were done.
  • JAYESHJAYESH Member Posts: 290
    Thanks a lot..:)
    JAYESH PATEL
  • SavatageSavatage Member Posts: 7,142
  • andy76andy76 Member Posts: 616
    Hi,

    I know GETFILTERS but I want to print all the filters applied in all indented dataitem in the header of level 0 . Is that possibile and how?
    GETFILTERS prints blank if it is not inserted in each dataitem section.

    Thank you
  • mabl4367mabl4367 Member Posts: 143
    I'm rather new to navisin but i think you could copy your data item structure and insert the copy before the original. Remove all sections refering to the copy and put a CurrReport.BREAK; statemet in all the data items OnAfterGetRecord triggers of the copy. In these triggers you will have access to the filters set in the requestform. Put some statements in there to save the filters in variables. Then print the contens of the variables in the sections belonging to the original data items.

    This way the report will run twice but the first time nothing will be processed. This is only done to get the filters.

    It might be that the filters of the first instance of the dataitems are not the shared with the second one. If so use the filters saved in the variables to copy the first set of filters into the second one and remove the tab for the original items from the request form.

    This is an ugly solution but I think it might work.
  • AlbertvhAlbertvh Member Posts: 516
    Hi Andy,
    in the Report - OnPreReport you could do this

    FilterString := DataItem.GETFILTERS + ' ' + DataItem1.GETFILTERS + ....;


    Albert
  • jversusjjversusj Member Posts: 489
    note that you will get an overflow error if the sum of your filters exceeds the length of your variable.

    for that reason, i usually do something like this OnPreReport

    FilterString1 := COPYSTR(DataItem1.GETFILTERS,1,MAXSTRLEN(FilterString1));
    FilterString2 := COPYSTR(DataItem2.GETFILTERS,1,MAXSTRLEN(FilterString2));
    ...
    FilterStringN := COPYSTR(DataItemN.GETFILTERS,1,MAXSTRLEN(FilterStringN));

    where FilterStringN is a text variable of length 250.

    i would then give each FilterString variable it's own section and code so that it does not print if the FilterString variable is empty (= '').
    kind of fell into this...
Sign In or Register to comment.