Ein Fehler beim Generieren des Bericht -8dba-335ec946e8b8} Aus dem
iCLASSFACTORY fehlgeschlagen aufgrund des folgenden Fehlers: 80040111
classFactory kann die angeforderte Klasse nicht liefern (Ausnahme von
hResult: 0x80040111 (class_e_classnotavailable). < /P> < /p> < /p> < /p> < /p> < /p> < /p> < /> Dies ist der Teil, in dem die Dateispeicherung < /p>
passiert
Code: Select all
string fileName = string.Empty;
if (IsWinPE())
{
string exeDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string reportsFolder = Path.Combine(exeDirectory, "Reports");
if (!Directory.Exists(reportsFolder))
{
Directory.CreateDirectory(reportsFolder);
}
fileName = Path.Combine("C:\\", "ErasureReport.pdf");
}
else
{
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.Filter = "PDF Files (*.pdf)|*.pdf";
saveFileDialog.FileName = $"ErasureReport_{DateTime.Now:yyyyMMdd_HHmmss}.pdf";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
fileName = saveFileDialog.FileName;
}
else
{
return;
}
}
}
DebugCheckpoint("About to save document to: " + fileName);
document.Save(fileName);
MessageBox.Show("Report saved successfully!\nPlease open the file manually.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
try
{
Process.Start(new ProcessStartInfo(fileName) { UseShellExecute = true });
}
catch (Exception ex)
{
MessageBox.Show("The report was saved but could not be opened automatically.\n" + ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
if (!IsWinPE())
{
try
{
Process.Start(new ProcessStartInfo(fileName) { UseShellExecute = true });
}
catch (Exception ex)
{
MessageBox.Show("Report saved successfully, but the file could not be opened automatically. Please open the file manually.\n\n" + ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}