C# 怎么样改变Word语言设置

上述全部内容为这次对Word文档进行语言设置情势的叙说,文中对文档的习性设置在文档的保存与后来文档管理上实在也很有援助。希望本文能提供一定帮助,欢迎转载(转载请阐明出处)。感谢浏览!

本文链接:http://www.cnblogs.com/hhelibeb/p/7427753.html

注意:以下代码中,以挑选加泰罗尼亚语(秘鲁)为例,其他语言设置,可参见
Microsoft Locale ID
Values
.aspx)

4. CDS分析查询视图的访问控制。

1,在第3局部的CUBE CDS中成立一个分析查询视图。

@AbapCatalog.sqlViewName: 'Z05_CFLIGHTAQ'                       // Name of the CDS database view in the ABAP Repository
@AccessControl.authorizationCheck: #CHECK              // CDS authorizations, controls the authorization check. In S4H410 not required
@EndUserText.label: 'Available Flights'                         // Translatable short text. Max 60characters. Text label is exposed to Analytica tools and the OData service
@VDM.viewType: #CONSUMPTION                                     // This is a CONSUMPTION view
@Analytics.query: true                                          // By tagging the CDS view as an analytical query it will be exposed to the analytic manager
@OData.publish: true                                            // Generates a suitable OData service, that will use the analytical query, when the CDS entity is activated

