Welcome! Log In Create A New Profile

Advanced

Report based on project query (SQL pass-thru) is not working

Posted by Damon 
I'm running into an issue that I think I understand what's not working but not sure how to solve it. I have a join query that due to restrictions within my environment I need to perform via MS SQL Pass-thru query. The query itself works great. However, when I use it as the data source within a report I can't get the report to run -- in test mode I have selected the parameter for hQueryWithoutCorrection which brings up a connection dialog box upon execution of the report -- I select the appropriate connection and see the message open stating that the results are being selected and sorted but then the report acts like it finishes but never displays/prints, etc. When I perform the report in my application (not test mode) I get the same behavior without the connection dialog box opening but nothing happens.

What I've noticed is that in the Report Description dialog box, Data tab, I can select the right query. For some of my queries once I select them the File(s) to Print text box populates with the files that exist in that query. However, for any of my SQL pass-thru queries this text box is not populated. (I suspect by design, given it's a SQL pass-thru), however this seems to be the issue as any query that has the file list populated works with my report...just not the ones that don't have the "File(s) to print" field populated.

Any thoughts/suggestions? Is this an error or am I overlooking something? Thanks.
Hello Damon

If as you suspect, the issue is with the report not being able to process pass thorugh queries, a solution could be to dump the query results into a memory table using FileToMemoryTable() and base the report on the table instead of the query

Regards
Al
Hello, some code would be nice. Why don't you create a view and then have windev retrieve the view results. This is what I do for complex queries (more than one outer join). This will also not require an SQL-pass thru.

Steps

1. Create a view on MSSQL
2. Retrieve the view into the analysis (WD will see it as a table)
3. Create a query and establish any parameters.
4. Use the query in WD.
5. Before calling your report, test the number of records with hnbrec to ensure query actually retrieved records
6. Ensure that the independent hyperfile context is not enabled for the report. This option has caused me headaches in the past.

I use MySQL but I doubt if there is much of a difference in these things.

Lets know how it goes.

issah
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: