Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot determine the queries necessary to get data for this report

Status
Not open for further replies.

bandarna

Programmer
Jan 2, 2003
122
0
0
US
Hi,
I do hope someone can help on this.

The db is SQL Server.

I am Working on Existing report. This existing report has xml source, now I need to add two tables from MS SQL Server db and I have linked both these newly added tables but not to xml tables. So these two are connected but they are not linked to xml.

I have added one the field from these report and ran. Report ran fine showing data in that field. However after I add a parameters to the report not is it not working

Now when I try to preview I get these to errors one after the other......
(1) Failed to retrieve data from the database and
(2) Cannot determine the queries necessary to get data for this report


What does this mean?

BTW - This is a report written by someone else which I have had to modify.

Any info on this would be greatly appreciated.

nb
 
When you add parameters to the record selected formula, crystal reports might be confused , because there are 2 different connections. Try to add the 2 new tables to a subreport instead to the main report .
 
Thanks for your response,

I have created a sub report. This sub report is unlinked subreport. This sub report need to display only one row total of the recorded, therefore I have suppressed all other sections except report footer group and added to the main report to display as only single row. Working perfect.
Now I need to use the summaries in my main report. I am trying to create a shared variable in subreport sot that I can call in the main report and manipulate as I wanted. I am unable to call the summary field in formula field. It is working only to use database fields.

How can I create a shared variable in subriport using summary field?

Please see my code:

whileprintingrecords;
shared currencyvar v_jul_comm_amt;

If {commit_hdrs.accounting_prd} = 1.
Then
v_jul_comm_amt := {commit_hdrs.com_amount}
Else
v_jul_comm_amt:= 0;

here {commit_hdrs.com_amount} is database field I need to replace with summary field. If I use above code it is populating one value from one record.

You help would be really appreciated.

-nb
 
Just wanted to update the status after the previous post:

I have created a shared variable using my summary field. See the code below:

whileprintingrecords;
shared currencyvar v_jul_comm_amt := ({@Jul_Comm_Amt})

and then I have used below formula Colum code in main report.
whileprintingrecords;
shared currencyvar v_jul_comm_amt

Still no luck, It is displaying zero in sub report and main report.

I tested in subreport to see if it is populating jul_comm_amt, it is not.

I think I am missing basics of using shared variables.

Note: sub report is not unlinked. Is that an issue to use shared variables between sub and main report.
Any quick response would be appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top