# SendEventReportEX

### int SendEventReportEx(int CEID, int nTransactionID)

EZGemPlus에 등록된 CEID를 S6F11W Send Event Report 메시지로 전송하는 함수.

전송 시 사용자가 지정한 Transaction ID를 부여하여 S6F11W 메시지 전송 후(SendEventReportEx 함수 호출 후) 해당 메시지의 System Byte를 GetSysByteEx(nTransactionID) 함수를 이용하여 반환 받을 수 있습니다.

{% hint style="info" %}
TransactionID를 통해 어떤 이벤트인지 특정할 수 있습니다. TransactionID가 0보다 클경우 TransactionID로 사용할 수 있고 0보다 작을경우는 파일로 저장해서 추후 SendMsgFromFile로 전송할 수 있습니다.
{% endhint %}

Parameters

<table data-header-hidden><thead><tr><th width="191" valign="top"></th><th width="88" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Name</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">CEID</td><td valign="top">int</td><td valign="top">전송하고자 하는 CEID</td></tr><tr><td valign="top">nTransactionID</td><td valign="top">int</td><td valign="top">사용자 지정 Transaction ID</td></tr></tbody></table>

{% code title="TransactionID를 0보다 큰 수로 설정한 경우" %}

```csharp
// 1. 관리용 트랜잭션 ID 정의 (예: 현재 작업 번호 등)
    int myTransID = 5001; 

    // 2. 확장형 이벤트 보고 함수 호출
    int nResult = m_gem.SendEventReportEx(nCeid, myTransID);

    if (nResult >= 0)
    {
        // 3. 전송 직후, 부여한 트랜잭션 ID를 이용해 실제 SECS 메시지의 System Byte 확인
        // (주의: GetSysByteEx 함수가 별도로 구현되어 있어야 함)
        // uint systemByte = m_gem.GetSysByteEx(myTransID);
        
        Console.WriteLine($"이벤트 보고 성공: CEID {nCeid}, TransID {myTransID}");
    }
    else
    {
        Console.WriteLine($"이벤트 보고 실패: {nResult}");
    }
```

{% endcode %}

***

{% code title="TransactionID를 0보다 작은 수로 설정한 경우" %}

```csharp
 m_gem.SendEventReportEx(1003, -1);
```

{% endcode %}

<figure><img src="/files/tocpTDtQ7MAg0Xqv0uxc" alt=""><figcaption><p>SavedMsg폴더가 생성되며 </p></figcaption></figure>

<figure><img src="/files/IxchzlaLOikeeImcHIll" alt=""><figcaption><p>사용자가 지정한 이벤트가 파일로 저장됩니다.</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://nviasoft.gitbook.io/nviasoft-docs/api-reference/undefined-4/sendeventreportex.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.
