Posted 19 March 2023, 9:54 pm EST
Hello,
Is it possible to use the oracle provider with named parameters instead of the position that they are in?
Regards,
Bram
Forums Home / ActiveReports / ActiveReports v7+
Posted by: bram.neirinck on 19 March 2023, 9:54 pm EST
Posted 19 March 2023, 9:54 pm EST
Hello,
Is it possible to use the oracle provider with named parameters instead of the position that they are in?
Regards,
Bram
Posted 21 March 2023, 10:30 pm EST
Hi Bram,
Oracle Data Provider not available since System.Data.OracleClient is deprecated. We add the Oracle Data Provider using the CustomDataProvider approach for more information please refer to the following page of our documentation: https://www.grapecity.com/activereportsnet/docs/latest/online/add-custom-data-providers.html
We are using the Oracle.ManagedDataAccess.Client.OracleClientFactory to add the Oracle Data Provider and as per the Oracle Official Documentation it seems you can add the Parameter by only using the number. Please refer to the following page of the Oracle documentation: https://docs.oracle.com/database/121/ODPNT/OracleParameterClass.htm#ODPNT1771
However, I would suggest you to try adding the Parameters using the syntax “:ParameterName” as mentioned in the following page of our documentation: Parameters
Regards,
Akshay
Posted 21 March 2023, 11:15 pm EST
Akshay,
i’m using the OracleDataProvider example that you wrote but with that code the parameters are set by the position they are in.
In other c# code we are already using ODP.net for querying Oracle. And there we use this property for setting the parameters:
https://docs.oracle.com/cd/E85694_01/ODPNT/CommandBindByName.htm
This makes that you can specify the parameters by name instead of position.
Posted 23 March 2023, 8:23 pm EST
Hi Bram,
I am unable to reproduce this issue at my end. As I mentioned previously using the DataSet parameter name with a colon( : ) in front of it works at my end. Please refer to the attached sample application. I have also attached a DemoReport.rdlx file and a couple of screenshots for reference.
Regards,
Akshay
Posted 26 March 2023, 9:35 pm EST
Hi Bram,
Yes, it is not possible to directly pass values from a Dataset to another. You would first have to create a ReportParameter and set default value as the expression say ‘First(Fields!ANTNR.value,“qryArticleDetails”)’ and then use the ReportParameter to assign value to the DataSet Parameter.
As Report Parameters are initialized earlier it would force the DataSet “qryArticleDetails” to initialize earlier and you will be able to return value to the other DataSet. Please refer to the attached sample report.
Regards,
AkshayDemoReport.zip