Report builder not executing complete SQL query - sql

I'm working with a SQL query which has around 900 lines, I have copied the entire SQL query and pasted in report builder to develop a report. But,the report builder taking only 500 lines of the query remaining 400 lines are not visible or missing.
Does report builder have any limitations with lines? How can I deal with this?

Related

System Error when Opening ADODB Recordset

I have made a macro that does the following:
Identifies SQL code written in Excel (Using named ranges)
Creates/saves a text file containing the SQL query
Runs the SQL query via an ADODB connection to SQL Server Management Studio 18
Returns the resulting recordset back into Excel (I have the 32-bit version)
I have tested the code for many queries, and it worked as expected. However, with one query, I receive "System Error & H80004005 (-2147467259)" when I attempt to open the recordset (The line "rs.open"). The only notable qualities of this query (stored in "rs.source") are:
The query is unusually long (Roughly 1,500 lines, whereas others were about 500)
It produces many records (Four output tables. Two are small, two with roughly 35,000 records each)
It accesses many data tables within SQL (9 tables)
After running a couple diagnostics, I feel pretty confident that:
My connection string is correct:
I have successfully used the same connection string for other SQL queries on the same server
The SQL query is correct, and is being stored correctly: I have manually copy, pasted and ran the text file (generated by the VBA code) in SQL Server Management Studio with success.
The recordset's source (in VBA) is able to hold the entire query: After assigning the recordset's source to the text file, I then wrote the recordset's source to a new text file to ensure it was storing the entire query. It was.
It isn't the number of records or tables being produced: I edited the query such that there is only one small recordset being produced, and I still get the same error.
I have tried to find other posts that encountered a similar error, but there didn't seem to be much out there for this issue (and the proposed solutions I found related to managing Add-ins). I will attach a snippet of the code, which errors on the line rs.Open. I'm relatively new to VBA, and extremely new to SQL (I did not write any of these SQL queries), so I apologize if I'm missing something obvious. Thank you for any guidance. Code Snippet

Webi Rich Client refresh is very slow contrary to Webi and SQL

I have a single Universe query that has 4-5 filters that takes almost 5 minutes to run using the Webi rich client. When I copy the SQL code and run it from SQL management studio (SSMS) it takes 10 seconds. I have created only the data query and don't have any reports or variables. When I run the query using the Webi HTML, it also runs in 10 seconds.
Both SSMS and Webi return 110,000 rows. If I stop the Webi query after about 20 seconds, it only returned 5000 rows, so it's not finishing and then getting hung up.
If I replace the Webi Universe query with a stored procedure (FHSQL) using the same SQL code, it takes 80 seconds. There are query filters in place. Without the Where clauses, SMSS takes 65 seconds to return 990,000 rows
Filtered All_Records
# of Rows: 110,000 990,000
--------------------------------------------
SQL (SSMS): 10 sec 65 sec
Webi HTML: 10 sec
Stored Proc: 80 sec
Rich client: 270 sec
Just the rich client is slow, but much more than would be expected.
This is mostly because of non-tuned Array Fetch Size and Array Bind Size. (You can find them in the universe parameters.) The easiest way to go about would be:
Identify 2-3 reports which retrieves a considerable no of rows.
Record their execution times (probably you can use scheduling).
Increment the parameters, majorly the Array Fetch Size, by steps of 50
Check the execution times again.
Based on the performance gain/loss fine-tune the parameters.
I recently experienced this issue again after making changes to the PRM configuration files:
C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dataAccess\connectionServer\odbc\extensions\export
I was having date conversion errors when running my query and fixed it by setting the date format in the configuration files. The error went away, but the query started to run for 9 minutes instead of 1 minute.
I corrected the configuration file and the query would refresh in 1 minute once again.
So, incorrect changes to the PRM / date configuration files can cause Webi to do unnecessary date conversions and really slow down the query response times.
This information is in addition to the tips provided by Vimal above.

Cannot read the next data row for the dataset DataSet1. (rsErrorReadingNextDataRow)

I am working in Microsoft Visual Studio to create my RDL's. I have a sub report which refuses to run when we put it up on SSRS. This report runs fine inside of Visual studio in preview mode even when pointed at a copy of the prod database (still takes 30 min to run but it completes). The report only returns 1 row with counts of a large amount of data for a summary.
The full error text is:
An error has occurred during report processing. (rsProcessingAborted)
o Cannot read the next data row for the dataset DataSet1. (rsErrorReadingNextDataRow)
A severe error occurred on the current command. The results, if any, should be discarded. Operation cancelled by user.
This report used to work but the query was not correctly pulling the information. I had to change the query and expand what it was pulling from the database. Is there any way this could be caused by not enough memory being given to SSRS? We are using SSRS 2008 r2.
Turns out my problem was solved by putting in the recommended indexes provided by SQL Query Analyzer. After the indexes were created the query ran in ~4 min no problems.

Add exsiting query to report

My report calculates the stock of inks in my stores. I built a SQL statement in VB.NET and got the correct results. How can I display these results in my Crystal Report? Or design a report such that same results will be retrieved?
I tried to use SQL Expression builder but failed.
Usually you will link Data Tables to your report using Database Expert. Do the same in Database Expert, select the Database and you can see Add Command. Select that and click the > button. You will get a Window, write your SQL Query there and press OK.
After finishing this you can see Command in Database Fields which contains all your records got from the SQL Query as result.
In Database Manager choose Add Command and then type your SQL Statement there.

Crystal Report Duplicating in details?

so I have a template in Crystal reports using vb.net, I changed my data source location and that source still contains the needed tables for my report, the problem is this... My original template displays the exact report but when I changed its data source it duplicates the data in the details section(e.g I made a query that will show 1 item only,but instead I get 4).
Here is a screenshot of my problem:
(original at http://tinypic.com/r/5by6ih/5)
I want to alter the template rather than to make another one
This is normally down to an issue with the underlying SQL query. If you open the the report in Crystal (or visual studio) you should be able to "Show SQL Query". Run the query in Query Analyser or SQL Server Management Studio and look at the result.
If the underlying reason isn't then immediately apparent please paste the resulting output.