combit List & Label 30 - .NET Help
combit.Reporting Namespace / ProjectParameter Class / ValueFromProjectFile Method

Full filename (and path) of the project file.

Example


ValueFromProjectFile Method

Returns the value of the project parameter in the specified project.

For example the values of the project parameters can be obtained before print start. This is particularly helpful if custom project parameters are declared that can be changed in the Designer by the user (LlProjectParameterVisibility).

Syntax
'Declaration
 
Public Function ValueFromProjectFile( _
   ByVal projectFile As String _
) As String
 

Parameters

projectFile

Full filename (and path) of the project file.

Return Value

Value of the project parameter as string.
Remarks

With project parameters that use formulas the formula (not evaluated!) is returned.

Always the project parameter specified in the Name Property is queried.

Example
Below a new project parameter is added and the Designer is called. Afterwards the project parameter - probably by the user in the Designer - is queried.
// Add custom project parameter
string myParamName = "MyParamName";
ProjectParameter myProjectParameter = LL.ProjectParameters.NewParameter(myParamName); 
myProjectParameter.ParameterType = LlProjectParameterType.Value; 
myProjectParameter.Value = "MyParamValue"; 
myProjectParameter.SaveDefaultValue = true;
LL.ProjectParameters.Add(myProjectParameter);

// Call Designer
string projectFile = @"C:\temp\sample.lst";
LL.Design(LlProject.List, projectFile);

// Query custom project parameter
string myParamValue = myProjectParameter.ValueFromProjectFile(projectFile);
' Add custom project parameter
Dim myParamName As String = "MyParamName"
Dim myProjectParameter As ProjectParameter = LL.ProjectParameters.NewParameter(myParamName)
myProjectParameter.ParameterType = LlProjectParameterType.Value
myProjectParameter.Value = "MyParamValue"
myProjectParameter.SaveDefaultValue = True
LL.ProjectParameters.Add(myProjectParameter)

' Call Designer
Dim projectFile As String = "C:\temp\sample.lst"
LL.Design(LlProject.List, projectFile)

' Query custom project parameter
Dim myParamValue As String = myProjectParameter.ValueFromProjectFile(projectFile)
Requirements

Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9

See Also