Venice
Project::DeleteDetail
 
Deletes a project detail.
 
void DeleteDetail (
    SHORT sIndex
)
 
Parameters
sIndex
[in] The index of the project detail.

Remarks
This number is a 0-based index, i.e. it starts from 0.
Each project detail has a sequence number that is shown in the dialog of your Venice installation. This number can be used to reference a project detail but does not have to be equal to the index that has to be used here. When deleting project details sequence numbers are not renumbered and therefore gaps can occur. The SDK internally uses indexes where no gaps are allowed. The method IndexFromSeqNum returns the index to be used for a given sequence number.
 
Remarks
If no project detail is found with the given parameter sIndex an exception is thrown. You can use GetDetail to check whether an index is valid, in which case it returns the sequence number of the detail otherwise -1.
 
See Also
CreateProject
Handling projects using the SDK
PrepareProject
GetNumDetails
GetDetail
CancelProject
WriteProject
 
Samples
 
C++
 
// Delete the project details with channel 'Internal communication'
VARIANT vChannel;
short sNumDetails;
bool bWrite = false;

pProject->PrepareProject (paUpdate);

sNumDetails = pProject->GetNumDetails ();

for (short sDetail = 0; sDetail < sNumDetails; ++sDetail)
{
    if (pProject->GetDetail (sDetail, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &vChannel, NULL, NULL, NULL) != -1 && vChannel.bVal == chInternal)
    {
        pProject->DeleteDetail (sDetail);
        bWrite = true;
    }
}

if (bWrite)
    pProject->WriteProject (rmFullReport);
else
    pProject->CancelProject ();

C#
 
// Delete the project details with channel 'Internal communication'
object oChannel, oDummy;
short sNumDetails;
bool bWrite = false;

oProject.PrepareProject (ePrepareAction.paUpdate);

sNumDetails = oProject.GetNumDetails ();

for (short sDetail = 0; sDetail < sNumDetails; ++sDetail)
{
    if (oProject.GetDetail (sDetail, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oDummy, out oChannel, out oDummy, out oDummy, out oDummy) != -1 && (eChannel)Enum.ToObject(typeof(eChannel), oChannel) == eChannel.chInternal)
    {
        oProject.DeleteDetail (sDetail);
        bWrite = true;
    }
}

if (bWrite)
    oProject.WriteProject (eReportMode.rmFullReport);
else
    oProject.CancelProject ();

VBS
 
' Delete the project details with channel 'Internal communication'
Dim oChannel, oDummy
Dim sNumDetails
Dim bWrite

bWrite = False

Call oProject.PrepareProject(paUpdate)

sNumDetails = oProject.GetNumDetails()

For sDetail = 0 To sNumDetails - 1
    If oProject.GetDetail(sDetail, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oChannel, oDummy, oDummy, oDummy) <> -1 And oChannel = chInternal Then
        Call oProject.DeleteDetail(sDetail)
        bWrite = True
    End If
Next

If bWrite Then
    Call oProject.WriteProject(rmFullReport)
Else
    Call oProject.CancelProject()
End If

VB.NET
 
' Delete the project details with channel 'Internal communication'
Dim oChannel, oDummy As Object
Dim sNumDetails As Short
Dim bWrite As Boolean

bWrite = False

oProject.PrepareProject(ePrepareAction.paUpdate)

sNumDetails = oProject.GetNumDetails()

For sDetail As Short = 0 To sNumDetails - 1
    If oProject.GetDetail(sDetail, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oDummy, oChannel, oDummy, oDummy, oDummy) <> -1 And oChannel = eChannel.chInternal Then
        oProject.DeleteDetail(sDetail)
        bWrite = True
    End If
Next

If bWrite Then
    oProject.WriteProject(eReportMode.rmFullReport)
Else
    oProject.CancelProject()
End If