I am trying to generate a spreadsheet in .NET which will be opened by my manager on his iPad when he\'s out of the office.
The spreadsheet opens fine on a Windows PC
You could try to validate OpenXML spreadsheet once it's created:
using System;
using System.Collections.Generic;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Validation;
using (OpenXmlPackage document = SpreadsheetDocument.Open(spreadsheetPathToValidate, false))
{
var validator = new OpenXmlValidator();
IEnumerable errors = validator.Validate(document);
foreach (ValidationErrorInfo info in errors)
{
try
{
Console.WriteLine("Validation information: {0} {1} in {2} part (path {3}): {4}",
info.ErrorType,
info.Node.GetType().Name,
info.Part.Uri,
info.Path.XPath,
info.Description);
}
catch (Exception ex)
{
Console.WriteLine("Validation failed: {0}", ex);
}
}
}
Hope that helps,