Skip to Content
author's profile photo Former Member
Former Member

.COMException: The document has not been opened (Windows 7, IIS 7, ASP.NET)

Hi all,

I updated my PC to Windows 7 last night and just finished reinstalling all of my software including CR2008 with all of the latest service packs.

I can't seem to get any of my report documents to load in my ASP.NET applications and I can't figure out why.

All I get is:

System.Runtime.InteropServices.COMException: The document has not been opened

It fails on the very first line of the load process:

using (ReportDocument doc = new ReportDocument()) {

String path = Server.MapPath(aiSettings.siteRoot + "/reports/incident_report.rpt");

ExportFormatType f = ExportFormatType.PortableDocFormat;


ConnectionInfo connectionInfo = new ConnectionInfo();

connectionInfo.ServerName = ConfigurationManager.AppSettings["crystal_dsn"].ToString();

Tables tables = doc.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables) {

TableLogOnInfo tableLogonInfo = table.LogOnInfo;

tableLogonInfo.ConnectionInfo = connectionInfo;



doc.DataDefinition.RecordSelectionFormula = "{} IN [235274];";

doc.ExportToHttpResponse(f, Response, true, "ir_expt_" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day);


Even if I clean out the entire function and JUST have the using statement, it still fails.. so something is happening when the report document object is created and I don't know where to turn from here.

Any thoughts?

Edited by: RussellMD on Aug 11, 2009 5:25 PM

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2009 at 03:31 PM

    Hi, Russell;

    CR 2008 has not been certified to run on Windows 7. But, let's see what we can do...

    Is this a new project, or an existing one? If it is an existing one, try creating a new one.

    Was .NET installed before Crystal Reports 2008? If not, you may need to reinstall CR 2008.

    What is the version of .NET you are working with?



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.