define view Z05_C_FlightByAirportQuery as select from Z05_I_FlightByAirport     // A analytical query CDS is implemented using a query select from CDS view Z00_I_FlightByAirport
                                                                                // Take care with OData publishing the max. lenght is 26 characters
{
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column Airline
    Z05_I_FlightByAirport.Airline,                              // Use the column Airline
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column FlightConnection
    Z05_I_FlightByAirport.FlightConnection,                     // Use the column FlightConnection
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column FlightDate
    Z05_I_FlightByAirport.FlightDate,                           // Use the column FlightDate
    @Consumption.filter: {selectionType: #SINGLE, multipleSelections: false, mandatory: false }  // Creates a mandatory filter on the values in the field AirportFrom
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column AirportFrom
    @EndUserText.label: 'Departure Airport'                     // Add an human readable enduser label to make sure that we can differentiate between AirportFrom and AirportTo
    Z05_I_FlightByAirport.AirportFrom,                          // Use the column AirportFrom
    @Consumption.filter: {selectionType: #SINGLE, multipleSelections: false, mandatory: false } //  Creates an optional filter on the values in the field AirportTo
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column AirportTo
    @EndUserText.label: 'Arrival Airport'                       // Add an human readable enduser label to make sure that we can differentiate between AirportFrom and AirportTo 
    Z05_I_FlightByAirport.AirportTo,                            // Use the column AirportTo                             
    Z05_I_FlightByAirport.Currency,                             // Use the column Currency  
    Z05_I_FlightByAirport.AircraftType,                         // Use the column AircraftType
    @AnalyticsDetails.query.axis: #COLUMNS                      // Defines the default row/colums apperance for the column FlightPrice
    Z05_I_FlightByAirport.FlightPrice,                          // Use the column FlightPrice
    Z05_I_FlightByAirport.MaximumNumberOfSeats,                 // Use the column MaximumNumberOfSeats
    Z05_I_FlightByAirport.NumberOfOccupiedSeats,                // Use the column NumberOfOccupiedSeats
    @DefaultAggregation: #FORMULA                               // Important to know for formular placement is evaluation time. Inside the final query, the evaluation is done after the flightbyairport
                                                                // view aggragation, so it's not on a very detailed level or even row level, but at the aggragate level. This is important for avarages 
                                                                // as they cannot be evaluated at the detail level 
    @EndUserText.label: 'Available Seats'
    @AnalyticsDetails.query.axis: #COLUMNS                      // Defines the default row/colums apperance for the column NumberOfAvailableSeats
    Z05_I_FlightByAirport.MaximumNumberOfSeats - Z05_I_FlightByAirport.NumberOfOccupiedSeats as NumberOfAvailableSeats  // this is a formular (calculated column) 
} 

 

2,在HANA
Studio中举行数量预览,行数依然4894。看起来CDS分析查询没有利用到Cube
CDS视图权限,不过实际并非如此。你并不需要为分析查询CDS视图创立额外的访问控制。

3,在Excel中检查RSRT或者BO分析的结果。结果声明Cube
CDS视图的权柄在条分缕析查询中起到了效率。

图片 1

在意:在条分缕析查询定义中不需要创造任何变量,就像大家在蕴藏权限的BEx查询中这样。

4,修改Cube CDS视图,添加权力对象ZS_CONNID而非ZS_CARRID

@EndUserText.label: 'Role for Z05_I_FLIGHTBYAIRPORT'
@MappingRole: true
define role Z05_ROLE {
    grant select on Z05_I_FlightByAirport
     where ( FlightConnection) = aspect pfcg_auth (  ZS_CONNID,
                                                     CONNID,
                                                     actvt = '03' );

}

解析查询结果变得严刻了(在第2局部的第4步能够看看ZS_CONNID的定义).

现在结果的行数是212.

图片 2

对文档属性的设置如下图所示:

2) 字面条件示例(Literal conditions

DDL:

@AbapCatalog.sqlViewName: 'DEMO_CDS_LITERAL'
@AccessControl.authorizationCheck: #CHECK
define view demo_cds_auth_literal
 as select from
 scarr
 {
 key carrid,
 carrname,
 currcode,
 url
 };

DCL:

@MappingRole: true
define role demo_cds_role_literal {
  grant select on demo_cds_auth_literal
  where carrid = 'LH'; }

 

4) 字面条件和PFCG权限结合示例

DDL:

@AbapCatalog.sqlViewName: 'DEMO_CDS_LITPFCG'
@AccessControl.authorizationCheck: #CHECK
define view demo_cds_auth_lit_pfcg
 as select from
 scarr
 {
 key carrid,
 carrname,
 currcode,
 url
 };    

DCL:

@MappingRole: true
define role demo_cds_role_lit_pfcg {
  grant select on demo_cds_auth_lit_pfcg
  where (carrid) =
  aspect pfcg_auth (s_carrid, carrid, actvt='03') and
         currcode = 'EUR'; }
//创建一个Document类实例,并添加Section和Paragraph到Document
Document doc = new Document();
Section sec = doc.AddSection();
Paragraph para = sec.AddParagraph();
//向段落添加西班牙(秘鲁)语文字并设置文本对齐方式
TextRange txtRange = para.AppendText("Puedo escribir los versos más tristes esta noche.\n Escribir, por ejemplo: La noche está estrellada,y tiritan, azules, los astros, a lo lejos.\n El viento de la noche gira en el cielo y canta.\n Puedo escribir los versos más tristes esta noche.");
txtRange.CharacterFormat.LocaleIdASCII= 10250;
para.Format.HorizontalAlignment = HorizontalAlignment.Center;

 

步骤二:更改文本输入语言

1. 正规示例的访问控制例子

图片 3

正文的阐发基于自己正在利用的S4/HANA 1610 on NW 7.51.

using System;
using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;
  1. 业内示例的访问控制。
  2. 据悉PFCG权限创造一个大概的例证。
  3. 带有CUBE数据类其余CDS分析视图。
  4. CDS分析查询视图的访问控制。
  5. 权力对象的并集(UNION)或者夹杂(INTERSECTION)。

图片 4

6) 遵照近年来用户的权位控制示范

DDL:

@AbapCatalog.sqlViewName: 'DEMO_CDS_USR'
@AccessControl.authorizationCheck: #CHECK
define view demo_cds_auth_user
  as select from
    abdocmode
    {
      key uname,
      key langu,
          flag
    };  

DCL:

@MappingRole: true
define role demo_cds_role_user { 
  grant select on demo_cds_auth_user
    where
      uname ?= aspect user; }

具体步骤如下:

5) 继承权限示例

DDL:

@AbapCatalog.sqlViewName: 'DEMO_CDS_INH'
@AccessControl.authorizationCheck: #CHECK
define view demo_cds_auth_inherited
  as select from
    demo_cds_auth_lit_pfcg
    {
      key carrid,
          carrname,
          currcode,
          url
    };  

DCL:

@MappingRole: true
define role demo_cds_role_inherited {
  grant select on demo_cds_auth_inherited
               inherit demo_cds_role_lit_pfcg or currcode = 'USD'; }

