Microsoft Office Tutorials and References
In Depth Information
EWA and API Working Together
}
}
catch (SoapException exc)
{
// Error handler
}
catch (Exception exc)
{
// Error handler
}
}
protected void _getWorkbookButton_xl_Click(object sender, EventArgs e)
{
WorkbookType wbType = WorkbookType.FullWorkbook;
switch (_workbookTypeListBox_xl.SelectedIndex)
{
case 0:
wbType = WorkbookType.FullWorkbook;
break;
case 1:
wbType = WorkbookType.FullSnapshot;
break;
case 2:
wbType = WorkbookType.PublishedItemsSnapshot;
break;
}
try
{
byte[] bits = xlEcsApi.GetWorkbook(
_sessionIdTextBox_xl.Text,
wbType,
out xlStatus);
if (xlStatus != null)
{
for (int i = 0; i < xlStatus.Length; i++)
{
//status handler
}
if (0 < bits.Length)
{
string saveToPath = @”e:\savedFiles\”;
using (BinaryWriter binWriter = new BinaryWriter(File.Open(
saveToPath + _fileNameTextBox_xl.Text,
FileMode.CreateNew)))
{
binWriter.Write(bits);
binWriter.Flush();
binWriter.Close();
}
}
}
}
catch (SoapException exc)
Search JabSto ::




Custom Search