.net – Crystal Reports -Invalid Argument provided. Failed to open a rowset. ADO.Net xml

crystal-reportsnetoledbxml

Okay here is the scenario I have a VB6 application that is getting re-written for asp.net 3.5. I have a grundle of Crystal Reports that are getting updated to Crystal Reports 10.5 (which is included in Visual Studio 2008). All of the old reports used OLEDB. What I am doing is taking the sql statements used in the reports and putting them in the database. I next run an automated process to create a Dataset from those select statements and I serialize the DataSet and save the schema and data as an XML document. I then go into the old report update it to Crystal Reports 10.5 and change the Data Source location so that it uses the XML document.

When the report is run I create the same DataSet and instead of serializing it as XML I assign it to the report (see below)

 rd.Database.Tables(0).SetDataSource(ds)

I have tested this and do not get any errors if I create the report new but if I take an existing report and change the database location I get the following error

Invalid Argument provided. Failed to open a rowset. Error in File C:\DOCUME~1\username\LOCALS~1\Temp\R-302 {D49E0C73-47AC-4363-AAD5-E925DFCF446E}.rpt: Invalid argument for database.
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream

It seems as if the report is still trying to connect using OLEDB to the old database. I have been able to get a report to work if I rewrite it using the exact same logic but the updated reports through the above error. How do I fix it?

Best Answer

I'm posting this here because it's the top result for "Invalid Argument Provided Crystal".

I was working within Crystal Reports XI on a report that was linked to a datasource that I was trying to change via the GUI. Selecting the new datasource and clicking Update would appear to do nothing and I would close the dialog, at which point I would receive the message "Invalid Argument Provided". I tried many things before eventually closing and reopening the file, which worked when I tried again.

This allowed me to modify the datasource without removing any of the associated fields.

My work PC stays logged in/switched on/locked 24/7 for VPN purposes and I'd opened the report in question the previous day. My guess here is that a connection to the SQL instance had timed out and was not being re-established.

My apologies for necro'ing this old question, or if this was the wrong thing to do; but given the page's prominence in search results I'm hopeful that this can help someone else.

Related Topic