# 获取数据库主表数据

<div align="left"><figure><img src="/files/ejBZZeDrq5sOKCU38C1E" alt=""><figcaption></figcaption></figure></div>

下面描述中使用的图片是PostgreSQL协作的图片。 \
其他数据库协作具有相同的画面结构。

## 功能概要

* **输入结果的登录**是将i-Reporter协作到数据库。

<table><thead><tr><th>协作方向</th><th width="240.33333333333331">功能说明</th><th>执行时间</th></tr></thead><tbody><tr><td>数据库→i-Reporter协作</td><td>使用ConMas Gateway将数据库数据获取到i-Reporter报告的主表选择功能区中。</td><td>获取i-Reporter的主表选择功能区的数据</td></tr></tbody></table>

## 映射设置的步骤

按照下面的步骤设置映射。

### 1. 选择数据库协作模式

* 单击**获取数据库主表数据**菜单添加新的映射。

<figure><img src="/files/m18UrMsPsQGINz8K9d8y" alt=""><figcaption></figcaption></figure>

### 2. 设置映射编码/映射名称

* 设置**映射编码**和**映射名称**。
* 映射编码是**唯一标识 i-Repo Link 环境中所有映射配置的密钥**。

<figure><img src="/files/6G2B3heZp25PIQQaOlga" alt=""><figcaption></figcaption></figure>

### 3. 选择协作源的数据源和表/视图

* 选择数据库数据源和表或视图作为协作源。

<figure><img src="/files/ewqsmZIxyUB58qLIC8S5" alt=""><figcaption></figcaption></figure>

* 请参考下面的页面来添加和配置数据源。

{% content-ref url="/pages/Mr8iIh9WBLvgsGDHpX6I" %}
[数据源](/i-repo-link-manual/chinese/system/2/1.md)
{% endcontent-ref %}

### 4. 创建从数据库获取主表数据的字段配置

* 创建用于ConMas Designer的主表选择功能区的Gateway连接的主表数据的字段配置。（创建自定义主表布局）

<figure><img src="/files/jAnX3a5ugbubeQUlro11" alt=""><figcaption></figcaption></figure>

### 5. Gateway设置

* 请**下载ConMas Gateway的action文件或将action文件放置在Gateway服务器上**。 \
  如果要将action文件放置在Gateway服务器上的时候，请提前在**系统中配置“ConMas Gateway”设置**。
* 将Gateway的参数更新到相应的报表定义的动作功能区。 \
  **更新参数后报表定义的版本将上升**。

<figure><img src="/files/ofsACYobV3qRTAtoNLbA" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**关于使用“放置到Gateway”按钮的ConMas Gateway的Config文件设置**

需要使用ConMas Gateway 2.1.230200 及以上版本。 \
请修改ConMas Gateway的配置文件。 \
配置文件的默认位置：C:\ConMas\gateway\Config\Default .json \
用记事本等打开配置文件，并添加下面末尾描述的“runMode”设置。

**default.json 文件设置**

```json
{
  "port": 3000,
  "ssl": false,
  "sslkey": "./ssl/cert.key",
  "sslcert": "./ssl/cert.pem",
  "authType": "default",
  "token": "令牌",
  "pythonShell": {
    "mode": "text",
    "encoding": "utf8",
    "pythonOptions": ["-X", "utf8"]
  },
  "uploadFileTypes": {
    "binary": "bmp;gif;jpg;tif;png;wav",
    "text": ""
  },
  "customMaster": {
    "limit": 500
  }
  添加以下内容（在开头加逗号）
  ,
    "runMode": {
    "maintenance": true
  }
  以上
}
```

{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cimtops.gitbook.io/i-repo-link-manual/chinese/cai-dan/huo-qu-shu-ju-ku-zhu-biao-shu-ju.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
