목차 숨기기

Formatting a Report Query

Report queries contain structured information that displays the report in the Report Generator and one or more SQL queries that retrieve information from the SQL database.

You create the queries in a text editor such as Notepad and save them as .crp files.

To format a report query:

  1. Open a text editor such as Notepad.
  2. Create a report query using the following elements:

    Syntax Example
    @[query_identifier]
    @[GroupMembers]
    쬛ame [display_name]
    쬛ame [User details of selected groups]
    쬍ompany [company_name]
    쬍ompany [SOLIDWORKS]
    쬎escription [description]
    쬎escription 
    [Lists all members of the selected groups.]
    쬥ersion [version_number]
    쬥ersion [1.1]
    쬋rguments
    [
    type name[count] [instruct]
    ]

    Where:

    • type is a predefined argument type

    • name is a variable used in the WHERE element of the SQL query

    • [count] defines how values are returned to the SQL query

    • [instruct] appears in the Report Generator as a user instruction

    A report query can have multiple arguments.

    All components of the argument must be on one line.
    쬋rguments 
    [
    GroupID TheGroupID[N] [Select groups]
    ]
    쬢ql
    [
    ]
    쬢ql
    [
    ]

  3. In Microsoft SQL Server Management Studio, create a T-SQL query to retrieve information from the SQL database.
  4. Copy the SQL query and paste it into the 쬢ql [ ] section of the report query.
  5. Optionally, modify the WHERE element of the SQL query if you want an argument to be dynamically evaluated when the report is run in the report generator.

    In step 2, the Argument is [GroupID TheGroupID[N] [Select groups]]. You can use the variable name TheGroupID to return data based on the group selected by the user when the report is run.

    To accomplish this, in the following T-SQL query syntax, you would replace G.GroupID = 2 with {G.GroupID, TheGroupID, =, OR}.

    T-SQL query syntax
    WHERE G.GroupID = 2 AND
                   G.GroupID = M.GroupID AND 
                   U.UserID = M.UserID
    Report query syntax
    WHERE {G.GroupID, TheGroupID, =, OR} AND
           G.GroupID = M.GroupID AND
           U.UserID = M.UserID]

  6. Save the query as a .crp file.
  7. Import the .crp file into the Report Generator to run the report.

Report Query Example

The following report query is from Report Examples 1.crp, which is installed to install_dir, by default C:\Program Files\SOLIDWORKS Enterprise PDM.

@[GroupMembers]
쬛ame [User details of selected group(s)]

쬍ompany [SOLIDWORKS]

쬎escription
[This query will list all members of the selected groups.]

쬥ersion [1.1]

쬋rguments
[
GroupID	TheGroupID[N] [Select group(s)]
]

쬢ql
[
SELECT U.Username, G.Groupname, G.Description
FROM Users U, Groups G, GroupMembers M
WHERE {G.GroupID, TheGroupID, =, OR} AND
      G.GroupID = M.GroupID AND
      U.UserID = M.UserID
]

This file contains additional report queries that a user can import into the Report Generator.



이 도움말에 대한 피드백 제공

SOLIDWORKS는 도움말 정보의 개선을 위한 고객님의 제안 사항과 의견을 환영합니다. 제안하고자 하는 의견을 아래 양식에 작성하여 도움말 문서 팀에 직접 전달할 수 있습니다. 문서 팀은 제품에 관한 기술적인 지원은 하지 않습니다. 기술 지원에 관한 정보는 여기를 클릭하십시오.

* 필수 입력

 
*전자 메일:  
제목:   도움말에 대한 피드백
페이지:   Formatting a Report Query
*사용자 의견:  
*   개인정보 보호정책을 읽었으며 본 정책에 따라 Dassault Systèmes에서 내 개인 정보를 사용하는 것에

인쇄 항목

인쇄할 콘텐츠 범위 선택:

x

Internet Explorer 7 이전 버전을 사용하고 있습니다. 페이지를 최적화하려면 사용 브라우저를 Internet Explorer 7 이상으로 업그레이드합니다.

 이 메시지를 다시 표시하지 않음
x

웹 도움말 콘텐츠 버전: SOLIDWORKS PDM 2014 SP05

SOLIDWORKS에서 웹 도움말 기능을 비활성화하고 로컬 도움말을 사용하려면, 도움말 > SOLIDWORKS 웹 도움말 사용을 클릭합니다.

웹 도움말 인터페이스나 검색 기능에서 발생한 오류 사항을 보고하려면, 로컬 지원 서비스 담당자에게 문의하십시오. 개별 도움말 항목에 대한 피드백을 제공하려면, 각 도움말 페이지의 "이 단원에 대한 피드백 제공" 링크를 사용하십시오.