Report wont run when using OLE DB connection - reporting-services

I have an SSRS Report it works perfectly when I use Oracle data source. However, when I tried to connect using OLEDB connection I am running into some issues.
0x80040e10 in the message file for OraOLEDB
I understand that its not receiving my parameter values.
For this report, I am using the date filters and applying to the report dataset in this manner
where trunc(addwhen) between (:sd) and (:ed)
Please can any help me figure out why I an running into this issue. It will be great help

Yeah as you know,its not receiving your parameter values.
This is because, Trunc is not a sql query, Try using CAST() or CONVERT() which serves the purpose

Related

MySQL + SSRS | Stored Procedure only returns one single row

I'm working on several reports for SSRS written in MySQL via ODBC Adapter. For some reason, Stored Procedures only return a single row of data instead of an expected set of data.
Below is the same stored procedure when ran on an SQL Editor:
And below is the stored procedure's execution result when SSRS tries to run it (both on Query Designer and Report Viewer):
I have also set parameters properly as far as i can tell:
so i wasn't able to find an exact answer as to why this happens on SSRS with MySQL via ODBC. What i was able to find was a workaround:
by executing the command as an Expression rather than as a raw query via the Query Editor:
Now the only caveat for this is that the DataSet Fields wouldn't be automatically generated, and that you have to plot them all manually. A good workaround for this is to first run a blank/null query with only the column names (i.e.: SELECT NULL 'column_name_1', NULL 'column_name_2') then later change the query source to Expression. The good thing about using expression is that you only need minor knowledge about how it works and it reduces the confusion with ODBC '?' Parameters.
Cheers!

Calling a MySQL stored procedure with parameters in SSRS reporting through ODBC

In SSRS, when I pass hard-coded values to my stored procedure, it works fine. But it doesn't work when I try to pass the parameters.
Can you please tell me the right syntax for calling MySQL stored procedures in SSRS, through an ODBC data source.
Actually, my problem is either SSRS or the ODBC driver is having a problem sending/receiving the parameter value. Other attempts at syntax:
call shop.GetRegions() ,
call shop.GetRegions(?) ,
call shop.GetRegions(regid),
call shop.GetRegions(#regid)
None of these worked. If I call the procedure with a hard-coded value i.e.
call shop.GetRegions(5)
it works. Again, if the stored procedure has no parameters it works fine. I Want to know How to call MySQL stored procedure in SSRS Reporting? Can You give me any real direction on this issue?
I don't really know where to start with this one because there seems to be a lot of things I could mention, but here it goes...
First, I believe you can use MySQL with SSRS, but I'm not sure why you would want to avoid using SQL Server which is meant to work with SSRS. Additional to that, I'm not sure where this call function is coming from? I've never seen that before unless you went with some custom code.
Next, if this is being done in SSRS, you'll need to call the parameter the correct way. The syntax for referencing parameters in SSRS looks like the following
Parameters!regid.Value
The reason for attempting to call a procedure this way as opposed to loading the data into a dataset is another thing I'm curious about. The easiest thing to do is a dataset getting values from a stored procedure and that way, SSRS typically handles things like this parameter issue in the dataset properties, rather than explicitly calling the procedure.

SSRS ORA-01008 not all variables bound

Using SSRS with VS 2017 I am receiving the ORA-01008 not all variables bound message when connecting to Oracle via the ole db connector. The code works normally through sql developer. Similar code worked fine in VS 2016 before we upgraded to vs 2017. Any ideas what's causing this issue
Code:
select tr.id_number
FROM rpt_transaction_view TR
WHERE TR.unit_code=:pUnit
Error Message:
TITLE: Microsoft SQL Server Report Designer
An error occurred while executing the query.
ORA-01008: not all variables bound
ORA-01008: not all variables bound
ADDITIONAL INFORMATION:
ORA-01008: not all variables bound
ORA-01008: not all variables bound (OraOLEDB)
BUTTONS:
OK
A little late BUT I think I found a solution (if you want to call it that). A little background, I've been working with SSRS since BIDS and have NEVER encountered this error before... until today. I have spent hours googling, trying to find what the solution is and NOTHING worked.
Now, I build all my queries in Oracle SQL Developer, and noticed something different about the offending query - the "SELECT" was underlined, basically Oracle SQL Developer wanted to rewrite the query, so I let it. Now I had two parameters, we'll call them :p1 and :p2, each being used three times throughout the query. When the query was re-written (to something almost unreadable) it replaced the parameters with :b1, :b2, :b3, :b4, :b5 and :b6. All odd parameters (:b1, :b3 and :b5) were :p1 and the evens :p2. I used a find and replace so I was back to only using the 2 parameters. I replaced the dataset in my report with this query, ran it and voila error gone...
Why? I have not the slightest idea. It's not like this query was unique to other queries I've used. I have over 400 oracle based reports and I've never had to do anything like this and this query wasn't as nearly as complicated as others I've written. I have some queries that use the same parameters a half dozen times and no issue - just this one.
Anyways, thought I would share in case anyone else was 100% stumped as I was.

SSRS report does not work remotly

I have one problem with creating dynamically data source SSRS reports.
Locally in SSDT tool is working fine, but after publishing, on Report Manager, gives mi silly error : "An error has occurred during report processing. Could not find stored procedure XXX". The stored procedure is created in the same way in all databases.
What is the problem?
Thank you in advance.
If the issue is only with this one stored proc then try using the full name including Schema.
e.g.
dbo.spr_YourStoredProc
Or feel free to share the image of stored proc name in database explorer window and your data source window so that we can comment better?
I use dynamically data source in order to get the same report in different companies.Firstly, I created parameter #company that contains values of Initial Catalog (database of each company). In data source I created expression:
="Data Source=10.0.23.8;Initial Catalog="+Parameters!company.Value.Then I embedded
this data source in Data Set. Note: This Data Set gave result, while connection string was static(one company). Locally in SSDT it works, when I change Data Source that has expression instead of static connection string, but in Report Manager is not working. Locally I used Windows integrated authentication. Stored procedure is created in all databases.Remotly I get this message: An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'DnevnaProdajaRC102'(rsErrorExecutingCommand)
Could not find stored procedure 'dbo.neo_dnevna_102_novo'.
If data set is simply query, then I get message: An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'SpisakRadnika'. (rsErrorExecutingCommand)
Invalid object name 'Radnik'. Radnik is a table and is located in all company databases.

SSRS Dynamic data source is not working

I have a dynamic data source in my SSRS Report. It will get its server name from a parameter defined in the report. I defined my dynamic data source connection string as
="Data Source="+Parameters!HostServer.Value+";Initial Catalog=DBName"
When I am trying to define a data set using this data source, I am not able to extract the fields out of the query used in the data set. The error I am facing is that "Could not update a list of fields for the query. Verify that you can connect to the data source and the query syntax is correct..."
If I use the same query against my server in SSMS editor, I am getting expected output. And the parameter has already a default value which I suppose the report will use while testing connection.
If anyone know how to resolve this connectivity issue with dynamic data sources, please help.
You should create another temporarly datasource where you need to set connection to one of your databases. Then when you define dataset use that temporarly datasource in order to populate the available fields. Once the fields are created, you can change the connection back to your dynamic data source. After that delete temporarly datasource and it all should to work.