Crystal Reports 9 and SQL Server 2005 default parameter values

We're using Crystal Reports 9 and upgraded from SQL Server 2000 to SQL Server 2005.
I'm noticing a very weird problem which I wonder if anyone else has experienced (and hopefully found a resolution for). It appears that in using Crystal with SQL Server 2005 stored procedures, if we have default parameter values in the stored procedures, the default parameter values get completely ignored if you pass in a NULL value from Crystal!
For example, if you have a stored procedure that begins like this:
ALTER          Procedure [dbo].[StoredProcedure]
@Param1 VarChar(200) = '',
@Param2 VarChar(200) = ''
AS ...
both @Param1 and @Param2 have a default value of an empty string, and therefore should become empty strings if nothing (NULL values) gets passed in for them.
But, like I said, what I'm finding is that with Crystal calling the stored procedure with NULL @Param1 and @Param2 values, they never become empty strings, but rather remain as NULLs.
This was never a problem with SQL 2000.
Very perplexing. Anyone else every experience this?
Thank you.

Please ignore my earlier post -- answered my own question.
NULL parameter values do not get replaced by default values in SQL -- that is normal behavior in both SQL 2000 and SQL 2005. Just goes to show, that no many how many years programming experience you have, you can still get tripped up sometimes : (

Similar Messages

  • Crystal Reports and SQL Server 2000

    Hi all,
    I read the document "Troubleshooting Database Connectivity for Crystal Reports" and tried all SQL Server jdbc drivers (1.2, 2.0,2.0.1, 3) and I could not find  a working driver with crystal reports at all.
    http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/d05b3bb7-0f28-2c10-4ea3-84dbdc4e414e?quicklink=index&overridelayout=true
    I'm also not sure if there is a working one?
    Are there anybody who suggest me a jdbc driver for SQL server which also supports Crystal Reports?
    The connection is ok, but the problem is I don't see tables and other staff under the connection...According to the document above, this means the driver does not support crystal reports...
    Product versions which involve this issue as follows:
    SQL Server 2000
    JRE 5.0
    Crystal Reports 11.8 (Comes with IBM RAD 7.5 IDE)
    Platform : IBM Portal 6.1.0.2 ( IBM Websphere App. Server 6.1)
    Any help would deeply be appreciated.
    I'm totaly exhausted. I hope someone help me...
    Best regards,
    E.

    I gave up this issue since I learnt that Crystal Java Reporting Component does not support portlet.  I also tried with SQL 2008 and I also updated my IDE for updating Crystal plug-in in it.  It was finally working at portal but the pager buttons and other staff in the viewer were not working since it  still does not support portlet.
    Thanks a lot.
    E.

  • Creating OLAP report with Crystal Reports and SQL Server Analysis Services 2005

    Post Author: orahc_mao
    CA Forum: Data Connectivity and SQL
    Hi!
    I am currently using the trial version of the Crystal Reports XI and I wanted to do an OLAP report. The problem is I cannot select a cube using "OLAP Connection Browser" (the popup window). I already selected Microsoft OLE DB Provider and entered the server name but still can't connect.
    I don't think the problem is with SQL Server Analysis Services (2005) since Microsoft Excel - Import Data can detect the server as well as the cube I have created.
    I also tried the "Database Expert" of Crystal Reports, created an OLE DB (ADO) connection with "OLE DB Provider for OLAP Services 8.0" driver, entered the server name, checked the integrated security and then I can readily select the database created at SQL Server Analysis Services. However, I still need the OLAP grid create the report but it goes back to my original problem... selecting a cube.
    I hope somebody would help me with this issue.
    Thanks a lot!
    orahc_mao

    Hello,
    I don't recognize those variables as CR ones so it's likely something the original developer is setting in code.
    You'll have to discuss with that person.
    If your have SDK issues then post your question to one of the .NET or Java SDK forums.
    Thank you
    Don

  • JPA and SQL Server 2005's  Identity Don't Play Nice

    I am hoping someone with a little more senior knowledge of JPASQL Server 2005 can point me in the right direction involving SQL Server 2005.
    What I am discovering is JPA and SQL Server 2005 do not playing nice together when you use the IDENTITY capability for
    a primary key. Let me explain. "...when using the IDENTITY as the generator type, the value for the identity field MAY NOT be
    available BEFORE the entity data is saved in the database because typically it is generated when a record is committed."
    My problem is this.
    I have two separate entities using another entity, for example a car has a wheel and a truck has a wheel. I can go through the steps
    of persisting the car and the wheel with no problem. My problem begins when I try to
    find the wheel (by wheel description) for the truck. The query finds the wheel, but does not return the primary key for wheel.
    Therefore, using the PK inside a query generates this error:
    java.lang.IllegalArgumentException: An instance of a null PK has been incorrectly provided for this find operation. What has been my appraoch to get the entity to commit to the database is to use the following sequence for the Entity Manager.
    entityManager.persist(wheel);
    entityManager.flush(); I have assumed to this point this action would persist my data because I have been able to retrieve the PK immidately after these steps.
    However, multiple actions taking place within the same transaction, appears to render the persist and flush steps useless. My initial thought
    is to wrap the wheel creation within a new transaction so when the method/transaction completes, the data would be in the database. This
    has not worked.
    I hope I have explained this clear for others to follow. I apologize in advance if I have not. Any suggestions are greatly appreciated.

    I am hoping someone with a little more senior knowledge of JPASQL Server 2005 can point me in the right direction involving SQL Server 2005.
    What I am discovering is JPA and SQL Server 2005 do not playing nice together when you use the IDENTITY capability for
    a primary key. Let me explain. "...when using the IDENTITY as the generator type, the value for the identity field MAY NOT be
    available BEFORE the entity data is saved in the database because typically it is generated when a record is committed."
    My problem is this.
    I have two separate entities using another entity, for example a car has a wheel and a truck has a wheel. I can go through the steps
    of persisting the car and the wheel with no problem. My problem begins when I try to
    find the wheel (by wheel description) for the truck. The query finds the wheel, but does not return the primary key for wheel.
    Therefore, using the PK inside a query generates this error:
    java.lang.IllegalArgumentException: An instance of a null PK has been incorrectly provided for this find operation. What has been my appraoch to get the entity to commit to the database is to use the following sequence for the Entity Manager.
    entityManager.persist(wheel);
    entityManager.flush(); I have assumed to this point this action would persist my data because I have been able to retrieve the PK immidately after these steps.
    However, multiple actions taking place within the same transaction, appears to render the persist and flush steps useless. My initial thought
    is to wrap the wheel creation within a new transaction so when the method/transaction completes, the data would be in the database. This
    has not worked.
    I hope I have explained this clear for others to follow. I apologize in advance if I have not. Any suggestions are greatly appreciated.

  • SAP Crystal Report using SQL Server Authentication and Windows Authenticati

    I'm a SAP Crystal Report, version for Visual Studio 2010 Beginner
    my ingredients are
    1.windows 7 ultimate service pack1
    2.sql server 2008 standard edition
    3.visual studio 2010 pro
    4.SAP Crystal Report, version for visual studio.net
    I was created a report named customersByCity.rpt using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> I'm supply Server, User ID, Password and Database. I assume me using SQL Server Authentication for my report
    Then, my ASP.NET files as following
    //ASP.NET
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="viewCustomersByCity.aspx.cs" Inherits="viewCustomersByCity" %>
    <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div><asp:Label ID="lblMsg" runat="server" BackColor="Yellow" ForeColor="Black"></asp:Label>
     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"></CR:CrystalReportViewer>
        </div>
        </form>
    </body>
    </html>
    //code-behind
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Collections;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    public partial class viewCustomersByCity : System.Web.UI.Page
        private const string PARAMETER_FIELD_NAME = "city";   
        private ReportDocument customersByCityReport;
        private void ConfigureCrystalReports()
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo.ServerName = @"WKM1925-PCWKM1925";
            connectionInfo.DatabaseName = "Northwind";
            connectionInfo.UserID = "sa";
            connectionInfo.Password = "sysadmin25";
            SetDBLogonForReport(connectionInfo);
        private void SetDBLogonForReport(ConnectionInfo connectionInfo)
            TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo;
            foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
                tableLogOnInfo.ConnectionInfo = connectionInfo;
        private void SetCurrentValuesForParameterField(ReportDocument reportDocument, ArrayList arrayList)
            ParameterValues currentParameterValues = new ParameterValues();
            foreach (object submittedValue in arrayList)
                ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
                parameterDiscreteValue.Value = submittedValue.ToString();
                currentParameterValues.Add(parameterDiscreteValue);
            ParameterFieldDefinitions parameterFieldDefinitions = reportDocument.DataDefinition.ParameterFields;
            ParameterFieldDefinition parameterFieldDefinition = parameterFieldDefinitions[PARAMETER_FIELD_NAME];
            parameterFieldDefinition.ApplyCurrentValues(currentParameterValues);
        protected void Page_Load(object sender, EventArgs e)
            customersByCityReport = new ReportDocument();
            string reportPath = Server.MapPath("customersByCity.rpt");
            customersByCityReport.Load(reportPath);
            ConfigureCrystalReports();
            ArrayList arrayList = new ArrayList();
            arrayList.Add("paris");
            arrayList.Add("Madrid");
            arrayList.Add("Marseille");
            arrayList.Add("Buenos Aires");
            arrayList.Add("Sao Paulo");
            ParameterFields parameterFields = CrystalReportViewer1.ParameterFieldInfo;
            SetCurrentValuesForParameterField(customersByCityReport, arrayList);
            CrystalReportViewer1.ReportSource = customersByCityReport;
    1st scenario
    When in a runtime, it's keep appear a dialog box. This dialog box ask me to suppy Server, User ID, Password and Database. Once all information is supplied, my report display the data as expected
    2nd scenario
    I change my report using OLE DB (ADO) -> Microsoft OLE DB Provider for SQL Server -> checked on Integrated Security. I just choose Server, and Database. I assume me using Windows Authentication
    When in a runtime, there's no dialog box as above. My report display the data as expected. really cool
    Look's like, when report using SQL Server Authentication there's some problem. but, when report using Windows Authentication, it's fine.
    I'm looking for comment. Please help me

    Hello,
    MS SQL Server 2008 requires you to install the MS Client Tools for 2008.
    Once install then update all of your reports to use the SQL Native 10 as the OLE DB driver.
    The try again, if it still fails search, lots of sample log on code in this forum.
    Don

  • How to create a lookup in Crystal Reports or SQL Server

    I need to create an Operating Statement report.  The problem is that I need to create a lookup or something to satify a requirement that even if there is no data in the system it will still bring back a description.
    Example:  01 = Income, 02 = Expense, 03 = Labor.. ect(there are 31 of these)
    If there is no data for 03 I still need Labor to print.
    In my SQL I did a CASE statment that said when
    Account = '3001' THEN 01, Account = '3002' THEN 02, Account = '3003' THEN 03 ECT
    Then I created a formula a in Crystal that reads the case Statement to assign descriptions 01 = Income, 02 = Expense, 03 = Labor.
    The problem is when there is no data for Account 3003 then the formula does not know to still bring back 03 as Labor.
    Can I create a lookup to assign the description, I dont care about the values they can come back as zero.
    Is there a formula or can I create a sql statement to pull back a derived table anything but to create a physical table?
    Any help would be great.
    Application is Crystal Reports XI 2 SP2
    SQL Server 2005
    Peoplesoft 8.9 Financials.

    Thank you Ludek for answering my post.  That was just the information I needed.  I inserted a formula field and then changed the font to Wingdings and that gave me my checkbox.    Not being familiar with Crystal Reports I had a devil of a time just figuring out how to insert a formula field as the field explorer is not easy to find.  The following link will help any developers who might have that problem too.
    http://aspadvice.com/blogs/rjdudley/archive/2005/08/09/2642.aspx
    Lastly Iu2019ll add the part of my formula which gives you a checked or unchecked check box in a Windings font:
    --For Check box checked
        Formula = Chr(254)
    --For Check Box unchecked
        Formula = Chr(168)

  • Crystal Reports 10 - SQL Server

    Hi
    We have Crystal Reports 10 currently in our organization and we want to know if it is compatible with SQL Server 2005 or SQL Server 2008?
    Does anybody have any idea on this? Any help as in white paper, links etc is appreciated.
    Thanks.

    Hi,
    Following is the list of the reporting databases on windows Platform supported with CR 10.
    Native Oracle 8.1.7
    Native Oracle 9.2
    Native DB2 8.1
    Native DB2 7.2
    Native Sybase 12.5
    Native Access 2000
    Native Access 2003
    ODBC-Teradata
    ODBC-SQL Server 2000
    ODBC-Oracle 8.1.7
    ODBC-Oracle 9.2
    ODBC-DB2 7.2
    ODBC-DB2 8.1
    ODBC-Sybase 12.5
    ODBC-Access 2000
    ODBC-Access 2003
    ODBC-Text
    OLEDB-SQL Server 2000
    OLEDB-Oracle 8.1.7
    OLEDB-Oracle 9.2
    OLEDB-DB2 7.2
    OLEDB-DB2 8.1
    OLEDB-Access 2000
    OLEDB-Access 2003
    Hope this helps!!
    Regadrs,
    Shweta

  • BO XI R2 and SQL server 2005 Analysis services

    Post Author: fasttrack
    CA Forum: Olap
    Hello,
    I am new in BO, I am using XI R2 and I would like to know this:
    I have to build some reports on Data Warehouse using SQL server 2005 Analysis Services.
    My question is:
    1) How I have to build this reports: directly to data warehouse or building an OLAP (CUBE) in analysis services 2005?
    2) BO XI R2 supports SQL server 2005 and especially in this case Analysis services 2005 and provider (I have seen only provider for SQL Server 2000)?
    Do you some good resources where to learn how to make reports on DW SQL server 2005?
    Thank

    Post Author: ShaunOberem
    CA Forum: Olap
    Hello,
    I am new in BO, I am using XI R2 and I would like to know this:
    I have to build some reports on Data Warehouse using SQL server 2005 Analysis Services.
    My question is:
    1) How I have to build this reports: directly to data warehouse or building an OLAP (CUBE) in analysis services 2005?
    2) BO XI R2 supports SQL server 2005 and especially in this case Analysis services 2005 and provider (I have seen only provider for SQL Server 2000)?
    Do you some good resources where to learn how to make reports on DW SQL server 2005?
    Thank
    Hi,
    If you are trying to create a new OLAP Intelligence Report using SQL 05 I am afraid you are out of luck.
    You will need to get a copy of the Productivity Pack (Available for Download in Subscribenet) .
    Also, in your SQL Server Sufrace Configuraiton manager try setting Analysis Services to Allow Ananomous connections. This will make sure you get a little further initially. (Dont leave Anonymous on)

  • OraOledb, Linked Servers and SQL Server 2005 issues

    Some issues I've come across when using SQL Server 2005 (and SQL Server Express 2005), the OraOLEDB provider (10.2.0.1) and a linked Oracle database (8.1.7.4.0 64-bit)
    1) You must set the OraOledb.Oracle\AllowInProcess value to 1 to allow the OraOledb provider to run in SQL Server's process. Without doing this I receive an 'unspecified error' from the OLE DB provider when attempting to run a query
    2) When running a ' select * ' query across a linked server using the provider, I receive the following error: Msg 9803, Level 16, State 1, Line 1
    Invalid data for type "numeric". I can, however, select all of the columns by name and the query completes (no error). Sometimes the 'select *' query returns a few rows before the error, sometimes it doesn't. The Microsoft Provider for Oracle does not have this problem

    Okay... I've got a Win2K3 Std Ed server (x64) running 64-bit SQL Server 2005 Enterprise Edition. I've installed the Oracle 10g 10.2.1 full client and admin tools, added two named services via the NetConfig assistant, and successfully set up (and tested) a connection via the ODBC Administrator to an Oracle database.
    Now... when I try to create a new connection manager in SQL Server 2005 Integration Services, the OLEDB provider for Oracle can't be found, and when I try to manually add an underlying OLEDB connection to the database, SQL Server reports:
    Test connection failed because of an error in initializing provider. The 'OraOLEDB.Oracle.1' provider is not registered on the local machine.
    Does anyone know what I need to do to see my ODBC Server data connections in SQL Server 2005 (64 bit)? I don't have this issue on my 32-bit SQL Server 2005 servers.

  • OraOledb for 64-bit, Linked Servers and SQL Server 2005 issues

    Our environment is : SQL Server 2005, Windows Server 2003, 64-bit and 32-bit operating systems.
    Problem on 64-bit operating system box: (32-bit works fine).
    I am trying to access Oracle 10g database using linked server from our SQL Server 2005. In case of number fileds i got the following error:
    Invalid data for type "numeric".
    After going through one of the posting in this forumn i was able to resolve the problem by converting those column values to char while querying and then converting them back to numeric type on SQL server side.
    But today i ran into another problem. There is a VARCHAR2 column. I was able to retrieve the data yesterday for that column but today i am getting a blank recordset. If i exclude the colum from the query then i am getting all the rows.
    I am querying against a view and it has got a number of columns whose data type is VARCHAR2.
    Again the problem is on 64-bit operating system only. We have a 32-bit operating system on which i am able to retrieve the data including this column. I looked at the data and everything looks OK. No funny characters etc.
    I tried workarounds like using cast, to_char, checking for nulls etc., Nothing works.
    Any help is greately appreciated. Thanks.

    Did you find a resolution for this? We have similar problem. Set up a linked server in SQL 2006 to Oracle (running on Windows 64-bit) Linked server works and views I had set up were working but they added some new data in the Oracle test database I am using and now I get errors on one of the views.
    Error I am getting on the view is "Cannot initialize the data source object of OLE DB Provider "OraOLDEDB.ORacle" for the linked server"
    If I fine tune my queries to find the specific table or view that is at issue, then I get the error "inconsistent metadata for a column"

  • B1 and SQL Server 2005 performance with 3.000.000 invoice-lines per year

    I would like to know if SAP Business One with SQL Server 2005 could work with the following information:
    - 40.000 Business Partners
    - 40.000 Invoices per month
    - Aprox. 3.000.000 invoice-lines per year
    Of course it will be necessary to change some forms in B1.
    What do you think?
    Do you know any B1 customer working with that amout of data?

    > Hi,
    >
    > I think a good SQL2005 tuning (done by a good DBA)
    > will improve performance. Number of records like that
    > shouldn't hurt that kind of DB engine...
    Hi,
    I'm sure that MSSQL2005 can handle the amount of records & transactions in question. Even MSSQL 2000 can do it. However, any DB engine can be put on its knees with the combination of 2-tier application architecture and badly designed queries. B1 is a case in point. I wouldn't go into such a project without decent preliminary load testing and explicit commitment for support from SAP B1 dev team.
    I have heard from implementation projects where B1 simply couldn't handle the amount of data. I've also participated in some presales cases for B1 where we decided not to take a project because we saw that B1 couldn't handle the amount of data (while the other features of B1 would have been more than enough for the customer). The one you're currently looking at seems like one of those.
    Henry

  • OWB 11.0.0.7 and SQL SERver 2005

    We did search quite a bit but couldnt get this working...
    We are using OWB 11.1.0.7 64bit on Windows 2003 Server 64bit R2
    We have to pull data from a SQl Server database – SQL SERVER 2005 64 bit on Windows 2008 R2 64 bit
    WE followed the procedures given in Oracle documentation –
    1. creating a ODBC DSN connection
    2. creating a init ora file for that connection
    3. creating a listener
    We tried with both HSODBC and DG4ODBC... We can connect to SQL server through OWB...the connection is successful but I cannot import the tables into OWB. It simply hangs forever. (in the init ora file we have put the HS_FDS_SUPPORT_STATISTICS=FALSE) We have to pull data from SQL server on an ongoing basis. However we found a workaround – we can create a remote link to the SQL server database by creating an entry in the tnsnames. However this connection is very slow – we have to pull thousands of records on daily basis. IT takes quite some time to do this. We have tried different combinations after Goodling.
    Could you shed some light on this? Is it a bug in OWB 11.1 that we cannot connect to SQL Serer or are we missing something? Will it be ok if we go for 11.2?

    Be wary about the differences between initialization settings for generic ODBC vs specific SQLServer gateway, they are different.
    http://download.oracle.com/docs/cd/B28359_01/gateways.111/b31049/apd.htm#BABHEBCE
    The installation guide has details in the SQLServer section for when the SQLServer gateway is used that you should follow (specifically under configuring SQL Server Views for Data Dictionary support - needed for importing tables definitions into OWB when you use SQLServer gateway);
    http://download.oracle.com/docs/cd/B28359_01/gateways.111/b31042/toc.htm
    If you have an existing database link this can be used in OWB. When importing the tables you need to be aware that if it is a SQLServer gateway you will need to configure the SQLServer instance as in the gateway doc above). Just because you can query table data does not mean the gateway is configured properly.
    Cheers
    David

  • Freetds and sql server 2005

    Hi guys
    I'm trying to create dblink from 10.2.0.4 database to sql server 2005 using freeTDS. Oracle database is on OEL5, ODBC is installed on another OEL5 machine with database gateway installed and listener started.
    So far everything woks fine. However it seems that something is wrong with character set conversion. I'm getting twice as much characters (character followed by a box character). I'm guessing this is 2 byte character set that has not been converted to 1 byte. Oracle DB has nls_characterset set to 'EE8ISO8859P2'.
    What setting should be set in init<>.ora for the DG4ODBC and freetds.conf?
    I also tried trial easysoft odbc driver and it works fine with these parameters in odbc.ini:
    # Convert UCS-2 encoded Unicode data to UTF-8
    ConvToUtf = Yes
    # Also do this conversion for data passed to Unicode ODBC function (SQLxxxW) calls
    ConvWToUtf = Yes

    I saw a similar behaviour using an Oracle unicode database. In this case try a unicode compliant tool like SQL Developer, connect to the Oracle db with the db link and select from the linked table.
    What is the source column data type and did you specify HS_LANGUAGE in the hsodbc init file?
    Edited by: kgronau on Nov 27, 2009 11:45 AM

  • Connectivity Issue with Vista and SQL Server 2005

    Hi all;
    I am unable to log into SQL Server 2005 due to a connectivity problem.
    When I telnet on the port for the server, the attempt at a connection fails.
    Does anyone have any ideas as to what I should do?
    THANKS!!!
    Wally

    Closed the thread regarding: http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/c20ee682-d329-4678-a8a6-6e10b746bf0e/
    Using the elevated mode fixed the problem.
    Jens K. Suessmeyer

  • Crystal report and SQL 2000  Integration to BW?

    HI All,
    We have following two requirements to be implemented
    1) We need crystal reports to be integrated with BW system.Please guide about the prerequisites as well as the procedure to be followed so as to generate Crystal reports once the plugins are in place.
    2) We need SQL 200 server to be interfaced with our BW system.Pleas do let me know apart from DB2 connect is there any other method that can be implemented and aslo If we use DB2 how should we go about handeling Delata.

    Hi
    1, once you setup the SAP Plugins you can connect to the BW system and view the tables and objects such as Query etc.
    then you build the report (Crystal Rep) using this data source.
    My experiance is that the performance is quite bad, so good luck to you.
    2, we use a data base level access in our BW.
    it means that the user has access rights on the DB level and then we can
    access the db using MS Query Analyzer.
    Reg's
    Edan

Maybe you are looking for