How to pop up if no data found in Crystal Reports XI

Hi,
Can you please suggest me how to alert message if no data found?
Thanks and regards,
Manjunath N. Jogin
Edited by: Manjunath N Jogin on Jan 21, 2010 2:53 PM

To Create a alert the following things has to done
Goto Report menu --> Alerts --> Create or Modify Alerts --> Click on New button.
Give the Name as No Records Found and then click on the Condition button and give the condition as
count({field}) = 0 // Where {field} is any DB field used in the report
This will create the alert. At each refresh it will alert you.
Write a formula in the report  as  ie.,Alert Message and give the condition as
If IsAlertTriggered ("No Records Found") Then
" No Records Found "
You can use this formula field in the report to show No Records Found when there is no records available.
Hope it might help you!

Similar Messages

  • How to pop up alert "No Data found" if there are no values in database

    Hi All,
    Please tell me how to pop up alert if there is no data found and all fields are null in report for given parameter value. or else is there any way to trigger user while entering parameter value that wrong parameter value. (I dnt want to use drop down) in my report.
    Please help me. Any help will be valuable.
    Thanks.

    There's no way that I know of to do this as a "Pop-up", but providing a "no records returned" warning still easy enough to do.
    Just insert a new Report Header section...
    Add a text box that has whatever message you'd like to display.
    Right click the new header section and choose Selection Expert
    Click the X-2 button next to Suppress (No Drill-Down)
    Enter a formula similar to this...
    IF COUNT({TableName.FieldName}) < 1 THEN FALSE ELSE TRUE
    This will suppress the warning if records are present and display it if there are none.
    HTH,
    Jason

  • How to register/configure a Data Provider with Crystal Report Designer

    Hi,
    Iu2019m in the process of developing an ADO .Net XML Data Provider which works with Data Sets. I want to use this custom Data Provider through Crystal Report Designer 2008 so that I can access it from the u201CStandard Report Creation Wizard\Available Data Sourcesu201D section. How can I do this? I read the following in the u201Ccreating custom adddins.docu201D documentation.
    u201CCrystal Reports (CR) 2008 installs a new managed dll called DotNetExternalCommandAdapter.DLL and installs it into the Global Assembly Cache (GAC).  CR 2008 uses this dll to search and load files with a csc prefix in CR 2008u2019s AddIns subdirectory in a similar way it looks for database drivers, export drivers and UFLs. To create an Add-In the developer needs to reference this dll and inherit two classes from it, ICommand and ICommandDLL.u201D
    I have the following questions,
    1) As it mentions above how can I make Crystal find my custom Data Provider when it searches for the database drivers?
    2) Is there another class I can inherit from when creating my custom data provider? If so where can I find some documentation regarding this?
    3) Can I register my custom data provider in to the GAC and will Crystal find it if so how can I register my custom Data Provider? Will GACUtil work for Crystal as well?
    Thanks in Advance,
    Regards,
    Chanaka

    Baron, thank you for providing that link.
    Chanaka see if that article helps you out. It should - had I got to this thread earlier, I'd have sent that link also. Certainly DE place to start.
    Ludek

  • How to hardcode date(s) in Crystal Reports?

    Post Author: Vishy
    CA Forum: Formula
    Hi,
    Any one have any idea about, how to hardcode the date(s) in Crystal Reports?
    For example, I want hardcode the US holidays in my Crystal Report.
    I am using Version 9.0.
    Your immediate help is greatly appreciated
    Thanks,
    Vishy

    Post Author: chantilly
    CA Forum: Formula
    Not sure I'm the best person to answer because I seem to be experimenting in my own inexperience.  What I would try first would be to create variables for each of the holidays and pull them into the report.  Such as
    dateVar Christmas := Date (2007, 12, 25);Christmas
    I think you can then perform more calculations on it, such as to find how many days etc.

  • How Do I Display HTML Formatted Text From A Data Table In Crystal Reports?

    I'm creating reports in Crystal XI.  The information being displayed in the reports comes from data tables where the text is formatted in HTML.
    I've worked with Crystal Reports enough to know that HTML text pulled from a data table doesn't appear in Crystal the same way it does in a web browser.  Crystal Reports ignores all the tags (...unless I'm missing something...) and just displays the text.
    Someone far more Crystal savy than I (...who I don't have access to...) came up with a Formula Field workaround that tricks Crystal Reports into displaying some basic HTML tags.  Here's that workaround:
    <!--
    stringVar TableName := ;
    TableName := Replace (TableName, "<ul>","<br> <br>");
    TableName := Replace (TableName, "<li>", "<br>   &bull; ");
    TableName := Replace (TableName, "</li>", "");
    TableName := Replace (TableName, "</ul>","<br> <br>");
    TableName := Replace (TableName, "<a", "<u><font color='blue'");
    TableName := Replace (TableName, "</a>", "</font></u>");
    TableName
    -->
    QUESTION - Does any similar workaround exist so I can display an HTML Table in Crystal Reports?  If not, is there any way to display HTML formatted text from a data table in Crystal Reports as it would appear in a web browser?

    Hi Steven,
    To display html text in Crystal Reports follows these steps.
    1. Right click on the field and select Paragraph tab.
    2. Under 'Text Interpretation' select 'HTML Text' and click OK.
    I have tried using the way,but it never works.So reply me if there is any way to solve the issue

  • Reading data from a crystal report using crystal for eclipse

    tried both approaches listed here: [Help needed in reading data from a Crystal Report]
    but having the same issues, is this a bug or is there some workaround? cant get any results with rowsetcursor and only the first 100 no matter what i do with browsefiledvalues

    Hello,
    I have the same problem. I need to know values of last record in CrystalReports and i got only 100 records.
    Have you found solution for this problem?

  • How to create a clickable Table of contents using Crystal Reports 8.5

    How to create a clickable Table of contents using Crystal Reports 8.5. I was able to create the table of contents using subreport and temporary table. but not able to link to the pages.
    how to make it clickable ?
    -Vivek

    Hi Vivek,
    To you may create on demand sub report.
    In main report only the link will be shown when you click on the link the sub report will be opened in a new tab.
    It can be placed in a Group header and to show the data for that particular group only.
    Click on the Help menu in the crystal Reports Designer and open the Crystal Reports Help
    Go to Index tab and type in subreport
    Select Creating On demand you will get lot of information on that.
    Please let us know if that is enough to solve your problem
    Regards,
    Aditya Joshi

  • Hierarchical Data Source in Crystal Reports Options

    We are trying to use Crystal Reports in VS2005 and set the data source
    to a list of our objects.
          Dim list As New BindingList(Of Payslip)
          Dim Report2 As New CrystalReport2()
          Report2.SetDataSource(list)
    This works fine when we are just considering the Payslip class in
    isolation. However we have a property on Payslip which contains a list
    of another class Element.
       Public Property Elements() As BindingList(Of Element)
          Get
             Return _Elems
          End Get
          Set(ByVal Value As BindingList(Of Element))
             _Elems = Value
          End Set
       End Property
    We would like to be able to display the Elements in the report, in a
    sub report ideally. However we cannot find a way of doing this. We can
    tell Crystal Reports how to link an Element to a PaysSlip, but not how
    to get to the Elements in the first place (i.e. by going through the
    property called Elements).
    How can we achieve this?

    The fundamental data model of Crystal Reports is relational and not object hierarchial.
    Are you able to transform the object hierarchy to a relational model?
    Sincerely,
    Ted Ueda

  • Writing and including our own customer data source to Crystal Report Design

    Hi,
    I need to create a Crystal Report based on a locally stored XML and schema. I can do this but the issue Iu2019m facing is that some tags used in the schema and the format is not supported by Crystal. So my plan is to write a database driver which will take our format and then convert it to the format Crystal supports and vise versa. To do this before writing the driver I need to know if itu2019s possible to include my custom database driver source in to the list that is shown in the Crystal Report Designer when selecting a data source to create a report.  Is there such an API available so that I can plugin my data source to Crystal Report Designer? Is this at least possible to do or is there another way?
    Hope you can help me.
    Thanks you in advance.
    Regards,
    Chanaka

    Hi Chanaka,
    Not directly. If you base your driver on OLD DB or ODBC then it will show up in those lists.
    If you are planning on selling a lot of packages then you may want to contact our OEM Sales team and sign up. You'll have more resources to do customized features like this. Not sure if we can but the option is there.
    Thank you
    Don

  • How to highlight the repeated records in a BO crystal report?

    Hi ,
    How to highlight the repeated records in a BO crystal report?
    we want to highlight the rows for which account number is same.
    thanks
    sriram

    You don't even need to create a group.  Just sort the records on the fields that define "duplicate".  Then you can just use
    if {field} = PreviousValue({field}) then crYellow else crNoColor
    in the format's Background Color formula.  This will cause the background to be yellow on duplicates.  (If you need to check more than one field in order to determine duplicates, just insert
    and {field2} = PreviousValue({field2}
    and so on for each field that needs to be checked.
    HTH,
    Carl

  • How to avoid: ORA-01403 no data found AND ORA-00001

    Hi,
    below my code:
    CREATE TABLE TAB_TO_EM
      EM_NUMBER           VARCHAR2(32),
      NAME_FIRST       VARCHAR2(32),
      NAME_LAST        VARCHAR2(32),
      MAILBOX            VARCHAR2(32)
    ALTER TABLE TAB_TO_EM
    ADD (CONSTRAINT PK_EM_NUMBER PRIMARY KEY (EM_NUMBER));
    CREATE TABLE EM
      EM_ID            VARCHAR2(32),
      EM_NUMBER           VARCHAR2(32),
      NAME_FIRST       VARCHAR2(32),
      NAME_LAST        VARCHAR2(32),
      EMAIL            VARCHAR2(32)
    ALTER TABLE EM
    ADD (CONSTRAINT PK_EM_ID PRIMARY KEY (EM_ID));THE PRIMARY KEY EM_ID COMES FROM THE TAB_TO_EM TABLE LINKED IN THIS WAY:
    NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||'_'||SUBSTR(EM_NUMBER,-2)
    I created this procedure to insert a new EM_NUMBER into EM table:
    CREATE OR REPLACE PROCEDURE INS_NEW_RECORD IS
    ERR_NUM                          NUMBER;
    ERR_MSG                          VARCHAR2(300);
    V_COUNT                          NUMBER;
    V_EM_ID                          VARCHAR2(64);
          CURSOR A IS
          SELECT A.EM_NUMBER, A.NAME_FIRST, A.NAME_LAST, A.MAILBOX
          FROM TAB_TO_EM A;
    BEGIN
          FOR CUR_A IN A
      LOOP
                 SELECT COUNT(*)
                 INTO V_COUNT
                 FROM EM2 B
                 WHERE B.EM_NUMBER=CUR_A.EM_NUMBER;
                 IF V_COUNT = 0 THEN
                 -- here insert a new record
                              INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
                              VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2),
                              CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);
                 END IF;
      END LOOP;
    END INS_NEW_RECORD;Example of my table:
    Insert into TAB_TO_EM
       (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
       ('22333', 'AAAA', 'BBBB', 'XXXX');
    Insert into TAB_TO_EM
       (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
       ('11222', 'AAAA', 'BBBB', 'XXXX');
    Insert into TAB_TO_EM
       (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
       ('00122', 'AAAA', 'BBBB', 'XXXX');
    commit;
    execute INS_NEW_RECORD;
    ORA-00001: ORA-00001: unique constraint violated (PK_EM_ID)
    ORA-06512: a "INS_NEW_RECORD", line 25
    ORA-06512: a line 2I tried to modify my procedure:
    CREATE SEQUENCE AFM.SEQ_EM_ID
      START WITH 1
      MAXVALUE 999999999999999999999999999
      MINVALUE 1
      NOCYCLE
      NOCACHE
      ORDER;
    IF V_COUNT = 0 THEN
           --verify duplicate pkey
                 SELECT (NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||SUBSTR(EM_NUMBER,-2))
                 INTO V_EM_ID
                 FROM EM B
                 WHERE (NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||SUBSTR(EM_NUMBER,-2)) = (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2))
                 AND ROWNUM=1;
                 IF V_EM_ID = (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)) THEN
                          INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
                          VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)||'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3),
                          CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);
                 ELSE
                              INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
                              VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2),
                              CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);
                 END IF;
          END IF;
    execute INS_NEW_RECORD;
    ORA-01403 no data foundI'd like to create a stored procedure with these conditions:
    IF em_id is duplicate insert new em_id= (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)||'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3)
    ELSE em_id= (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)
    How can I write my procedure correctly?
    Thanks in advance!

    1) What are you expecting this piece of code to do?
                 SELECT COUNT(*)
                 INTO V_COUNT
                 FROM EM B
                 WHERE B.EM_NUMBER=CUR_A.EM_NUMBER;My answer would be that i expect it to do nothing (unless i've misunderstood what you're doing up until now). You are making a new type of key in the EM table by frankensteining data elements from your tab_to_em table, so i would expect that code to always return 0. By the way, that's what we have a dup_val_on_index catch for, no need to read the table, you try your insert, if you dup a value, you take appropriate action.
    I guess the best way to proceed based on what you've provided would be 2 SQL statements.
    1) insert records where you cannot find a match in the target table
    2) insert records where you CAN find a match in the target table
    INSERT INTO EM (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    select
      A.NAME_LAST||'_'||SUBSTR(A.NAME_FIRST,1,3)||SUBSTR(A.EM_NUMBER,-2),
      A.EM_NUMBER,
      A.NAME_FIRST,
      A.NAME_LAST,
      A.MAILBOX
    from tab_to_em a
    where not exists
      select null
      from em b
      where b.NAME_LAST||'_'||SUBSTR(b.NAME_FIRST,1,3)||SUBSTR(b.EM_NUMBER,-2) = a.em_number
    INSERT INTO EM (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    select
      A..NAME_LAST||'_'||SUBSTR(A..NAME_FIRST,1,3)||SUBSTR(A..EM_NUMBER,-2)'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3),
      A.EM_NUMBER,
      A.NAME_FIRST,
      A.NAME_LAST,
      A.MAILBOX
    from tab_to_em a
    where exists
      select null
      from em b
      where b.NAME_LAST||'_'||SUBSTR(b.NAME_FIRST,1,3)||SUBSTR(b.EM_NUMBER,-2) = a.em_number
    );This comes with the caveat that what you are doing is a REALLY bad idea. Really really really bad idea.
    The baddies are
    1) your choice for a 'primary key'
    2) using a sequence and then substring it
    3) this is from a business perspective, storing the same person multiple times!
    Now, i don't know your system or requirements, but i am speaking in general terms here, this seems like a all around bad idea and i would suggest you revisit the design.

  • How to change the default "no data found"

    Hi,
    Is there a way to change the default "no data found" message of the "When No Data Found Message" in the Report Attributes?
    I would like to change that message for a French message. I know that I can change it manually in every section, but I would like another default messages appearing when i create a Report Section.
    Thanks

    Can you point me to a tutorial?Sure, Users Guide > Managing...Globalization (Chapter 15?)
    Is this not happening at run-time?Yes. What happens at runtime is the selection of the application to run. If you run a page in the Application Builder (app 4000) and that application had not been translated or your browser language were set to some flavor (flavour) of English, you get 4000. If app 4000 had been translated to French, say, and you request a page in 4000 and have your browser language set to French, then you'll really run the requested page from app 4002 which is a copy of 4000 translated to French long before your request came along.
    If you look at our distribution, you'll find 9 (or more) versions of each of the internal applications in the builder directory.
    Scott

  • How to resolve "ORA-01403: no data found"

    When i attempt to delete from a table on which an after delete trigger is defined, i get exception as follows;
    OracleException was unhadled by user code:
    ORA-01403: no data found
    ORA-06512: at "...TRIGGER_KATILIMEKLE", line11
    ORA-04088: error during the execution of trigger '...TRIGGER_KATILIMEKLE'
    Here is my trigger:
    Note: Before i added block -ELSIF DELETING THEN- it was working fine, yet now it throws that exception somehow. Since i am not new to oracle, i just couldn't figure out. Thanks...
    CREATE OR REPLACE TRIGGER TRIGGER_KATILIMEKLE AFTER INSERT OR DELETE ON IHALE_KATILINANIHALEDETAY
    REFERENCING NEW AS newRow
    FOR EACH ROW
    DECLARE
    srktkodu number;
    ihlkodu number;
    BEGIN
    IF INSERTING THEN
    select t2.srktkodu, t2.ihlkodu into srktkodu,ihlkodu from ihale_katilinanihale t2 where t2.detaykod=:newRow.detaykod;
    INSERT INTO ihale_katilimcilar t (t.aktif, t.SRKTKODU,t.ihlkodu,t.ihlaltktgkodu) VALUES('0', srktkodu, ihlkodu, :newRow.IHLALTKTGKODU);
    ELSIF DELETING THEN
    select t2.srktkodu, t2.ihlkodu into srktkodu,ihlkodu from ihale_katilinanihale t2 where t2.detaykod=:newRow.detaykod;
    DELETE FROM ihale_katilimcilar t WHERE t.srktkodu=srktkodu and t.ihlkodu=ihlkodu and t.ihlaltktgkodu=:newRow.IHLALTKTGKODU;
    END IF;
    END TRIGGER_KATILIMEKLE;
    Message was edited by:
    user611878

    REFERENCING NEW AS newRow
    ELSIF DELETING THEN
    ...=:newRow.detaykod;Please read about [url
    http://download.oracle.com/docs/cd/B10501_01/appdev.92
    0/a96590/adg13trg.htm#590]Accessing Column Values in
    Row Triggers in the manual.Thanks a lot.
    Using REFERENCING NEW AS newRow and OLD AS oldRow and ...=:oldRow.detaykod; I handled it, however it just doesn't assign other parameters in delete query, thus it deletes only when t.ihlaltktgkodu=:oldRow.IHLALTKTGKODU; in the delete query and ,gnore the rest.
    Although i assign the values of the parameters -srktkodu,ihlkodu- and make an successfull insert in the insert query, i just cannot in the delete. Why?
    Right here :
    select t2.srktkodu, t2.ihlkodu into srktkodu,ihlkodu from ihale_katilinanihale t2 where t2.detaykod=:oldRow.detaykod;
    DELETE FROM ihale_katilimcilar t WHERE t.srktkodu=srktkodu and t.ihlkodu=ihlkodu and t.ihlaltktgkodu=:oldRow.IHLALTKTGKODU;

  • How to hide buttons when no data found!!

    Hi All,
    I have created two regions
    1. Serach region
    2. Results region.
    Initally when the page loads by using hidden vaiable i am bale to hide the "results regions" once they clik on that serach button i am displaying the region of results region along with teo more buttons as "export" and "print" buttons.
    It is showing fine when data exists under Reulst region.
    But when no data is return i am displaying the message as "No data found" but along with this it is displaying "export" and "print" buutons.
    This buttons needs to display only when the data exists under Results region.
    Thanks,
    Anoo..

    abhishek8299 wrote:
    Use SQL (Exists) in the condition and write an sql statement there.use this
    SELECT
    1
    FROM form1 MF,bench1 BM,
    participant1 PP,key1 KT
    WHERE MF.ENGAGEMENT_ID=BM.ENGAGEMENT_ID
    AND BM.ENGAGEMENT_ID =PP.ENGAGEMENT_ID
    AND PP.ENGAGEMENT_ID =KT.ENGAGEMENT_ID

  • How to create a report with data using the Crystal Reports for Java SDK

    Hi,
    How do I create a report with data that can be displayed via the Crystal Report for Java SDK and the Viewers API?
    I am writing my own report designer, and would like to use the Crystal Runtime Engine to display my report in DHTML, PDF, and Excel formats.  I can create my own report through the following code snippet:
    ReportClientDocument boReportClientDocument = new ReportClientDocument();
    boReportClientDocument.newDocument();
    However, I cannot find a way to add data elements to the report without specifying an RPT file.  Is this possible?  I seems like it is since the Eclipse Plug In allows you to specify your database parameters when creating an RPT file.
    is there a way to do this through these packages?
    com.crystaldecisions.sdk.occa.report.data
    com.crystaldecisions.sdk.occa.report.definition
    Am I forced to create a RPT file for the different table and column structures I have? 
    Thank you in advance for any insights.
    Ted Jenney

    Hi Rameez,
    After working through the example code some more, and doing some more research, I remain unable to populate a report with my own data and view the report in a browser.  I realize this is a long post, but there are multiple errors I am receiving, and these are the seemingly essential ones that I am hitting.
    Modeling the Sample code from Create_Report_From_Scratch.zip to add a database table, using the following code:
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.definition.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
    <%@ page import = "com.crystaldecisions.report.web.viewer.*"%>
    <%
    try { 
                ReportClientDocument rcd = new ReportClientDocument();
                rcd.newDocument();
    // Setup the DB connection
                String database_dll = "Sqlsrv32.dll";
                String db = "qa_start_2012";
                String dsn = "SQL Server";
                String userName = "sa";
                String pwd = "sa";
                // Create the DB connection
                ConnectionInfo oConnectionInfo = new ConnectionInfo();
                PropertyBag oPropertyBag1 = oConnectionInfo.getAttributes();
                // Set new table logon properties
                PropertyBag oPropertyBag2 = new PropertyBag();
                oPropertyBag2.put("DSN", dsn);
                oPropertyBag2.put("Data Source", db);
                // Set the connection info objects members
                // 1. Pass the Logon Properties to the main PropertyBag
                // 2. Set the Server Description to the new **System DSN**
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_LOGONPROPERTIES, oPropertyBag2);
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_SERVERDESCRIPTION, dsn);
                oPropertyBag1.put("Database DLL", database_dll);
                oConnectionInfo.setAttributes(oPropertyBag1);
                oConnectionInfo.setUserName(userName);
                oConnectionInfo.setPassword(pwd);
                // The Kind of connectionInfos is CRQE (Crystal Reports Query Engine).
                oConnectionInfo.setKind(ConnectionInfoKind.CRQE);
    // Add a Database table
              String tableName = "Building";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
        catch(ReportSDKException RsdkEx) {
                out.println(RsdkEx);  
        catch (Exception ex) {
              out.println(ex);  
    %>
    Throws the exception
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed
    There was other sample code on SDN which suggested the following - adding the table after calling table.setDataFields() as in:
              String tableName = "Building";
                String fieldname = "Building_Name";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setAlias(tableName);
                oTable.setQualifiedName(tableName);
                oTable.setDescription(tableName) ;
                Fields fields = new Fields();
                DBField field = new DBField();
                field.setDescription(fieldname);
                field.setHeadingText(fieldname);
                field.setName(fieldname);
                field.setType(FieldValueType.stringField);
                field.setLength(40);
                fields.add(field);
                oTable.setDataFields(fields);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
    This code succeeds, but it is not clear how to add that database field to a section.  If I attempt to call the following:
    FieldObject oFieldObject = new FieldObject();
                oFieldObject.setDataSourceName(field.getFormulaForm());
                oFieldObject.setFieldValueType(field.getType());
                // Now add it to the section
                oFieldObject.setLeft(3120);
                oFieldObject.setTop(120);
                oFieldObject.setWidth(1911);
                oFieldObject.setHeight(226);
                rcd.getReportDefController().getReportObjectController().add(oFieldObject, rcd.getReportDefController().getReportDefinition().getDetailArea().getSections().getSection(0), -1);
    Then I get an error (which is not unexpected)
    com.crystaldecisions.sdk.occa.report.lib.ReportDefControllerException: The field was not found.---- Error code:-2147213283 Error code name:invalidFieldObject
    How do I add one of the table.SetDataFields()  to my report to be displayed?
    Are there any other pointers or suggestions you may have?
    Thank you

Maybe you are looking for

  • I forgot the apple id for my ipad 2, now it's locked and required active again?!

    I want to give my ipad 2 to my brother in law, so I easered it and update it to version 7.03, and creat a new apple id for my ipad two months ago, then go travelling for more than one month. My family try so many times of the wrong password on it, no

  • Submit FDF Form Data to Web

    Is it possible to program a form to send certain fields to a spreadsheet housed on a website upon submitting? I have created a simple spreadsheet with order number, change amount, and customer name.  When sales submits this form to the person enterin

  • Exceptions are using rpc/encoded messages in documentwrapped mode

    Version: Weblogic 8.1SP3 I exposed a web service in documentwrapped(/literal) mode, and it seems weblogic is using rpc/encoded convention instead, to serialize Exception. I posted more infos on the Axis bugtracker : http://nagoya.apache.org/jira/brow

  • Printing to odd page size changes size of artwork

    I am working on a MacBook Pro running Leopard 10.5.5. I've got an Illustrator document that is about 47x33in. When I print it to PDF, the PDF page size is 47x33in, but the artwork has shrunk considerably in the center of the page. I have Acrobat 8 Pr

  • IMAC als externer Monitor

    Hi, i will use my iMAC 27'' (Model: Middle 2011) as an external monitor. The signal should come from an Laptop Dell Latitude E6230 over an "HDMI to thunderbold"  cable. The cable is from my apple shop and named "Mini displayPort HDMI Cable". After re