How do I pass a null value to the reportDocument?
I'm using CR 2008 and VS 2005.
I am using a stored procedure as the datasource for one of my report, which we run using the C# API. The stored procedure is expecting a NULL in certain cases and I find I cannot pass a NULL with my current code:
// Here I get the parameter
// If we are dealing with an empty string or a NULL value, let's give it
// a value of a space so that Crystal's DLLs don't choke.
if ((value.Length == 0) || (value == "NULL"))
value = " ";
arrParams.Add(value);
Object strParam = arrParams<i>;
this.reportDocument1.SetParameterValue(num, strParam);
The stored procedure parameter type is INT so in the report it shows up as NUMBER.
How do I get a NULL value to the stored procedure?
Thanks.
See if this does the trick:
Dim crParameterDiscreteValue As New CrystalDecisions.Shared.ParameterDiscreteValue()
crParameterDiscreteValue.Value = Nothing
C# would look something like;
CrystalDecisions.Shared.ParameterDiscreteValue crParameterDiscreteValue;
crParameterDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
crParameterDiscreteValue.Value = null;
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Similar Messages
-
How do I set a NULL value for the parameter field
Hi
I've another question. I'm going to set single values for parameter fields.
// e.g. set today for StartDate parameter field
fc.setCurrentValue("", "StartDate", new Date());
It should be possible to set a NULL value for date parameter fields.
fc.setCurrentValue("", "StartDate", (Date)null);
But this do not work. How do I set a NULL value correctly?
Thank you in advance.
Best regards,
ThomasFirst question - is it a stored procedure parameter?
You can't set a regular parameter field value to a null value.
There was an issue with old version of the JRC, where it was allowing null to go through, but had unexpected behavior at times.
Sincerely,
Ted Ueda -
How can I pass Flex Field value to the Call Wrap Up screen?
Hello helpers,
I am trying to get a value from the 'Flex Field' passed over to the 'Call Wrap Up' screen by using Form Personalization.
Oracle was configured by a subcontractor and therefore I do not know what the exact name of the textfield is in the Flex Field however the label is 'Method of Contact'. When i set 'Show Custom Events' to 'On', I get the response: 'CSXXXRC.INCIDENT_TRACKING.STATUS_CODE:WHEN-NEW-ITEM-INSTANCE' When i enter a value in the Method of Contact field in the Flex Field.
Can anyone help?
I am a complete Newbie to Oracle.... I only know a bit about Oracle Form Personalization.
Any help would be much appreciated,
SSeems like you're talking about a from from the eBusiness-suite. There are special rules for that, ask your question in the eBusiness-suite-forum OA Framework
-
How can i pass second text value to the procedure.
Hi ,
I have used APEX_ITEM.TEXT(1,null) Item_name,APEX_ITEM.TEXT(2,null) file_name in a sql query and i should pass these two text value as a input parameter to the Procedure.
So in Process i have written code like
FOR i IN 1 .. APEX_Application.g_f01.COUNT
LOOP
generate_report_data(APEX_Application.g_f01(i)
,APEX_Application.g_f02(i)
END LOOP;
COMMIT;
if i enter values in two text columns then two values are passing to a procedure it's fine.
Here the issue is if i leave the first value as balnk and enter the 2 nd value like Xyz then click on a submit button
so 2 nd value also passing null to the procedure..
please anybody guide on this issue..
Thanks in advance..
Regards
Narender BHello Narender,
>
Here the issue is if i leave the first value as balnk and enter the 2 nd value like Xyz then click on a submit button
so 2 nd value also passing null to the procedure..
>
This is happening because of FOR i IN 1 .. APEX_Application.g_f01.COUNT in your procedure:
>
FOR i IN 1 .. APEX_Application.g_f01.COUNT
LOOP
generate_report_data(APEX_Application.g_f01(i)
,APEX_Application.g_f02(i)
END LOOP;
COMMIT;
>
FOR i IN 1 .. APEX_Application.g_f01.COUNT this loop will take only those values of apex_application.g_f01 into consideration whose value is not null.
Hope it helps!
Regards,
Kiran -
How can I pass a custom value to the ecommerce invoice?
I would like to pass a barcode or an image to the ecommerce invoice once they buy my product. The idea is that they would print the email or pdf attached to it and reclaim their products on my physical store in case shipping is not allowed for their area. Is this possible?.
Hey Klaye,
I'm not sure if that php generator would work on the CRM because from what I understand it only uses javascript. I found these websites that might interest you:
http://parall.ax/products/jspdf (a javascript pdf generator)
http://www.atlantawebdesignga.com/adobe-business-catalyst-developer/how_to_get_business_ca talyst_e-commerce_to_do_the_impossible (an ecommerce "hack")
My plan was combining both methods plus a jquery barcode generator to insert the pdf in the ecommerce invoice, but your method seems better. Have you tested it? Does it work with the {tag_invoicenumber}?.
I haven't had the time to work on this because I'm working for some clients right now. But if I do get something to work I'll post it here. Hope that helped. -
Passing null values to the attributes of a CAF operation
Hi,
In CAF I am trying to fetch data through Web Service. For this I need to pass null value for the attributes of the operation.If I set the value to null it gives me missing parameter as the error.
Can anyone tell me how to pass null values to the attributes of a CAF operation?Hi Xavier,
Declare the two variables of type if_wd_contex_node for e.g. lv_node and if_wd_context_element for e.g. lv_element. Now in the first one lets say lv_node get the refrence of dynamically created node like:
lv_node = wd_context->get_child_node('<node name>').
Then get the refrence of element like:
lv_element = lv_node->get_element( ). (You can also pass index as parameter check the method API)
then just set the value of attribute you want like:
lv_element->set_attribute( exporting name = '<attribute name>' value = '<your value>').
Regards,
Neha -
Pass a null value to a JDBC stored procedure call?
pass a null value to a JDBC stored procedure call? Is this even possible? My DBA gave me a procedure to call that sometimes requires a null value. I don't think this is even possible.
do you mind tell me how to resolve your problem?i using the setnull method,but it doesn't work.
-
How does APEX check for null values in Text Fields on the forms?
Hello all,
How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
Declare
v_valid boolean;
Begin
IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
v_valid := TRUE;
ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
v_valid := TRUE;
ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
v_valid := FALSE;
ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
v_valid := FALSE;
END IF;
return v_valid;
END;
My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
ThanksSee SQL report for LIKE SEARCH I have just explained how Select list return value works..
Cheers,
Hari -
How can I get null values for the later weeks
Hi All,
When I execute this code I get the records till current week.
How can I display the output so that I get null values for the later weeks. (with the help of v_numOfWeeks variable in the code)
Thanks,
Vikram
DECLARE
v_query VARCHAR2(4000);
TYPE ref_cursor IS REF CURSOR;
v_refcur ref_cursor;
v_sum NUMBER;
v_id NUMBER;
v_name VARCHAR2(1000);
v_weeknum NUMBER;
v_pernum NUMBER;
v_numOfWeeks NUMBER := 5;
BEGIN
v_query := ' SELECT SUM(product_bkg), postn_id, postn_tbl.postn_name, b.week_num, b.period_num
FROM ops_cv_extract b, (SELECT row_id, desc_text postn_name
FROM s_postn) postn_tbl
WHERE lvl_6_id = 5767
AND fiscal_year = 2008
AND b.week_num < 4
AND b.period_num = 3
AND b.postn_id = TO_NUMBER(postn_tbl.row_id)
GROUP BY postn_id, postn_tbl.postn_name, b.week_num, b.period_num
ORDER BY postn_tbl.postn_name, b.week_num';
OPEN v_refcur FOR v_query;
LOOP
FETCH v_refcur INTO v_sum, v_id, v_name, v_weeknum, v_pernum;
EXIT WHEN v_refcur%notfound;
dbms_output.put_line('P'|| v_pernum||'W'|| v_weeknum||' '||v_name||' '||v_sum);
END LOOP;
END;
This is the output when I execute this code.
P3W1 COMM CNTRL ISAM 213 26961.61
P3W2 COMM CNTRL ISAM 213 12870.4
P3W3 COMM CNTRL ISAM 213 245.88
P3W1 COMM CNTRL ISAM 273 72831.2
P3W2 COMM CNTRL ISAM 273 8739.38
P3W3 COMM CNTRL ISAM 273 3764.92
P3W1 COMM CNTRL TAM 213 49844
P3W2 COMM CNTRL TAM 213 20515.17
P3W3 COMM CNTRL TAM 213 16167.46
P3W2 COMM CNTRL TAM 216 12561.4
P3W3 COMM CNTRL TAM 216 2027.1
P3W1 COMM CNTRL TAM 273 -3336.71
P3W2 COMM CNTRL TAM 273 -1376.68
P3W3 COMM CNTRL TAM 273 19707.42
P3W1 Damon Walters -609.07
P3W2 Damon Walters 30030.24
P3W3 Damon Walters 37475.1
This is the output I'd like to get
P3W1 COMM CNTRL ISAM 213 26961.61
P3W2 COMM CNTRL ISAM 213 12870.4
P3W3 COMM CNTRL ISAM 213 245.88
P3W4 COMM CNTRL ISAM 213
P3W5 COMM CNTRL ISAM 213
P3W1 COMM CNTRL ISAM 273 72831.2
P3W2 COMM CNTRL ISAM 273 8739.38
P3W3 COMM CNTRL ISAM 273 3764.92
P3W4 COMM CNTRL ISAM 273
P3W5 COMM CNTRL ISAM 273
P3W1 COMM CNTRL TAM 213 49844
P3W2 COMM CNTRL TAM 213 20515.17
P3W3 COMM CNTRL TAM 213 16167.46
P3W4 COMM CNTRL TAM 213
P3W5 COMM CNTRL TAM 213
P3W1 COMM CNTRL TAM 273 -3336.71
P3W2 COMM CNTRL TAM 273 -1376.68
P3W3 COMM CNTRL TAM 273 19707.42
P3W4 COMM CNTRL TAM 273
P3W5 COMM CNTRL TAM 273
P3W1 Damon Walters -609.07
P3W2 Damon Walters 30030.24
P3W3 Damon Walters 37475.1
P3W4 Damon Walters
P3W5 Damon Walters Edited by: polasa on Oct 28, 2008 6:42 PMSure, in a Single SQL ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.01
satyaki>
satyaki>
satyaki>-- Start Of Test Data --
satyaki>with week_tab
2 as
3 (
4 select 1 period_num, 1 week_num, 10 bkg1 from dual
5 union all
6 select 1, 2, 40 from dual
7 union all
8 select 1, 3, 30 from dual
9 union all
10 select 1, 2, 20 from dual
11 union all
12 select 1, 1, 10 from dual
13 union all
14 select 1, 1, 20 from dual
15 union all
16 select 1, 3, 10 from dual
17 union all
18 select 2, 1, 15 from dual
19 union all
20 select 2, 2, 20 from dual
21 union all
22 select 2, 3, 10 from dual
23 union all
24 select 2, 1, 15 from dual
25 union all
26 select 2, 2, 30 from dual
27 union all
28 select 2, 3, 20 from dual
29 )
30 -- End Of Test Data --
31 select period_num,
32 week_num,
33 (
34 select sum(week_tab.bkg1)
35 from week_tab
36 where period_num = m.period_num
37 and week_num = m.week_num
38 group by week_num, period_num
39 ) sum_bkg1
40 from (
41 select dum.week_num,
42 wk.period_num
43 from (
44 select 1 week_num from dual
45 union all
46 select 2 from dual
47 union all
48 select 3 from dual
49 union all
50 select 4 from dual
51 union all
52 select 5 from dual
53 ) dum ,
54 (
55 select distinct period_num
56 from week_tab
57 ) wk
58 ) m;
PERIOD_NUM WEEK_NUM SUM_BKG1
1 1 40
1 2 60
1 3 40
1 4
1 5
2 1 30
2 2 50
2 3 30
2 4
2 5
10 rows selected.
Elapsed: 00:00:00.48
satyaki>Regards.
Satyaki De. -
HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE
HOW CAN I PASS A DEFAULT VALUE IN INTERNAL TABLE.
DATA : BEGIN OF ITAB OCCURS 0,
FIELD1(2) TYPC C DEFAULT '12',
FIELD2 TYPE C ,
END OF ITAB1.
IT'S GIVING ERROR MESSAGE.
PLZ LOOK INTO THIS AND GIVE ME CORRECT SOLUTION.
THANKS
SURIDATA : BEGIN OF ITAB OCCURS 0,
FIELD1(2) TYPC C,
FIELD2 TYPE C ,
END OF ITAB1.
itab-field1 = '12'.
itab-field2 = 'A'.
append itab.
clear itab-field2.
itab-field1 = '12'.
itab-field2 = 'B'.
append itab.
clear itab-field2.
Now everytime u'll have the value for field1 = '12'.
Regards
Vasu -
How to select instances without null value?
hye all,
i need to do th ereprocessing data whereas i have to select the instances without null value from the database..
for example:
id name
123 izza
345 alex
567
the id = 567 contain null value..so..its automatically will not be selected from the database...
how about if it have about 10 or more attributes to be selected..
how can i work with the SQL thanks..Hi,
Query for your example should like like this:
SELECT * FROM <your_table>
WHERE name is null;
how about if it have about 10 or more attributes to be selected..
If using 10 or more attributes you mean 10 or more columns with null use this:
SELECT * FROM <your_table>
WHERE <col1> is null AND <col2> is null etc...Peter D. -
Is it possible to pass a null value to a method?
is it possible to pass a null value to a method?
like this
public String getParameterXX(String testvalue)
String strX = "whatever";
if(testvalue!=null)
strX = strX + " man " ;
Is this possible ?
is this legal
String i = getParameterXX(null);I also ran a similar code using null in a method, it just considers null as another string and concatenates it so
public String getParameterXX(String testvalue)
String strX = testvalue+"whatever";
return strX;
public static void main(String [] args)
Test tt = new Test();
String i = tt.getParameterXX(null);
System.out.println(i);
Gives me "nullwhatever" -
How can i pass function return values in to varray
Hi
create procedure name(parameters list)
here ---i am calling a function
varname := function name
returns 4 values
My doudt is how can i pass these return values in to varray..
Type varray vname[5] date type
Begin
statements
end prodedure name;
pls clarify me its urgentThis may give u a start
sql>
create or replace package test_array_pack as
type ar1 is varray(10) of number;
end;
Package created.
sql>
create or replace function test_array return test_array_pack.ar1 is
v_ar1 test_array_pack.ar1;
begin
v_ar1 := test_array_pack.ar1(1,2,3,4);
return v_ar1;
end;
Function created.
sql>
declare
v_ar2 test_array_pack.ar1;
begin
v_ar2 := test_array;
end;
PL/SQL procedure successfully completed
Message was edited by:
jeneesh -
How to put the null value at the last of a select list
Hello,
I have a select list with a null value, I want the null value to be the last value in the list. It always appears in the top of the list, Desc and Asc order is not working.
Thank you in advance!
Edited by: Najla on Apr 1, 2013 10:37 PMHi,
Edited by: Howard (... in Training) on Apr 2, 2013 1:xx PM
The statement - I don't think it is possible to arrange the order of the null option in a select list.- is close. You can't control the order of the Null value if you add the Null value through the GUI. However, it can be added and controlled as part of a SELECT ...
One way is to add NULL to the "SELECT". Here the Yes/No are hard-coded but they could have been selected from a table:
select d, r from
select 'YES' d, 'Y' r from dual
union all
select 'No' d, 'N' r from dual
union all
select Null d, '<Null>' r from dual
) order by 1 desc NULLS lastHoward -
Need help Take out the null values from the ResultSet and Create a XML file
hi,
I wrote something which connects to Database and gets the ResultSet. From that ResultSet I am creating
a XML file. IN my program these are the main two classes Frame1 and ResultSetToXML. ResultSetToXML which
takes ResultSet & Boolean value in its constructor. I am passing the ResultSet and Boolean value
from Frame1 class. I am passing the boolean value to get the null values from the ResultSet and then add those
null values to XML File. When i run the program it works alright and adds the null and not null values to
the file. But when i pass the boolean value to take out the null values it would not take it out and adds
the null and not null values.
Please look at the code i am posing. I am showing step by step where its not adding the null values.
Any help is always appreciated.
Thanks in advance.
============================================================================
Frame1 Class
============
public class Frame1 extends JFrame{
private JPanel contentPane;
private XQuery xQuery1 = new XQuery();
private XYLayout xYLayout1 = new XYLayout();
public Document doc;
private JButton jButton2 = new JButton();
private Connection con;
private Statement stmt;
private ResultSetToXML rstx;
//Construct the frame
public Frame1() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
//Component initialization
private void jbInit() throws Exception {
//setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));
contentPane = (JPanel) this.getContentPane();
xQuery1.setSql("");
xQuery1.setUrl("jdbc:odbc:SCANODBC");
xQuery1.setUserName("SYSDBA");
xQuery1.setPassword("masterkey");
xQuery1.setDriver("sun.jdbc.odbc.JdbcOdbcDriver");
contentPane.setLayout(xYLayout1);
this.setSize(new Dimension(400, 300));
this.setTitle("Frame Title");
xQuery1.setSql("Select * from Pinfo where pid=2 or pid=4");
jButton2.setText("Get XML from DB");
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
catch(java.lang.ClassNotFoundException ex) {
System.err.print("ClassNotFoundException: ");
System.err.println(ex.getMessage());
try {
con = DriverManager.getConnection("jdbc:odbc:SCANODBC","SYSDBA", "masterkey");
stmt = con.createStatement();
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);
contentPane.add(jButton2, new XYConstraints(126, 113, -1, -1));
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
void jButton2_actionPerformed(ActionEvent e) {
try{
OutputStream out;
XMLOutputter outputter;
Element root;
org.jdom.Document doc;
root = new Element("PINFO");
String query = "SELECT * FROM PINFO WHERE PID=2 OR PID=4";
ResultSet rs = stmt.executeQuery(query);
/*===========This is where i am passing the ResultSet and boolean=======
===========value to either add the null or not null values in the file======*/
rstx = new ResultSetToXML(rs,true);
} //end of try
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
======================================================================================
ResultSetToXML class
====================
public class ResultSetToXML {
private OutputStream out;
private Element root;
private XMLOutputter outputter;
private Document doc;
// Constructor
public ResultSetToXML(ResultSet rs, boolean checkifnull){
try{
String tagname="";
String tagvalue="";
root = new Element("pinfo");
while (rs.next()){
Element users = new Element("Record");
for(int i=1;i<=rs.getMetaData().getColumnCount(); ++i){
tagname= rs.getMetaData().getColumnName(i);
tagvalue=rs.getString(i);
System.out.println(tagname);
System.out.println(tagvalue);
/*============if the boolean value is false it adds the null and not
null value to the file =====================*/
/*============else it checks if the value is null or the length is
less than 0 and does the else clause in the if(checkifnull)===*/
if(checkifnull){
if((tagvalue == null) || tagvalue.length() < 0 ){
users.addContent((new Element(tagname).setText(tagvalue)));
else{
users.addContent((new Element(tagname).setText(tagvalue)));
else{
users.addContent((new Element(tagname).setText(tagvalue)));
root.addContent(users);
out=new FileOutputStream("c:/XMLFile.xml");
doc = new Document(root);
outputter = new XMLOutputter();
outputter.output(doc,out);
catch(IOException ioe){
System.out.println(ioe);
catch(SQLException sqle){Can someone please help me with this problem
Thanks.
Maybe you are looking for
-
How can I find the index from a specific container?
How can I find the index from a specific container? For example, if I'm traversing through textframes like so (an example, not tested): var doc = app.activeDocument; var story = doc.pages[0].textFrames[0].parentStory; for (var i=0, l=story.textContai
-
Does anyone know how many times a newly purchased product (MB Air 2014) can be exchanged within the 14 day period? I feel like the MB Pro would be a better fit for me, so I wanted to exchange my Air for the Pro. But also, if I end up not liking the P
-
Illustrator CS6 unexpectedly quits upon launching. MAC OS 10.9.3.
Hello, Every time I launch Illustrator CS6 it unexpectedly quits. I have a Mac Pro with OS 10.9.3, 2.8 GHz Quad-Core Intel Xeon. What is the solution to get Illustrator working again? Thanks for your help. Here are the problem details and system conf
-
I keep getting message: "Error in PDF Preview Handler." Can't open anything
-
The last time I updated my Firefox, I received a dialog box instructing me to update my Flash player, which I did immediately. When I then visited sites requiring a flash player, all the sites crashed and I was unable to view the contents of these si