M
Mark
Hi -
I'm developing a Excel 2007 worksheet that uses cube functions. The cells
holding cube functions refresh everytime I click on a different ID stored in
a datagrid. So when I click a different ID in the datagrid, the worksheet
populates with the data in the grid which is associated with the ID. Simple
enough (once you know what to do).
The problem I'm having is with the print program ... I wrote a program to
move through the datagrid one ID at a time and then use PrintOutEx to print
the exhibit. Well, the cells with the cube functions won't update or refresh
themselves, showing blank values instead.
The code is as follows:
private void btnPrinter_Click(object sender, EventArgs e)
{
Excel.Workbook currentWB = (Excel.Workbook)
Globals.ThisWorkbook.Application.ActiveWorkbook;
Object missing = System.Reflection.Missing.Value;
Globals.Sheet2.tblUserInterface_MasterBindingSource.MoveFirst();
currentWB.RefreshAll();
int n = 1;
do
{
Globals.Sheet1.PrintOutEx(1, 1, 1, false, missing, missing, missing,
missing, false);
Globals.Sheet2.tblUserInterface_MasterBindingSource.MoveNext();
currentWB.RefreshAll();
n++;
}
while (n <= 5);
//while (n <= Globals.Sheet2.tblUserInterface_MasterBindingSource.Count);
}
Obviously any comments are appreciated.
Thank You
Mark
I'm developing a Excel 2007 worksheet that uses cube functions. The cells
holding cube functions refresh everytime I click on a different ID stored in
a datagrid. So when I click a different ID in the datagrid, the worksheet
populates with the data in the grid which is associated with the ID. Simple
enough (once you know what to do).
The problem I'm having is with the print program ... I wrote a program to
move through the datagrid one ID at a time and then use PrintOutEx to print
the exhibit. Well, the cells with the cube functions won't update or refresh
themselves, showing blank values instead.
The code is as follows:
private void btnPrinter_Click(object sender, EventArgs e)
{
Excel.Workbook currentWB = (Excel.Workbook)
Globals.ThisWorkbook.Application.ActiveWorkbook;
Object missing = System.Reflection.Missing.Value;
Globals.Sheet2.tblUserInterface_MasterBindingSource.MoveFirst();
currentWB.RefreshAll();
int n = 1;
do
{
Globals.Sheet1.PrintOutEx(1, 1, 1, false, missing, missing, missing,
missing, false);
Globals.Sheet2.tblUserInterface_MasterBindingSource.MoveNext();
currentWB.RefreshAll();
n++;
}
while (n <= 5);
//while (n <= Globals.Sheet2.tblUserInterface_MasterBindingSource.Count);
}
Obviously any comments are appreciated.
Thank You
Mark