combit List & Label 29 - .NET Help
combit.Reporting Namespace / PreviewFile Class / GetProjectParameterValue Method
Name of the project parameter to be queried. The prefix "ProjectParameter." must be used for the call.
Example


In This Topic
    GetProjectParameterValue Method
    In This Topic
    ProjectParameters from a preview file can be queried hereby.
    Syntax
    'Declaration
     
    
    Public Function GetProjectParameterValue( _
       ByVal parameterName As String _
    ) As String
    public string GetProjectParameterValue( 
       string parameterName
    )
    public:
    String^ GetProjectParameterValue( 
       String^ parameterName
    ) 

    Parameters

    parameterName
    Name of the project parameter to be queried. The prefix "ProjectParameter." must be used for the call.

    Return Value

    Returns the value of the queried project parameter parameterName as string.
    Example
    A project parameter is queried directly from a preview file below.
    // Create new project parameter
    ProjectParameter projectParameter = LL.ProjectParameters.NewParameter("MyParamName"); 
    projectParameter.ParameterType = LlProjectParameterType.Value; 
    projectParameter.Value = "MyParamValue"; 
    projectParameter.SaveDefaultValue = True; 
    LL.ProjectParameters.Add(projectParameter); 
     
    // Additional code (Calling the Designer, create preview file...)
    // ... 
     
    // Query the project parameter from the preview file
    PreviewFile previewFile = New PreviewFile(@"C:\temp\sample.ll"); 
    MessageBox.Show(previewFile.GetProjectParameterValue("ProjectParameter." + projectParameter.Name));
    ' Create new project parameter
    Dim projectParameter As ProjectParameter = LL.ProjectParameters.NewParameter("MyParamName")
    projectParameter.ParameterType = LlProjectParameterType.Value
    projectParameter.Value = "MyParamValue"
    projectParameter.SaveDefaultValue = True
    LL.ProjectParameters.Add(projectParameter)
    
    ' Additional code (Calling the Designer, create preview file...)
    ' ...
    
    ' Query the project parameter from the preview file
    Dim previewFile As New PreviewFile("C:\temp\sample.ll")
    MessageBox.Show(previewFile.GetProjectParameterValue("ProjectParameter." + projectParameter.Name))
    Requirements

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

    See Also