Options

Want to filter report in different tabel

GustingurahWGustingurahW Member Posts: 11
edited 2023-09-05 in NAV Three Tier
mycu6pp6ddxr.png
i want filter the report using the status when the data in different tabel is empty, like this the picture belowv2yvz6a0avh9.png
lb7nds7sfdcz.png
any one help me? Thankyou

Answers

  • Options
    GustingurahWGustingurahW Member Posts: 11
    report 70078 "Report Maintenance Request"
    {
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    DefaultLayout = RDLC;

    RDLCLayout = './rdlc/Report_70078_Report_Maintenance_Request.rdl';

    dataset
    {
    dataitem("DAM Maintenance Request"; "DAM Maintenance Request")
    {
    RequestFilterFields = "No.", Status, "Request Date";
    column(No_; "No.")
    {

    }
    column(Description; Description)
    {

    }
    column(Status; Status)
    {

    }
    column(Request_Date; "Request Date")
    {

    }
    column(FilterDate; FilterDate)
    {

    }
    column(CompanyPicture; CompanyInfo.Picture)
    {

    }
    column(CompanyName; CompanyInfo.Name)
    {

    }
    column(CompanyCity; CompanyInfo.City)
    {

    }
    column(CompanyAddress; CompanyInfo.Address)
    {

    }
    column(CompanyContactPerson; CompanyInfo."Contact Person")
    {

    }
    column(CompanyPost; CompanyInfo."Post Code")
    {

    }
    column(CompanyInfoPhone; CompanyInfo."Phone No.")
    {

    }
    column(CompanyInfoEmail; CompanyInfo."E-Mail")
    {

    }
    column(Location; Location)
    {

    }
    dataitem("DAM Maint. Req. Related Work"; "DAM Maint. Req. Related Work")
    {
    DataItemLink = "Work Order Maint. Req. No." = field("No.");
    RequestFilterFields = "Work Order No.", Status;
    column(Asset_No_; "Asset No.")
    {

    }
    column(Asset_Description; "Asset Description")
    {

    }
    column(Plan_No_; "Plan No.")
    {

    }
    column(Work_Order_No_; "Work Order No.")
    {

    }
    column(Order_Date; "Order Date")
    {

    }

    }

    trigger OnPreDataItem()
    var
    FilterReqDate: Record "DAM Maintenance Request";
    FilterRWO: Record "DAM Maint. Req. Related Work";
    StartDate: Date;
    EndDate: Date;
    begin
    StartDate := CalcDate('<-CM-3M>', Today);
    EndDate := CalcDate('<-CM-1D>', Today);
    FilterReqDate.SetRange("Request Date", StartDate, EndDate);
    FilterReqDate.SetFilter("Request Date", '%1..%2', StartDate, EndDate);
    if FilterReqDate.FindFirst() then begin
    FilterDate := FilterReqDate."Request Date";
    end;
    if "DAM Maintenance Request"."No." <> '' then begin
    FilterRWO.SetRange("Work Order No.", '');
    FilterRWO.SetRange("Work Order No.", "DAM Maintenance Request"."No.");
    end;
    end;
    }
    }

    requestpage
    {
    Caption = 'Report Maintenance Request';
    SaveValues = true;
    layout
    {
    area(Content)
    {
    group(GroupName)
    {

    }
    }
    }

    actions
    {
    area(processing)
    {
    action(ActionName)
    {
    ApplicationArea = All;
    }
    }
    }
    }

    trigger OnPreReport()
    var
    RelatedWorkOrder: Record "DAM Work Order Header";
    begin
    if RelatedWorkOrder.FindSet() then
    repeat
    "DAM Maint. Req. Related Work".Init();
    "DAM Maint. Req. Related Work"."Asset No." := RelatedWorkOrder."Asset No.";
    "DAM Maint. Req. Related Work"."Asset Description" := RelatedWorkOrder."Asset Description";
    "DAM Maint. Req. Related Work"."Plan No." := RelatedWorkOrder."Plan No.";
    "DAM Maint. Req. Related Work"."Work Order No." := RelatedWorkOrder."Work Order No.";
    "DAM Maint. Req. Related Work"."Order Date" := RelatedWorkOrder."Posting Date";
    until RelatedWorkOrder.Next() = 0;
    if RelatedWorkOrder."Maintenance Request No." <> "DAM Maint. Req. Related Work"."Work Order Maint. Req. No." then begin

    end;
    end;

    trigger OnInitReport()
    begin
    CompanyInfo.get();
    CompanyInfo.CalcFields(Picture);
    FilterStatus := '';
    FilterWorkOrder := '';
    end;

    // local procedure GetStatusOptionList() : Option;

    var
    myInt: Integer;
    FilterDate: Date;
    CompanyInfo: Record "Company Information";
    Location: Text;
    FilterWorkOrder: Code[20];
    FilterStatus: Text;
    }
    this my code
  • Options
    GustingurahWGustingurahW Member Posts: 11
    but 1 tabel is temporary
  • Options
    krikikriki Member, Moderator Posts: 9,098
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.