Message 1 of 2
Panel Schedule View - Get cell text
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm trying to export panel schedule content to Excel. See image below, I'm able to export what's in yellow. I still need to export what's in pink.
Here is the resume of what I tried :
PanelScheduleView psv = psView as PanelScheduleView;
TableData table = psv.GetTableData();
TableSectionData section = table.GetSectionData(SectionType.Header);
int nRows = section.NumberOfRows;
int nColumns = section.NumberOfColumns;
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(nCompteurFichier);
int nIndexLigne = 1;
int nIndexColonne = 1;
//HEADER
section = table.GetSectionData(SectionType.Header);
nRows = section.NumberOfRows;
nColumns = section.NumberOfColumns;
if (nRows > 1)
{
for (int i = 0; i < nRows; i++)
{
for (int j = 0; j < nColumns; j++)
{
//xlWorkSheet.Cells[nIndexLigne, nIndexColonne] = psv.GetCellText(SectionType.Header, i, j);
xlWorkSheet.Cells[nIndexLigne, nIndexColonne] = section.GetCellText(i, j);
nIndexColonne++;
}
nIndexColonne = 1;
nIndexLigne++;
}
}
//BODY
//I tried to look in PanelScheduleData and PanelScheduleView, samed result, empty
PanelScheduleData psd = psv.GetTableData();
section = psd.GetSectionData(SectionType.Body);
//section = table.GetSectionData(SectionType.Body);
nRows = section.NumberOfRows;
nColumns = section.NumberOfColumns;
//I did the same loop as for Header. So on for Footer and Summary
So as you can see, I have tried 2 ways of getting celltext.
I managed to find information by doing the following but it look complicated to get all the data with a loop.
xlWorkSheet.Cells[1, 1] = (psv.GetCircuitByCell(3, 4)).CircuitNumber;
xlWorkSheet.Cells[2, 1] = (psv.GetCircuitByCell(3, 4)).LoadClassifications;
xlWorkSheet.Cells[3, 1] = (psv.GetCircuitByCell(3, 4)).LoadName;
xlWorkSheet.Cells[4, 1] = (psv.GetCircuitByCell(3, 4)).PanelName;
xlWorkSheet.Cells[5, 1] = (psv.GetCircuitByCell(3, 4)).PhaseLabel;
I don't understand why I'm only getting the content in yellow ?
Also I'm not sure what's the difference between PanelScheduleView and PanelScheduleData ?
Thanks in advance for your help.