Report

Certified Associate Developer

Hii all

How to create a report using query entity not using report type ?Can anybody help me .

  Discussion posts and replies are publicly visible

Top Replies

Parents
  • Hi  

    Please find the below code for readonly grid with query entity rule.

    Below example has a table with first name, last name, department and status.

    I hope this code will help to correlate with your requirement.

    a!gridField(
                  label: "Read-only Grid",
                  labelPosition: "ABOVE",
                  data: a!queryEntity(
                    entity: cons!EMPLOYEE_ENTITY,
                    query: a!query(
                      selection: a!querySelection(
                        columns: {
                          a!queryColumn(
                            field: "id"
                          ),
                          a!queryColumn(
                            field: "firstName"
                          ),
                          a!queryColumn(
                            field: "lastName"
                          ),
                          a!queryColumn(
                            field: "department"
                          ),
                          a!queryColumn(
                            field: "status"
                          )
                        }
                      ),
                      pagingInfo: fv!pagingInfo
                    ),
                    fetchTotalCount: true
                  ),
                  columns: {
                    a!gridColumn(
                      label: "First Name",
                      sortField: "firstName",
                      value: fv!row.firstName
                    ),
                    a!gridColumn(
                      label: "Last Name",
                      sortField: "lastName",
                      value: fv!row.lastName
                    ),
                    a!gridColumn(
                      label: "Department",
                      sortField: "department",
                      value: fv!row.department
                    ),
                    a!gridColumn(
                      label: "Status",
                      sortField: "status",
                      value: fv!row.status,
                      align: "END"
                    )
                  },
                  pageSize: 5,
                  initialSorts: {
                    a!sortInfo(
                      field: "lastName",
                      ascending: true
                    )
                  },
                  validations: {}
                )

Reply
  • Hi  

    Please find the below code for readonly grid with query entity rule.

    Below example has a table with first name, last name, department and status.

    I hope this code will help to correlate with your requirement.

    a!gridField(
                  label: "Read-only Grid",
                  labelPosition: "ABOVE",
                  data: a!queryEntity(
                    entity: cons!EMPLOYEE_ENTITY,
                    query: a!query(
                      selection: a!querySelection(
                        columns: {
                          a!queryColumn(
                            field: "id"
                          ),
                          a!queryColumn(
                            field: "firstName"
                          ),
                          a!queryColumn(
                            field: "lastName"
                          ),
                          a!queryColumn(
                            field: "department"
                          ),
                          a!queryColumn(
                            field: "status"
                          )
                        }
                      ),
                      pagingInfo: fv!pagingInfo
                    ),
                    fetchTotalCount: true
                  ),
                  columns: {
                    a!gridColumn(
                      label: "First Name",
                      sortField: "firstName",
                      value: fv!row.firstName
                    ),
                    a!gridColumn(
                      label: "Last Name",
                      sortField: "lastName",
                      value: fv!row.lastName
                    ),
                    a!gridColumn(
                      label: "Department",
                      sortField: "department",
                      value: fv!row.department
                    ),
                    a!gridColumn(
                      label: "Status",
                      sortField: "status",
                      value: fv!row.status,
                      align: "END"
                    )
                  },
                  pageSize: 5,
                  initialSorts: {
                    a!sortInfo(
                      field: "lastName",
                      ascending: true
                    )
                  },
                  validations: {}
                )

Children
No Data