Unofficial Content
  • This documentation is valid for:

Gxquery4 - GXqueryOutputFormat data type

The GXquery service layer, known as API, includes all the data types that allow the developer to interact with GXquery at runtime through script code. One of these data types is described below.

Queries can have more than one output format, and this data type is used to know what  they are and choose one before display.

Properties

Id Is the output format Id.
Title Is the output format Title.
IsDefault Is a boolean indicator to confirm if the current format is the default one.
ChartType Is the chart type. Has an empty value if the OutputType property has "PivotTable" value or "Table" value.
OutputType Store the output type of the query. There are three possible values: "Table", "PivotTable" or "Chart". If "Chart", the ChartType property store its type.

 

Example

In this example, a Query contains many output formats for the end user, which can choose one. To solve this case, the developer wrote the script code, as below.

Event 'GetInformation'
    &GXqueryQuery = &GXquerySession.GetQueryByName(&QueryName, &Errors)
    If &Errors.Count > 0
        &Status = &Errors.Item(1).Message
    Else
        &GXqueryQueryInfo = &GXqueryQuery.GetInformation(&Errors)
        If &Errors.Count > 0
            &GetQueryInfoStatus = &Errors.Item(1).Message
        Else
            &GetQueryInfoStatus = "GetInformation successful"
            &OutputFormatId.Clear()
            For &GXqueryOutputFormat in &GXqueryQueryInfo.OutputFormats
                &OutputFormatId.AddItem(&GXqueryOutputFormat.Id, Iif(&GXqueryOutputFormat.Title <> "", &GXqueryOutputFormat.Title, &GXqueryOutputFormat.id))
            EndFor
            &ParameterName.Clear()
            For &GXqueryParameter in &GXqueryQueryInfo.Parameters
                &ParameterName.AddItem(&GXqueryParameter.Name, Iif(&GXqueryParameter.Description <> "", &GXqueryParameter.Description, &GXqueryParameter.Name))
            EndFor
        EndIf
    EndIf
EndEvent

The GetInformation was created for: if the query has more than one output format, give the user the posibility to choose one, too. So, to understand this, we will analyze some parts of the script code.

With the first statement we ask the name of the chosen query from the &QueryName combo box; after first Else, we execute the GetInformation method to obtain the name and other information, which is not relevant right now.

With the first For command, the dynamic combo box called &GXqueryOutputFormat, is loaded with the output format IDs.

With the second For command, the combo box called &GXqueryParameter, is loaded with the parameters list (if there are).

In this way, the combo box is ready for the end user to select one output format.

 


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant