캘린더 속성
회계 연도 재산
회계 연도는 회계 연도 또는 예산 연도와 동일합니다. 국가, 조직 또는 개인이 예산 및 세금을 계산 한 날짜입니다. Microsoft Project를 사용하면 사용자가 프로젝트 회계 연도를 정의 할 수 있습니다. C ++ 용 Tasks는 개발자가 기존 프로젝트의 회계 연도 속성을 읽고 프로젝트를 작성하거나 작업 할 때 회계 연도 부동산을 설정할 수있는 속성을 사용 하여이 기능을 지원합니다.
PRJ 클래스는 프로젝트의 회계 연도를 관리하는 데 사용되는 FystartDate 및 FISCALYAERSTART 속성을 노출시킵니다.
FYSTARTDATE : 회계 연도 시작 달을 정의하고 달 열거에 의해 정의 된 값 중 하나를 지원합니다.
FISCALYEARSTART : 회계 연도 번호가 프로젝트에 사용되었는지 여부를 결정합니다. 부울.
Reading Fiscal Year Properties
The FyStartDate and FiscalYearStart properties make it easy to find out what the current fiscal year start date is, and whether fiscal year numbering is used, with Aspose.Tasks .
The code example given below demonstrates how to read a project’s fiscal year properties and displays them in a console window.
1// The path to the documents directory.
2System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
3
4// Create a project instance
5System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"ReadFiscalYearProperties.mpp");
6
7// Display fiscal year properties
8System::Console::WriteLine(System::String(u"Fiscal Year Start Date : ") + System::ObjectExt::ToString(project->Get<Month>(Prj::FyStartDate())));
9System::Console::WriteLine(System::String(u"Fiscal Year Numbering : ") + System::ObjectExt::ToString(project->Get<NullableBool>(Prj::FiscalYearStart())));
Writing Fiscal Year Properties
To see fiscal year properties in Microsoft Project:
Open a project file.
On the Tools menu, click Options.
Click the Calendar tab. It will look like the one shown below.
The code example given below demonstrates how to write the fiscal year properties of the project.
1// The path to the documents directory.
2System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
3
4// Create a project instance
5System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"WriteFiscalYearProperties.mpp");
6
7// Set fiscal year properties
8project->Set<Month>(Prj::FyStartDate(), Aspose::Tasks::Month::July);
9project->Set<NullableBool>(Prj::FiscalYearStart(), NullableBool::to_NullableBool(true));
10project->Save(dataDir + u"WriteFiscalYearProperties_out.mpp", Aspose::Tasks::Saving::SaveFileFormat::MPP);
Weekday Properties
Microsoft Project lets users set a number of different weekday properties. For example, what day a week starts on and how many working days are in a month. Aspose.Tasks for C++ support these features through a number of properties that can be used both to read weekday properties and to write them to a project.
Aspose.Tasks for C++ has a series of properties, exposed by the Prj class, specifically for managing a project’s weekday properties:
WeekStartDay: the first day of the week. This property takes values defined by the DayType enumeration.
DaysPerMonth: the number of working days in a month, passed as an integer.
MinutesPerDay: the number of working minutes in a working day, passed as an integer.
MinutesPerWeek: the number of working minutes in a working week, passed as an integer.
Reading Weekday Properties
The code example given below demonstrates how to read a project’s weekday properties and writes them to a console window.
1// The path to the documents directory.
2System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
3
4// Create project instance
5System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"ReadWeekdayProperties.mpp");
6
7// Display week days properties
8System::Console::WriteLine(System::String(u"Week Start Date : ") + System::ObjectExt::ToString(project->Get<DayType>(Prj::WeekStartDay())));
9System::Console::WriteLine(System::String(u"Days Per Month : ") + System::Convert::ToString(project->Get<int32_t>(Prj::DaysPerMonth())));
10System::Console::WriteLine(System::String(u"Minutes Per Day : ") + System::Convert::ToString(project->Get<int32_t>(Prj::MinutesPerDay())));
11System::Console::WriteLine(System::String(u"Minutes Per Week : ") + System::Convert::ToString(project->Get<int32_t>(Prj::MinutesPerWeek())));
Writing Weekday Properties
To see weekday properties in Microsoft Project:
Open a file.
On the Tools menu, click Options.
Select the Calendar tab. It will look something like the example below.
Viewing weekday properties in Microsoft Project
The code example given below demonstrates how to write weekday properties, as shown in the screenshot above, to a project.
1// The path to the documents directory.
2System::String dataDir = RunExamples::GetDataDir(System::Reflection::MethodBase::GetCurrentMethod(ASPOSE_CURRENT_FUNCTION)->get_DeclaringType().get_FullName());
3
4// Create a project instance
5System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"WriteWeekdayProperties.mpp");
6
7// Set week days properties
8project->Set<DayType>(Prj::WeekStartDay(), Aspose::Tasks::DayType::Monday);
9project->Set<int32_t>(Prj::DaysPerMonth(), 24);
10project->Set<int32_t>(Prj::MinutesPerDay(), 540);
11project->Set<int32_t>(Prj::MinutesPerWeek(), 3240);
12project->Save(dataDir + u"WriteWeekdayProperties_out.xml", Aspose::Tasks::Saving::SaveFileFormat::XML);