Print af Tlistview
Når vi prøver at printe følgende ud hvor vi har indsat columns og Items i vores Tlistview printer den kun items ud, men ikke overskriften på vores columns så hvordan skal det så gøresTListColumn *NewColumn;
TListItem *ListItem;
BalanceList->ViewStyle = vsReport;
NewColumn = BalanceList->Columns->Add();
NewColumn->Width = 99;
NewColumn->Caption = "Changes";
NewColumn = BalanceList->Columns->Add();
NewColumn->Width = 99;
NewColumn->Caption = "Kr.";
NewColumn = BalanceList->Columns->Add();
NewColumn->Width = 98;
NewColumn->Caption = "Balance";
FILE* f;
char path5[256];
sprintf(path5,"C:\\Programmer\\Borland\\CBuilder6\\Projects\\RS232\\Balance\\%s.txt",kort);
f = fopen(path5,"r");
while(!feof(f))
{
fscanf(f,"%d,%d,%f" ,&depo , &a , &u_saldo);
ListItem = BalanceList->Items->Add();
ListItem->Caption = dep.getstation(depo);
if(a == -4)
{
ListItem->SubItems->Add(dep.getstation(a));
}
else
{
ListItem->SubItems->Add(a);
}
ListItem->SubItems->Add(u_saldo);
}
fclose(f);