在这多少个例子会呈现USD和EUR类型货币的笔录。

代码操作前准备

Hi!

姣好以上步骤后,运行该品种转移文书(可在该类型文件夹下bin>Debug下查看),如下图所示:图片 5

3. 分包CUBE数据类其余CDS分析视图

1,通过复制已有的内容创立我们协调的CDS视图。这是一个包含CUBE数据分类的CDS视图(译注:代码框出了点问题,我们集合看下..):

 

@AbapCatalog.sqlViewName: 'Z05_CFLIGHTAQ'                       // Name of the CDS database view in the ABAP Repository
@AccessControl.authorizationCheck: #CHECK              // CDS authorizations, controls the authorization check. In S4H410 not required
@EndUserText.label: 'Available Flights'                         // Translatable short text. Max 60characters. Text label is exposed to Analytica tools and the OData service
@VDM.viewType: #CONSUMPTION                                     // This is a CONSUMPTION view
@Analytics.query: true                                          // By tagging the CDS view as an analytical query it will be exposed to the analytic manager
@OData.publish: true                                            // Generates a suitable OData service, that will use the analytical query, when the CDS entity is activated

define view Z05_C_FlightByAirportQuery as select from Z05_I_FlightByAirport     // A analytical query CDS is implemented using a query select from CDS view Z00_I_FlightByAirport
                                                                                // Take care with OData publishing the max. lenght is 26 characters
{
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column Airline
    Z05_I_FlightByAirport.Airline,                              // Use the column Airline
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column FlightConnection
    Z05_I_FlightByAirport.FlightConnection,                     // Use the column FlightConnection
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column FlightDate
    Z05_I_FlightByAirport.FlightDate,                           // Use the column FlightDate
    @Consumption.filter: {selectionType: #SINGLE, multipleSelections: false, mandatory: false }  // Creates a mandatory filter on the values in the field AirportFrom
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column AirportFrom
    @EndUserText.label: 'Departure Airport'                     // Add an human readable enduser label to make sure that we can differentiate between AirportFrom and AirportTo
    Z05_I_FlightByAirport.AirportFrom,                          // Use the column AirportFrom
    @Consumption.filter: {selectionType: #SINGLE, multipleSelections: false, mandatory: false } //  Creates an optional filter on the values in the field AirportTo
    @AnalyticsDetails.query.axis: #ROWS                         // Defines the default row/colums apperance for the column AirportTo
    @EndUserText.label: 'Arrival Airport'                       // Add an human readable enduser label to make sure that we can differentiate between AirportFrom and AirportTo 
    Z05_I_FlightByAirport.AirportTo,                            // Use the column AirportTo                             
    Z05_I_FlightByAirport.Currency,                             // Use the column Currency  
    Z05_I_FlightByAirport.AircraftType,                         // Use the column AircraftType
    @AnalyticsDetails.query.axis: #COLUMNS                      // Defines the default row/colums apperance for the column FlightPrice
    Z05_I_FlightByAirport.FlightPrice,                          // Use the column FlightPrice
    Z05_I_FlightByAirport.MaximumNumberOfSeats,                 // Use the column MaximumNumberOfSeats
    Z05_I_FlightByAirport.NumberOfOccupiedSeats,                // Use the column NumberOfOccupiedSeats
    @DefaultAggregation: #FORMULA                               // Important to know for formular placement is evaluation time. Inside the final query, the evaluation is done after the flightbyairport
                                                                // view aggragation, so it's not on a very detailed level or even row level, but at the aggragate level. This is important for avarages 
                                                                // as they cannot be evaluated at the detail level 
    @EndUserText.label: 'Available Seats'
    @AnalyticsDetails.query.axis: #COLUMNS                      // Defines the default row/colums apperance for the column NumberOfAvailableSeats
    Z05_I_FlightByAirport.MaximumNumberOfSeats - Z05_I_FlightByAirport.NumberOfOccupiedSeats as NumberOfAvailableSeats  // this is a formular (calculated column) 
} 

2,在访问控制中开展定义:

@EndUserText.label: 'Role for Z05_I_FLIGHTBYAIRPORT'
@MappingRole: true
define role Z05_ROLE {
    grant select on Z05_I_FlightByAirport
    where ( Airline ) = 
    aspect pfcg_auth (  ZS_CARRID,
                        CARRID,
                        actvt = '03' );

}

3,在作品的第2有些,我们在权力对象中添加了ZS_CARRID。在HANA
Studio的数目预览中反省结果。行数是530.图片 6

 

4,在作业代码RSRT中反省结果,行数也是530。结果同样。

5,在BO Analysis for
Excel中检查结果。结果是一模一样的,对用户而言,只有选中的航空公司可以被访问。

 图片 7

注意:没有AF航空公司的事情数据,这是地点的屏幕未出示相关数据的原故。

手续四:添加文(加文)档属性(可按照需要活动安装文档内置属性或者自定义属性)

5. 权力的并集(UNION)和交集(INTERSECTION)

1,通过“AND”取权限的良莠不齐。这里定义了一个新的权限“ZS_FLDAT”,它只包含3天的限制(2015.02.04

  • 2015.02.06)。修改DCL,扩大混合:

    @EndUserText.label: ‘Role for Z05_I_FLIGHTBYAIRPORT’
    @MappingRole: true
    define role Z05_ROLE {

      grant select on Z05_I_FlightByAirport
       where ( Airline) = 
              aspect pfcg_auth (  ZS_CARRID,
                                  CARRID,
                                  actvt = '03' ) AND
             (FlightDate ) = 
              aspect pfcg_auth (  ZS_FLDAT,
                                  FLTDATE,
                                  actvt = '03' );
    

    }

图片 8

2,通过“OR”取并集:

@EndUserText.label: 'Role for Z05_I_FLIGHTBYAIRPORT'
@MappingRole: true
define role Z05_ROLE {
    grant select on Z05_I_FlightByAirport
     where ( Airline) = 
            aspect pfcg_auth (  ZS_CARRID,
                                CARRID,
                                actvt = '03' ) OR
           ( FlightDate ) = 
            aspect pfcg_auth (  ZS_FLDAT,
                                FLTDATE,
                                actvt = '03' );

}

图片 9

 3,假使在一个权力对象中添加这六个字段,这结果就接近于交集:

图片 10

@EndUserText.label: 'Role for Z05_I_FLIGHTBYAIRPORT'
@MappingRole: true
define role Z05_ROLE {
    grant select on Z05_I_FlightByAirport
     where ( Airline, FlightDate) = 
            aspect pfcg_auth (  ZS_NEW,
                                CARRID,
                                FLTDATE,
                                actvt = '03' );

图片 11

注意:无须遗忘在Cube
CDS视图的层级定义权限,而非分析视图层级。
比方您在解析查询层级定义了和第5有的一律的权力,那么:

  • 在SAP HANA Studio的数码预览中,结果看起来是对的。
  • 在RSRT, BO Analysis for
    Excel和此外使用了OLAP引擎的工具中,使用的是Cube
    CDS视图的权力(如有定义)。

注意:在HANA
Studio的数码预览中,分析查询的结果会全部来得。为了纠正这一点,可以给分析查询创造以下访问控制:

@MappingRole: true
define role Z05_ROLE_2 {
  grant select on Z05_C_FlightByAirportQuery 
               inherit Z05_ROLE; }

敲定:你可以为CDS分析视图定义权限的混杂或者并集。

 

正文停止,感谢关注!

 

英文原稿:ABAP CDS views with Authorization based on Access
Control

 

安装Spire.Doc for
.NET之后,添加引用Spire.Doc.dll文件到品种程序集,同时加上相应的using指令到命名空间。

1) 全访问示例(Full access

DDL:

@AbapCatalog.sqlViewName: 'DEMO_CDS_FULLACC'
@AccessControl.authorizationCheck: #CHECK
define view demo_cds_auth_fullaccess
  as select from
    scarr
    {
      key carrid,
          carrname,
          currcode,
          url
    };  

 DCL:

@MappingRole: true
define role demo_cds_role_fullaccess {
  grant select on demo_cds_auth_fullaccess; }

手续三:设置试图形式为Web视图,调整视图缩放比例

2. 基于PFCG权限创造一个大概的例证

复制以下代码,创设我们协调的CDS视图:

@AbapCatalog.sqlViewName: 'ZDEMO_CDS_PFCG'
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Demo access pfcg'
define view Zdemo_Access_Pfcg as select from scarr
 {
 key carrid,
 carrname,
 currcode,
 url
 };   

3,现在,倘诺在HANA
Studio中开辟数据预览,我们将得以看到装有记录。访问控制最近还不设有。

图片 12

2,在SU21创办大家协调的自定义权限对象:

图片 13

对此每个对象定义权限字段和活动字段,参加允许活动“03
展现”。在本示例中,大家要在ZS_CONNID中添加字段CARRID和CONNID。

图片 14

图片 15

3,为ZS_CARRID创建数量控制。

@MappingRole: true
define role zdemo_access_pfcg {
  grant select on Zdemo_Access_Pfcg
  where (carrid) =
  aspect pfcg_auth (zs_carrid, carrid, actvt='03'); }

4,在PFCG中开创一个新的角色,在此间充足刚刚创造的权杖对象,定义用户应当看到的按照采取字段的数据。不要忘记生成配置。为我们的用户分配角色。

在首先个示范中,我们只利用ZS_CARRID。在篇章的前边,我们会用到另外的对象。

图片 16

图片 17

5,回到HANA Studio来测试权限。打开大家的CDS视图的数目预览:

图片 18

当今大家只看到了概念好的飞行集团(CARRID)字段的记录。

注意:

  1. 假使在ABAP字典(SE11)中开辟视图,结果会是整套数额记录。
  2. 如若在DDL中修改声明为如下内容,并激活CDS视图,大家将得以另行在数量预览中来看任何数码。那意味检查已经倒闭。

    @AccessControl.authorizationCheck: #NOT_ALLOWED

结论:在一个从数据库表中查询数据的简便例子中,大家见到了访问控制是哪些做事的。下面讲讲CDS分析视图。

手续一:添加如下命名空间

对每一个CDS视图,我们都可以透过DCL(Data Control
Language)定义访问控制。在这篇随笔中,我会介绍ABAP
CDS视图中异常首要的单方面:权限管理。

doc.ViewSetup.DocumentViewType = DocumentViewType.WebLayout;
doc.ViewSetup.ZoomPercent = 120;
doc.ViewSetup.ZoomType = ZoomType.None;

3) PFCG权限示例

DDL:

@AbapCatalog.sqlViewName: 'DEMO_CDS_PFCG'
@AccessControl.authorizationCheck: #CHECK
define view demo_cds_auth_pfcg
 as select from
 scarr
 {
 key carrid,
 carrname,
 currcode,
 url
 }; 

DCL:

@MappingRole: true
define role demo_cds_role_pfcg {
  grant select on demo_cds_auth_pfcg
  where (carrid) =
  aspect pfcg_auth (s_carrid, carrid, actvt='03'); }

 权限对象s_carrid可以在工作代码SU21中的BC_C object类下查到。

步骤五:保存并打开文档

内容分成六个部分:

doc.SaveToFile("Sample.doc", FileFormat.Doc);
System.Diagnostics.Process.Start("Sample.doc");

诚如在开立或者打开一个Word文档时,假诺没有进展过分外装置的话,系统默认的输入语言的是波兰语输入,然则为适应不同的办公室条件,大家实际上是亟需对文字嵌入的语言举办切换的,因而,本文将介绍怎样采纳免费版组件Free
Spire.Doc for
.NET
来贯彻Word语言输入。另外,针对这款组件的多种Word操作功用,如,设置文档属性、文档视图形式等,本文中也将作进一步演示演示。

//添加文档属性(内置属性)
doc.BuiltinDocumentProperties.Title = "测试文件";
doc.BuiltinDocumentProperties.Category = "非机密文档";
doc.BuiltinDocumentProperties.Author = "James";
doc.BuiltinDocumentProperties.LastAuthor = "Mia";
doc.BuiltinDocumentProperties.Keywords = "Word文档, 属性, 样本";
doc.BuiltinDocumentProperties.Comments = "此文档仅供测试使用";
doc.BuiltinDocumentProperties.Subject = "Demo";

//添加文档属性(自定义属性)
CustomDocumentProperties custom = doc.CustomDocumentProperties;
custom.Add("Authorized Date", DateTime.Today);

Post Author: admin

发表评论

电子邮件地址不会被公开。 必填项已用*标注