cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Cannot determine the queries necessary to get data for this report.

Former Member
0 Kudos

We have been using a Crystal Reports report in Visual Studio 2008. It contains multiple subreports and uses an XML file as its datasource. This report works.

We are now moving to Visual Studio 2010 and the same report gives errors:

Cannot determine the queries necessary to get data for this report.

Failed to retrieve data from the database.

I have manually checked the Datasource Location and it is the same as for another smaller report (without subreports) that works.

I have checked the links in the report and all the subreports and they are all correct (match the working report in VS2008)

When I click Verify Database I get a message that the database is up to date. However, after doing this Visual Studio crashes and restarts the next time I build.

Any ideas on how to solve this?

Versions

SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit) 13.0.0.99

SAP Crystal Reports, version for Visual Studio 2010 13.0.1.220

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Just a bit of a clarification. You mention that the report uses XML file as its datasource. This would imply that we're using crdb_xml.dll which only ships with full builds of CR - not with any .NET bundles and not with CRVS2010.

Yet, when you verify the db, you are getting "up to date" so something is connecting to something...

Questions;

1) Are you connecting to an XML or creating an ADO .NET dataset off of the xml and then passing that to the report?

2) I'd like to see what driver the report is using when you are doing the verify. If you have stand alone designer installed, go to the database menu and select Set Datasource Location. Expand the Properties node and let me know what you see at Database Type.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Former Member
0 Kudos

Hi Ludek,

in reply to your questions:

1) Are you connecting to an XML or creating an ADO .NET dataset off of the xml and then passing that to the report?

We are building the XML in code and using it to create an ADO.NET dataset. This dataset being used to generate the report using the function CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)

2) I'd like to see what driver the report is using when you are doing the verify. If you have stand alone designer installed, go to the database menu and select Set Datasource Location. Expand the Properties node and let me know what you see at Database Type.

ADO.NET (XML)

By removing things and re-adding we've discovered the part that's causing the error. It's a Formula Field on one of the subreports. When we remove the formula the error goes, so we're going to try and get that data on the report a different way. The odd thing is that it's the exact same formula in the same place on the report as the older version that works.

The data structure for that subreport has a top level table called Usage

Usage has children of UsageItems and BundleSummary

BundleSummary has children of SingleBundle, CategorySummary1, CategorySummery2, CategorySummary3.

The formula field was inserted into the report footer and contained a field from UsageItems. Other data in the report footer comes from CategorySummary1, CategorySummary2, CategorySummary3.

Former Member
0 Kudos

A further update is that we have our report working now. I can't be certain of the cause but I think some of the autmatically generated data links were wrong.

What was disturbing and massively slowed us down was that the report was frequently failing at compile time and crashing VS2010. If it just gave a runtime error we would have fixed it much more quickly.

We also came across an unrelated bug when sometimes copying and pasting text objects from one subreport to another would crash VS2010.

However, as our immediate issue has been fixed this thread can be closed.

Answers (2)

Answers (2)

Former Member
0 Kudos

VS 2010 + CR for VS 13.0.3500 + .NET 3.5 + C#

Checked the project and report properties suggested in this thread, but stubbornly still receive the "cannot determine" dialog. The project is a tiny no-database proof of concept in which I de-serialize an XML file into a class called "plan" auto-generated by VS from the corresponding XSD. The report is "planCapitalAlloc".

The code to launch the report is:

plan myPlan = (plan)mySerial.Deserialize(myReader);

planCapitalAlloc myReport = new planCapitalAlloc();

myReport.SetDataSource(myPlan);

reportViewer.ViewerCore.ReportSource = myReport;

Don't understand what I have left out. Suggestions?

Former Member
0 Kudos

Reading the other posts more carefully, I determined that the table linkage DIRECTION is the problem here. I used:

menu Crystal Reports/Database Expert/Links

There I observed that I had a root table and two children, but the link arrows were in the reverse direction -- children first, then parent. This is what causes the error. I changed the start/end links on each table so that the parent is the initial START link, and the children are END links, and that enabled a sensible query generation.

0 Kudos

One issue is you are using the 13.0.0.99. Upgrade to SP1 and test again.

And if you are going to use ADO.NET the add this to your app.config file:

<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

</startup>

Don

Edited by: Don Williams on Sep 16, 2011 8:11 AM