Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exporting to PDF, Word or Excel
Message
Information générale
Forum:
ASP.NET
Catégorie:
Rapports
Titre:
Exporting to PDF, Word or Excel
Divers
Thread ID:
00975347
Message ID:
00975347
Vues:
77
I am having some trouble exporting my report to PDF, Word or Excel. Well acctually the exporting process runs just fine but after the file has been exported an exception is thrown. Below is the method and I added a try-catch block to show where the exception is thrown
private void ExportReport(ReportDocument paraReport,string paraOutput, string paraFile)
{
	switch(paraOutput) 
	{
		case "PDF":
			paraReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat ,paraFile);
			break;
		case "WORD":
			paraReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.WordForWindows ,paraFile);
			break;
		case "EXCEL":
			paraReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Excel ,paraFile);
			break;
	}
	try
	{
		paraReport.Export();
	}
	catch (CrystalDecisions.CrystalReports.Engine.InvalidArgumentException iaEx)
	{
		System.Windows.Forms.MessageBox.Show("CrystalDecisions.CrystalReports.Engine.InvalidArgumentException was caught again but I bet the file is still there!\n"+iaEx.ToString());
	}
}
The files are written to disk and all seems to be well but the thrown exception is a little annoying. Any thoughts?

Einar

PS. I am using CR.NET if that makes a difference.
Semper ubi sub ubi.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform