RE: What's database field are used in crystal report file?

Hi all
Please help me a C# code that using Crystall Report API (Crystal Report XI- Develop license) to get the list of database fieldname that using in crystal Report file. (What's database field using in header section ,group section , detail section of report.....)
We looking forward to hearing from you
Thanks
Son

Hello Son,
please use this code below to get a list of used database fields in a report :
//File Name:          CS_Get_report_data_out_inproc.sln
//Created:            April 11, 2008
//Author ID:          FLI
//Purpose:            This C# .NET sample Windows application demonstrates
//                  how to retrieve report data and put the into a XML file
//                  using unmanaged RAS.
// Note this is available without a dedicated RAS with SP2 for XI R2
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.DataDefModel;
namespace CS_Get_report_data_out_inproc
    public partial class Form1 : Form
        // CR Declarations
        ReportDocument boReportDocument;
        ISCDReportClientDocument boReportClientDocument;
        public Form1()
            InitializeComponent();
            //Create a new ReportDocument
            boReportDocument = new ReportDocument();
            // load the RPT file
            boReportDocument.Load("..
ReportData.rpt");
            // show in reportviewer
            crystalReportViewer1.ReportSource = boReportDocument;
        private void button1_Click(object sender, EventArgs e)
            //Access the ReportClientDocument in the ReportDocument (EROM bridge)
            boReportClientDocument = boReportDocument.ReportClientDocument;
            // Retrieve the Rowset Controller
            RowsetController boRowsetController = boReportClientDocument.RowsetController;
            // Retrieve the metadata (column headers) - this allows you to only retrieve the data that is on the report.
            RowsetMetaData boRowsetMetaData = new RowsetMetaData();
            Fields boFields = boReportClientDocument.DataDefinition.ResultFields;
            boRowsetMetaData.DataFields = boFields;
            // Now print out the data in XML file
            //(Note: This will print out the results of formulas too)
            StreamWriter sw = new StreamWriter("C:
ReportData.xml", false);
            sw.WriteLine("<?xml version='1.0' encoding='utf-8'?>");
            sw.WriteLine("<ReportData>");
            sw.WriteLine("<Reportheader>");
            // Print out the titles
            for (int i = 0; i < boFields.Count; i++)
                String boFieldName = boFields<i>.Name;
                sw.WriteLine("<ReportheaderDetail>" + boFieldName + "</ReportheaderDetail>");
            sw.WriteLine("</Reportheader>");
            //Create the cursor which lets us loop through the data
            RowsetCursor boRowsetCursor = boRowsetController.CreateCursor(null, boRowsetMetaData, 1);
            Record boRecord;
            while (boRowsetCursor.IsEOF == false)
                sw.WriteLine("<Customer>");
                boRecord = boRowsetCursor.CurrentRecord;
                for (int j = 0; j < boFields.Count; j++)
                    try
                        sw.WriteLine("<Detail>" + (String)boRecord[j].ToString() + "</Detail>");
                    catch (Exception err)
                        sw.WriteLine("<Error>" + err.Message + "</Error>");
                sw.WriteLine("</Customer>");
                boRowsetCursor.MoveNext();
            sw.WriteLine("</ReportData>");
            // CLose the file
            sw.Close();
            MessageBox.Show("XML File 'ReportData.xml' successfully created on C:");

Similar Messages

  • How can I determine if PeopleSoft Queries are used in Crystal Reports

    One PeopleSoft user requested that we delete 118 Queries. How can we determine if any of these Queries are being used in Crystal Reports?

    >
    One PeopleSoft user requested that we delete 118 Queries.
    >
    Why? How would the user know, or even care, if the queries exist?
    It is not the concern of a user whether such queries exist or not. If your system has a security flaw that allows non-privileged users to executed those queries then you need to fix that flaw.
    Remove the privileges that the user has on those queries and then, for that user, the queries will not exist.
    >
    How can we determine if any of these Queries are being used in Crystal Reports?
    >
    You can't.
    How do you determine if an app has any Java code that uses the SCOTT.EMP table? You can't.

  • Sub:ztable fields are used by what are all transactions

    Hi Experts,
    I am having 2 table fields. These two fields are used in 2 different Ztables. Just i want to modify these two Zfields. But i want to tell our endusers, If i am making changes on these two fields means What are all the Transaction codes will affect? I can take what are all programs used by these 2 different fields through where-used-list option. But user dont need to know the program names know? They are familiar with only transaction codes.
    So anyother option is there to find out the transaction codes?
    Thanks,
    Sankar M

    hi
    good
    your query is bit confusing,if you r going to change anything in the zfields than there must be a requirement for that from your end user,apart from that if you r doing any changes than you must know what r the reports going to affect after that,than you need to change them accordingly,i dont think there is any table which ll give you idea that what r the tcoded going to affect after that,bcz its a table that would have been used in different reports in different scenarios,and you have to chage all those reports accordingly.
    thanks
    mrutyun^

  • What are main events in that are used in ALV reports

    hi gurus
    what are main events in that are used in ALV reports....
    regards
    baskar

    hi
    i think this will help u.
    Events in alv and their FM    The main events in alv and their FM and why we use these: 
    1. SLIS_PRINT_ALV. 
    2. SLIS_T_LISTHEADER. 
    3. SLIS_T_EVENT. 
    4. SLIS_T_SORTINFO_ALV. 
    5. SLIS_T_LAYOUT_ALV. 
    6. SLIS_T_FIELDCAT_ALV. 
    and in classic reports what is the sequence of events:   === Events are 
    At selection-screen output. 
    Initialization. 
    At selection-screen on field 
    At selection-screen on end of field 
    At selection-screen on Radiobutton Group R1. (If you have any radio buttons) 
    At selection-screen on block b1. (If you have any blocks) 
    Start-of-selection. 
    Get node. (if the data is retreived from a logical database) 
    Get node late. (if the data is retreived from a logical database) 
    Top-of-page. (if the write statement is in the end-of-selection event or we can say that before the first write statement) 
    end-of-selection. 
    and fuction modules are 
    LISTHEADER - Is used to print the header information in the ALV List. Name, Date, Time, ALV Name and other details are called as Header information.   EVENT - Basically this is the FM to handle Event's. When the user needs to do some event operation like when double clicking the a particular field we need to perform some operation.   These events are captured by this FM.   LAYOUT - This FM is used to define the layout of the List. There are many options available in this FM to define the Layout style.   FIELDCAT - These are used to populate the List header. We can change them according to our req. 
    User-defined Text Output Event
        Application
          print_end_of_list
        Define output text to be printed at the end of the entire list
          print_top_of_list
        Define output text to be printed at the beginning of the entire list
          print_end_of_page
        Define output text to be printed at the end of each page
          print_top_of_page
        Define output text to be printed at the beginning of each page
          subtotal_text
        Define self-defined subtotals texts
    Mouse-controlled Actions in the Grid Control Event
        Application
          button_click
        Query a click on a pushbutton in the ALV Grid Control
          double_click
        Query a double-click on a cell of the ALV Grid control 
          hotspot_click
        Query a hotspot click on columns defined for this purpose in advance
          onDrag
        Collect information when elements of the ALV Grid Control are dragged 
          onDrop
        Process information when elements of the ALV Grid Control are dropped 
          onDropComplete
        Perform final actions after successful Drag&Drop 
          onDropGetFlavor
        Distinguish between options for Drag&Drop behavior
    Processing of Self-defined and Standard Functions Event
        Application
          before_user_command
        Query self-defined and standard function codes
          user_command
        Query self-defined function codes
          after_user_command
        Query self-defined and standard function codes
    Definition of Self-defined Functions Event
        Application
          toolbar
        Change, delete or add GUI elements in the toolbar
          menu_button
        Define menus for menu buttons in the toolbar
          context_menu_request
        Change context menu
          onf1
        Define self-defined F1 help
    All of these can be found under type group SLIS.
    Events
    SLIS_EV_ITEM_DATA_EXPAND        TYPE SLIS_FORMNAME VALUE 'ITEM_DATA_EXPAND',
    SLIS_EV_REPREP_SEL_MODIFY       TYPE SLIS_FORMNAME VALUE 'REPREP_SEL_MODIFY', SLIS_EV_CALLER_EXIT_AT_START TYPE SLIS_FORMNAME VALUE 'CALLER_EXIT',
    SLIS_EV_USER_COMMAND              TYPE SLIS_FORMNAME VALUE 'USER_COMMAND',
    SLIS_EV_TOP_OF_PAGE                     TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
    SLIS_EV_DATA_CHANGED                TYPE SLIS_FORMNAME VALUE 'DATA_CHANGED',
    SLIS_EV_TOP_OF_COVERPAGE       TYPE SLIS_FORMNAME VALUE 'TOP_OF_COVERPAGE',
    SLIS_EV_END_OF_COVERPAGE       TYPE SLIS_FORMNAME VALUE 'END_OF_COVERPAGE',
    SLIS_EV_FOREIGN_TOP_OF_PAGE TYPE SLIS_FORMNAME
    VALUE 'FOREIGN_TOP_OF_PAGE', SLIS_EV_FOREIGN_END_OF_PAGE TYPE SLIS_FORMNAME
    VALUE 'FOREIGN_END_OF_PAGE',
    SLIS_EV_PF_STATUS_SET                  TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
    SLIS_EV_LIST_MODIFY                      TYPE SLIS_FORMNAME VALUE 'LIST_MODIFY',
    SLIS_EV_TOP_OF_LIST                       TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST',
    SLIS_EV_END_OF_PAGE                    TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE',
    SLIS_EV_END_OF_LIST                      TYPE SLIS_FORMNAME VALUE 'END_OF_LIST',
    SLIS_EV_AFTER_LINE_OUTPUT       TYPE SLIS_FORMNAME VALUE 'AFTER_LINE_OUTPUT', SLIS_EV_BEFORE_LINE_OUTPUT     TYPE SLIS_FORMNAME VALUE 'BEFORE_LINE_OUTPUT',
    SLIS_EV_SUBTOTAL_TEXT                TYPE SLIS_FORMNAME VALUE 'SUBTOTAL_TEXT'.
    with regards
    sravani
    award points if found useful.

  • I have a Mac purchaesd in India. Now i am travelling to USA. In India power is at 220V but in USA it is 120V (if i am right). What i need to do. Also what  type of plugs are used in USA. Type A,B,C etc.

    I have a MacBook Pro purchaesd in India. Now i am travelling to USA. In India power is at 220V but in USA it is 120V (if i am right). What i need to do. Also what  type of plugs are used in USA. Type A,B,C etc.

    All you will need is a USA adapter for your MBP power adapter since it will work in  electrical environments from 100v. to 220V.  It seems that a type B will be needed.
    en.wikipedia.org/wiki/Mains_electricity_by_country
    Ciao.

  • How to pass database login information to a crystal report using c#?

    Hi,
    I need to pass database logon information to a crystal report dynamically using c#.  I am developing a windows application using c# .Net.
    I looked some of the articles however I am not able to figure out the mistake I have did.  Please find below the code I have written so far; It would be great if you could help me out in solving the issue.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Data.OracleClient;
    using System.Configuration;
    using CrystalDecisions.Shared;
    using CrystalDecisions.CrystalReports.Engine;
    private void Frm_report_Load(object sender, EventArgs e)
                setReportParameters(); // method to pass parameters to the Crystal report
                crystalReportViewer1.ReportSource = new Upper_Lower();  // Upper_Lower is the Crystal report I have used in my project
               TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
               TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
               ConnectionInfo crConnectionInfo = new ConnectionInfo();
               Tables crTables;                            
                    crTables = new Upper_Lower().Database.Tables;
                    crConnectionInfo.ServerName = "oops";
                    crConnectionInfo.DatabaseName = "";
                    crConnectionInfo.UserID = "new";
                    crConnectionInfo.Password = "new123";
                    foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in crTables)
                        crtableLogoninfo = CrTable.LogOnInfo;
                        crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                        CrTable.ApplyLogOnInfo(crtableLogoninfo);
    Thanks & Regards,
    Karthik.

    Hi,
    Try using this code ,
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.Web;
            ReportDocument rd = new ReportDocument();
            rd.Load(Server.MapPath("Report name"));
            rd.SetDatabaseLogon("User Name", "Password", "Server Name", "Database Name");
            CrystalReportViewer1.ReportSource = rd;
    [See Also.|http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm]
    Hope this helps!!
    Sincerely,
    Nikhil Dharme

  • What r all the tables used for this report. please reply

    hai,
    what r all the tables used for this report.
    report :
    <b>
    •     Report to display all finished goods that go out-of-stock. Developed a drill down report for materials details (totals and subtotals for material stock values by material group and material type).</b>
    thanks in advance

    hi Ashok,
    Check this out
    http://www.allsaplinks.com/tables.html
    http://www.sapgenie.com/abap/tables.htm
    Regards,
    Santosh

  • Whenever i type in the google box to search every letter i type firefox asks what would i like to use to open this file this is so annoying how do i get it to stop doing this?

    whenever i type in the google box to search every letter i type firefox asks what would i like to use to open this file this is so annoying how do i get it to stop doing this?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • I can't open the downloaded evaluation copy of Project Professional 2013. Asks me what program I want to use to open the file.

    I can't open the downloaded evaluation copy of Project Professional 2013.  Asks me what program I want to use to open the file.

    I think you have downloaded .img file. If you want to install that program follow the given instruction.
    download open source magic disc viewer software.
    http://www.magiciso.com/tutorials/miso-magicdisc-overview.htm
    After installation, right click on notification icon of magic disc, click Virtual CD/DVD ROM ->  No Media -> Mount,
    Select disc image file of project professional 2013.img.
    Open My Computer -> select mount drive and install that program.

  • When i open firefox, i get asked what program i want to use to open this file.

    when i open firefox, i get asked what program i want to use to open this file. i select firefox to open firefox, and it opens to - Index of file:///C:/Documents and Settings/HP_Administrator/- instead of my home page. this has been going on for months. today i updated my kaspersky intrnet security 2011 and since then fire fox will only open in firefox safe, even if i shut down kaspersky. IE opens with no problems.
    thanks
    jeff

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Database connection not working in Crystal Reports for Eclipse 2.0

    Hello All,
    We have several hunderd reports that were created in CR 8.5.  We are moving to a new Java  environemnt and we are also considering using BIRT.However to save development time and effort we are considering using the CR for Eclipse 2.0. For a proof of concept, we loaded several of our 8.5 reports into Crystal reports XI, saved them, and then loaded them into our CR for eclipse design environment.
    These reports were built from the values returned from a store procedure.. When we try to execute the reports from within Eclipse, we get  Error finding JNDI name (xxxx). We have created the appropriate datasource (to Sybase 12.5.4), and the schema is viewable in the db explorer. However when we associate the connection to this datasource, the connection no longer appears in the field explorer and no data is returned upon previewing the report.
    The original reports used ODBC to access the database. Is there anyway to easily convert these reports to using the Sybase JDBC datasource? Also in the DB explorer, the SPs are only showing the SP parameters,not the return values, so we are unable to easily drag the return fields onto the report to reset the links.
    Thanks in advance
    Edited by: Michael Knight on Oct 7, 2009 1:46 PM

    Michael,
    We had a similar situation but from my reseach the output from the stored procs cannot be viewed in the report designer in Eclipse. So we had to design the reports using the Crystal Reports Devloper application (the stand-alone version, not the Eclipse editor). The reports were designed w/an ODBC datasource. In order to get that working we had to create a JNDI JDBC datasource connection w/the exact same name as the ODBC datasource and that works. For example, the ODBC datasource was named OP01DSDB01.WORLD so we just created a JNDI datasource w/that exact same name (no jdbc/OP01DSDB01.WORLD just OP01DSDB01.WORLD). I'm not sure if there is a workaround for any of this but this was the easiest way to get them working.
    I know this isn't the ideal situation, but that was the easiest way to get things working.

  • Automated Solution for Exporting SQL used in Crystal Reports

    My company has created over 400 reports that are running on Crystal Reports XI. Due to proposed changes in our database, we occasionally need to review the SQL statements of all 400+ reports to determine if any of them would be impacted by the proposed changes. In order to review the SQL used in these 400+ reports, we have had to open each report manually. We would like to know how we can review the SQL used in the reports without having to manually look at each report. I suspect there is a way to either write a program or use a tool that will export the SQL that is used in all reports. In a similar vain, we would be interested in knowing if there is an automated way to identify table names and fields that are used in each SQL statement.

    I see two directions to go:
    1. Review functionalities of .rpt Inspector
    [http://www.softwareforces.com/Product/ri/pro/3/rptInspector.htm]
    - it allows rpt mass analyses
    2. Post your question to ".Net Development - Crystal Reports" forum to see if it is possible to access required information through custom application

  • Database, user name, password for Crystal report

    We're running BOE XI 3.1 and we use WebI reports.  One of our departments uses Crystal reports, and they'd like to be able to run them in our BOE environment so that they can refresh reports over the Web.  They uploaded a report to BOE (using Add -> Crystal Reports) but when they try to refresh it they aren't prompted for the database or a password, and the refresh fails.
    How do you specify the database / data source / data connection (or whatever it's called) for a Crystal report? How do you specify the user name and password to use for authenticating to the database?
    Thanks,
       Laura

    I am fairly new on this forum but we have been doing exactly what you are talking about with Crystal Reports published to BO XI 3.1 for a while.  There are a few things we have found that have to be done to make this work right...
    - Use the EXACT same ODBC/database connection setup on both the Crystal Report developer's machine and on the BO server
    - On the developer's machine use integrated security for the database connection
    - Then after you upload the report to BO, go into CMC and open the Crystal Report's properties.  In there under "Default Settings" you will see an option for Database Configuration.  The User and Password under the "Use original logon informstion from the report" should be empty.  Put in a valid userid and password that has access to the database.
    - Also, in the Database Configuration screen make sure the Server and Database boxes are filled-in - they will be greyed out and you can't change them (this is why you have to make sure the ODBC/database info is the same).  If they are wrong, you will need to fix the ODBC/database connection in the original RPT file.
    - Finally, you need to scroll to the bottom of the Database Configuration page and select the radio box "Use same database logon as when report is run" and then Save and Close
    Now when users run the report it will use the user and password you entered to do it.  The disadvantage is you are not using integrated security but then the users also never get prompted for a password.  We tried very hard to get integrated security to work but could not manage it.
    Hope this helps!
    Larry

  • InfoSet fields not listed in Crystal Report Creation Wizard

    Hello Experts,
    We successfully build few reports using in Crystal Reports 2008 using SAP Integration Kit and InfoSets from ECC 6. But we run in some problems with InfoSet MIRO_PO as InfoSet's fields which are not included into Field Groups are listed in Crystal Report Creation Wizard as available fields. It looks like it may be related to Field Groups/Data Fields definition in Change InfoSet transaction SQ02.
    Did somebody run into similar problems? Is it mandatory to include all required fields into InfoSets' query groups?
    I can't find related documentation.
    Thank you in advance,
    Sergey Vlasov

    Hi Sergey,
    I'm having the same problem, i don't understand your solution very well, can you explain a little bit more?
    Thanks

  • How to use a Crystal Reports Query as datasourc in an other Cristal Report

    Hi
    I would like to read a File in a CR Report, change some data and use the output as datasource  in an other Criystal Reports Report.
    Is ist possible to use a Crystal Reports Report as datasource for an other Crystal Reports Report?
    Thomas
    Edited by: Thomas Martin on Jul 18, 2011 12:44 PM

    Hi Thomas,
    Are you having Xcelsius also in your kitty??(for dynamically doing this activity)
    Xcelsius has very good writing & reading functionality and you can incorporate your crystal report data into it using live office.
    Let say you have a report in crystal , you connect that repot to live office .Let say this is REPORT named as SOURCE CR  REPORT.
    IN Xcelsius import the this SOURCE CR REPORT  report using live office connection and using GRID selector there to show tabular data.
    Xcelsius has buttons & controls  for updating and exporting the data inform of XML SOURCE FILE.
    Now you can either make xcelsius Dashboard for TARGET CR REPORT or you can make crystal Report on ADO.NET(XML) for second crystal Report.
    Search on SDN for cross usage of Crystal & Xcelsius
    regards,
    RK

Maybe you are looking for