How to Pass parameters to Crystal report 10 based on Oracle Stored Procedur
Hi,
I use the following code to pass the parameters:
Rep.Tables[0].ConnectBuffer := Connection_Str;
Rep.Tables[0].AliasName := 'REP';
Rep.Connect.Propagate := True;
Rep.ParamFields.ByName('Lang', '').CurrentValue := IIF(BiDiMode = bdRightToLeft, '2', '1');
Rep.ParamFields.ByName('SESSION_ID', '').CurrentValue := IntToStr(Session_id);
Rep.WindowState := wsMaximized;
Rep.Show;
The 1st parameter 'Lang' which created from crystal report pass well,
but the 2nd parameter 'SESSION_ID' which created from Oracle Stored Procedures give the following Error:
Error: 202 Parameter Name could not be found u2013 ParamFields.ByName
However in MS SQL Server the above code work fine with the 2 Parameters.
Any one has solution,
Hello,
Click on the businessobjects Tab above and then select Samples and dowload the sample app you for your SDK. There are a few samples for changing/setting Parameters.
The Parameter collection has all parameters.
Thank you
Don
Similar Messages
-
PASSING PARAMETERS TO CRYSTAL REPORTS THRU FORMS!
Hi! all,
Is there someone who passed parameters to crystal reports from
forms 5.0?
The problem is when I call the report executable from the form,
its giving a login prompt again which is not desirable as @ this
stage the user has already logged in once. So is there a way to
pass this as a parameter to crystal or may be any better way???
Thanx for the solution,
Hima
nullFirst make sure you are on SP 3:
https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
SP 3 msi
https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
SP 3 msm
https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
Have a look at [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
(The above does apply to your version of CR also)
Have a look at the samples:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
And look at the Developer Help file:
http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
And don't forget to use the search box at the top right corner of this web page. It will bring up KBases, blogs, wikis, articles and more. Searching these forums is also a good idea.
- Ludek -
Crystal Reports can't add stored procedure using Oracle Provider for OLE DB
Hello,
I am trying to bind an oracle stored procedure to a crystal report through Visual Studio 2008.
This oracle stored procedure returns a ref cursor.
I am using an oracle 11g database (11.2.0.2.0) .
When I use the Oracle Provider For OLE DB driver to bind the store procedure with the report, I get the following error message:
Description : ORA -06550 Line 1 Column 7
PLS 00306 wrong number of types or arguments to the "Strored Procedure Name"
But When I use the Microsoft OLE DB provider for oracle driver, I can bind the stored procedure to the report successfully .
I cannot use the Microsoft OLE DB provider for oracle driver because it does not support the CLOB data type which I plan on having the stored procedure return once I can get everything working.
I have tried setting PLSQLRSET = 1 IN "HKEY_LOCAL_MACHINE\SOFTWARE\KEY_OraDb11g_home1\OLEDB", but that does not seem to work either
Any assistance would be greatly Appreciated
My Stored procedure is very simple as the moment (I just need to get it working then I'll add more stuff). Here's what it looks like:
CREATE OR REPLACE PACKAGE PROMO.PKG_REPORT as
TYPE OUT_Type IS REF CURSOR;
procedure Report_ThisReport (
p_ThisIdField IN number,
IO_CURSOR IN OUT OUT_Type
end PKG_REPORT;
CREATE OR REPLACE PACKAGE BODY PROMO.PKG_REPORT as
procedure REPORT_ThisReport (
p_ThisIdField IN number,
IO_CURSOR IN OUT OUT_Type
IS
BEGIN
OPEN IO_CURSOR FOR
SELECT ThisField
FROM ThisTable
WHERE ThisIdField = p_ThisIdField ;
END REPORT_ThisReport;
end PKG_REPORT;
Edited by: 894988 on Nov 3, 2011 2:45 PM
Edited by: 894988 on Nov 3, 2011 2:46 PM
Edited by: 894988 on Nov 3, 2011 2:47 PMIt seems that some questions posted here on the XE forum are really questions about other Oracle technologies.
Concretely, for you there is an Oracle Provider for OLE DB Forum that is active and a terrific resource for you to use.
Oracle Provider for OLE DB
Cheers! -
How to pass a CURSOR as an input in a Stored Procedure ?
Hi all
I am using Java to work with 2 Oracle DBs, using JDBC.
I've got a question about using a Oracle Stored Procedure with CURSORs :
A first stored procedure gets data from the first DB (returns a CURSOR) and I'd like to pass this CURSOR to the second stored procedure as a (Java) IN parameter, so using a "getObject()" then a "setObject()", to insert data from the CURSOR in the second DB.
This is the theory !
En reality, the first stored procedure works fine, and returns the cursor, but after that ... I can't even create the second stored procedure. I planed to do something like the following stuff :
CREATE OR REPLACE PROCEDURE proc_insert_data(cur_ref IN OUT types.ref_cursor) AS
BEGIN
LOOP
FETCH cur_ref INTO FIELD1, FIELD2;
INSERT INTO TABLENAME VALUES (FIELD1, FIELD2);
EXIT WHEN cur_ref%NotFound;
END LOOP;
END proc_insert_data;
with a LOOP for each row and then an INSERT.
But this doesn't seeem to be correct.
Has anybody an idea to make this stored procedure to work ?
Thx in advance
KrystoffffHi Chris,
When you want to pass a CURSOR to a procedure/function
you will have to employ a package here. Create a package
which contains both of your procedures.This package should have a global variable which is of type ref cursor.The IN parameter for the 2nd procedure and the OUT parameter of the first proc should be of type this global cursor var.
Now you call the first procedure and get the resulting cursor from it, pass it to the second procedure...
Good luck.
Regards,
Madhu -
BO v5.1 - creating a report from an oracle stored procedure
Post Author: newrochelle
CA Forum: Publishing
hi to all,
im using BO 5.1 and i need to create a document from an oracle stored procedure that have only one IN parameter and ten OUT parameters.
Creating the new report I selected the database connection then I choose the stored procedure name from the list, I inserted the value for the IN parameter and finally I click on Run button.
I got the following error message:
ORA-06550: line 1, column 38: :PLS-00103: Encountered the symbol
"," when expecting one of the following: : : ( - + case mod
new not null others <an identifier> : <a double-quoted
delimited-identifier> <a bind variable> avg : count current
exists max min prior sql stddev sum variance : execute forall
merge time timestamp interval date : <a string literal with
character set specification> : <a number> <a single-quoted SQL
string> pipe : <an alternatively-quoted string literal with
character set specification> : <an alternatively-q :-6550
it seems to be caused by the OUT parameters!
i leaved them without any value.
it's the first time that I used a stored procedure to create a BO report, but I think the OUT parameters are needed to do that, otherwise what data will be presented in the report???
can you help me?
please answear me ASAP.
Thank's in advance
Regards
AndreaPost Author: synapsevampire
CA Forum: Publishing
Try posting in a BO forum, this is Crystal Reports.
-k -
Passing an array of structures to an Oracle stored procedure (CFMX)
I'm looking to write a Oracle stored procedure where I would pass in an array of structures and loop over each iteration to insert the bits and pieces within the structures to the DB.,
I haven't written this type of procedure / package before. I am planning to do an sp / package similar to what is sketched out in the second reply to this thread: http://forums.oracle.com/forums/thread.jspa?threadID=1078772
Assuming I do, how can I call the procedure from ColdFusion (I'm using MX) and pass in my array? As far as I can see, none of the CF_SQL_Types make sense.Let me know if you make any progress. I'm fighting the same battle. What I've done so far is to convert my array of struct into a delimited CLOB that looks like this:
prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|
Then I wrote a stored proc to suck it up using a pipelined function. It's not to bad but parsing the CLOB on the ORACLE side is somewhat time consuming.
I've also converted the array to XML and used dbms_xmlstore to convert but, on large arrays, it is very slow and the CLOB gets huge fast.
I was hoping to use the cf_sql_refcursor but I can't figure out how.
Warren -
Passing Arrays of User Defined Types to Oracle Stored Procedures
Hi
I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
Summary of Approach:
In the Oracle database, we have defined a Object Type :
CREATE OR REPLACE
TYPE MYTYPE AS OBJECT
TxnId VARCHAR2(40),
Target VARCHAR2(20),
Source VARCHAR2(20),
Param1 VARCHAR2(2048),
Param2 VARCHAR2(2048),
Param3 VARCHAR2(2048),
Param4 VARCHAR2(2048),
Param5 VARCHAR2(2048),
and we have defined a collection of these as:
CREATE OR REPLACE
TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
Thanks
AndyAndy Bowes wrote:
Hi
I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
Summary of Approach:
In the Oracle database, we have defined a Object Type :
CREATE OR REPLACE
TYPE MYTYPE AS OBJECT
TxnId VARCHAR2(40),
Target VARCHAR2(20),
Source VARCHAR2(20),
Param1 VARCHAR2(2048),
Param2 VARCHAR2(2048),
Param3 VARCHAR2(2048),
Param4 VARCHAR2(2048),
Param5 VARCHAR2(2048),
and we have defined a collection of these as:
CREATE OR REPLACE
TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
Thanks
AndyHi. Here's what I suggest: First please get the JDBC you want to work in a
small standalone program that uses the Oracle thin driver directly. Once
that works, show me the JDBC code, and I will see what translation if
any is needed to make it work with WLS. Will your code be running in
WebLogic, or in an external client talking to WebLogic?
Also, have you tried the executeBatch() methods to see if you can
get the performance you want via batches?
Joe -
Passing Parameters to Crystal Report
Dear all,
I wonder if anybody has tried out the crystal report bundled with workshop
in SP2.
I got some problems when I try to pass a parameter from a jsp in workshop to
crystal report according to part 4 of tutorial in the Crystal Reports for
BEA Weblogic workshop Developer's guide.
This message show in the web browser:
com.crystaldecisions.report.web.viewer.CrystalReportViewer
Some parameters are missing values
However, the report viewer works fine in workshop if I am not passing
parameters.
If anyone has successfully setup a report which involves parameter passing
in workshop, I would appreciate you can share the tricks how to make it
work.
Thanks!
Orion YiuHi Orion,
I have the same issue like the one you sent to bea helpdesk . Please, if you got any positive response on that issue. Need help. Thanks you for you time.
Abdellah -
Passing parameters to Crystal Reports 2008; C#
Hi,
we are developing a .NET C# application and would like to call a Crystal Reports document (version 2008) from there passing some parameters.
So we will build the Crystal reports with the necessary parameters - however, how can I pass them from our C# application? The Crystal reports will be stored locally.
Thanks!First make sure you are on SP 3:
https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
SP 3 msi
https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
SP 3 msm
https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
Have a look at [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
(The above does apply to your version of CR also)
Have a look at the samples:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
And look at the Developer Help file:
http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
And don't forget to use the search box at the top right corner of this web page. It will bring up KBases, blogs, wikis, articles and more. Searching these forums is also a good idea.
- Ludek -
Crystal report ReportPageViewer problem using Stored Procedure
Hi,
I'm using the ReportPageViewer component in my jsf page, to visualize cystal reports on my web application.
Everything is working fine when my crystal report queries a table. But, for performances issues, we've changed this to use a stored procedure.
However, when trying to run the report from my jsf pages, I obtained the following error:
The QE parameter ''{0}'' could not be found.
The parameters are exactly the same as before. I can see in the Reportsource that I'm passing to the ReportPageviewer that all the parameters are set with the proper values.
When running the report from crystal report, I obatin the results, using the same database login/password than my web application.
Any help would be really appreciated!
Thanks,
M�lanieHi Andy Hendrickson,
Let me understand your problem correctly.
1) When you run the procedure from command prompt the table gets populated. It is clear.
2)When you run the procedure in before report trigger you get nothing. Let us analyze why but for now it is clear.
3) What you mean by "I run the procedure from the command line and leave the data, then run the report I get updated data in the table, but nothing returned to the report."
Can you please explain a bit more and also update code snippets of what you are using ?
Thanks,
Vinod
Oracle Reports Team -
Null pointer in setTableLocation for a report based on a stored procedure
im using the crjavahelper class and setTableLocation to change the datasource of a stored procedure based report and its throwing a null pointer exception somewhere in the sdk. This is happening with sqljdbc4.jar and sql2005 and jdk 1.6.
Jan 20, 2010 12:43:37 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.do(SourceFile:4605)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:621)
at com.crystaldecisions.sdk.occa.report.application.b0.if(SourceFile:75)
at com.crystaldecisions.sdk.occa.report.application.b0.b(SourceFile:106)
at com.crystaldecisions.sdk.occa.report.application.bb.int(SourceFile:96)
at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:151)
at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:2159)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:543)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:3898)
at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(SourceFile:2906)
at com.businessobjects.samples.CRJavaHelper.changeDataSource(CRJavaHelper.java:191)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:114)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
any ideas? I tried using the jtds driver and it doesnt throw the exception but it doesnt return any data either, ive never gotten a stored procedure based report to work with it.
JeremyCheck out this forum post:
Problem using Null as a parameter with a stored procedure -
Here's how to pass XML as a parameter to an Oracle stored proc
This, or something like it, should be all over the web and I intend to do so.
The first sample has exactly what you need in order to pass "XML" as a parm to a stored proc.
http://www.oracle-base.com/forums/viewtopic.php?f=2&t=8468> Really, what is the difference between the 2?
"What is a...?" questions are easily answered by Google. Generally speaking, however, "JavaScript" is Netscape's implementation of ECMAScript, a scripting language primarily for client-side development for a web browser. "Java" is an entire platform, but typically refers to an object-oriented programming language that is typically compiled to bytecode and run in a virtual machine.
They're not the same thing at all.
~ -
Hi all,
I would like to know how to pass parameters to a report to filter the data from an external application, for example a Oracle ADF app.
Thanks,
Jhon
BI PUB 11.1.1.7hello arjhay,
webelements 2.3 will not work seemlessly, unfortunately, with xir3.
in xir3 the dhtml viewer has changes in it that are more web 2.0.
things that will not work and are deprecated for webelements & xir3 are the functions in WEViewer. this is due to the toolbar in the new viewer being a widget as opposed to a set of divs. however, opendocument for xir3 will allow one to switch off the toolbar using an opendocument paramter and will also allow one to switch off the new style tab bar.
the new dhtml viewer also does not encase report fields & functions etc. within a form tag. many webelements controls require a form so the new design for xir3 will be to put a new WEFormStart at the top of each report using webelements. what this does is basically start a form in the viewer and allow the controls to function properly.
so in summary there are 2 changes for xir3:
a) each report using webelements must have a WEFormStart function added to the beginning of the report
b) references to WEViewer must be removed from reports that are used in xir3
there will be a new 2.4 function suite out in several weeks and this will contain the new WEFormStart as well as other syntax changes to allow reports to work in xir3.
jw -
Reporting off oracle stored procedure with parameters error
Erorr message: Error in File xxx.rpt: Failed to retrieve data from the database. Details: [Database Vendor Code: 907 ]
Asp.net 2.0 web application.
CR XI R2 sp2 in BOE XI R2 sp2 on Solaris 10.
Database: Oracle 10g on Solaris 10. Oracle stored procedure defined in package.
Happens with reports reporting off stored procedure with parameters.
The sp is used in the crystal report.
The web application passes parameters to crystal report, which then passes the parameters to stored procedure.
Encountered error if:
r.PromptOnDemandViewing = false;
r.UseOriginalDataSource = false;
r.CustomServerType = CeReportServerType.ceServerTypeOracle;
Report can retrieves data if:
r.PromptOnDemandViewing = false;
r.UseOriginalDataSource = true;
r.CustomServerType = CeReportServerType.ceServerTypeOracle;
In addition
The steps are:
1) Create oracle package and stored proc.
2) In CR Designer, select the stored proc as datasource.
3) The parameters names were "generated" by the CR Designer.
4) Rename the parameter names.
5) Drag the fields onto report.
We noticed the following with different setting of database logon info:
When previewing from BOE, get error when "Use custom database logon information specified here"
However, no error when "Use original database logon information from the report".
Am i missing something?Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly
-
Passing XMLType Data into oracle stored procedure using JDBC
Hi Friends,
I have requirement where my oracle stored procedure accepts XML file as an input. This XML File is generated in runtime using java, I need to pass that xml file using JDBC to oracle stored procedure. Please let me know the fesibile solution for this problem.
Following are the environment details
JDK Version: 1.6
Oracle: 10g
Server: Tomcat 6.x
Thanks in Advanceuser4898687 wrote:
I have requirement where my oracle stored procedure accepts XML file as an input. This XML File is generated in runtime using java, I need to pass that xml file using JDBC to oracle stored procedure. Please let me know the fesibile solution for this problem.As stated - no.
A 'file' is a file system entity. There is no way to pass a 'file' anywhere. Not PL/SQL. Not java.
Now you can pass a file path (a string) in java and to PL/SQL.
Or you can pass xml data (a string) in java and to PL/SQL. For PL/SQL you could use eithe a varchar2, if the xml is rather small, or a blob/clob.
Maybe you are looking for
-
i have recently purchased music from itunes, it shows up on my computer but will not sync to my ipod??????? It shows on my playlist on the computer but will not transfer to my ipod
-
Can anybody tell me how to generate an xml signature with the base 64 transform(Transform.BASE64)? I just can't find any documentation on the web. It would be great to provide a small code exemple. Thanks Antoine
-
HT201274 how long does it takes to finish ios resetting?
I have been waiting to finish ios reset mode(erase all contents) for about 12 hours. My ipad is still showing the apple logo and progress bar but there is no sign of progress in that bar. do u have any idea guys?
-
I tried downloading an issue in my content viewer on the iPad, but kept getting an error saying it couldn't download and try again. After trying again several times, I signed out and tried to sign back in. Once I signed in it takes a long time for th
-
in returns we are doing post goods receipt, in that in return goods are post to which g/L accounts. each and every item have different octroye, and taxes, and discounts , how it was posted. thanks in advance narasimha.