RDC : connect Dataset to a Report

Post Author: Chaux
CA Forum: Data Connectivity and SQL
My report is using a Acces database (MDB file).
i m have to modify my report by code, so i need RDC.
i m building a dataset, (not connected to physical datbase)
DataSet.Tables.Add(TableName)
DataTable.Columns.Add(ColumnsName, type)
DataRow Row = DataTable.NewRow()
Row[x] = data
I want to connect this dataset to my report ,
using setdatasource it do nothing...
When i m trying to modify the ConnectionProperties
Crystal Report prompt a windows, and ask me the physical datasource ...
So, how can i connect the dataset to my report ?

Hello Chris,
I have never seen any code with 2 datasets.
Anyway, please see here some [VB samples for .NET|https://smpdl.sap-ag.de/~sapidp/012002523100006252812008E/net_web_smpl.exe].
Maybe you can change this code to your needs.
[Please see here for more samples|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm]
Best regards
Falk

Similar Messages

  • Adding a second dataset to a report - fails

    I'm using Visual Studio 2008. In Design mode I'm able to attach to datasets to a report and get a preview. Now I'm trying to attach the data in the code. The report ran ok with a single dataset. It won't run with the second one attached.
    The code I've got to load the viewer is:
            myODA = New OracleDataAdapter(sSql, myConn) ' set the query for the data
            ' set the adapter to host the dataset object and it's structure
            myODA.Fill(myData, repVW)
            ' tell the source what report to use
            myRepDoc.FileName = Server.MapPath(repFile)
            ' tell the source what data to use
            myRepDoc.SetDataSource(myData)
            If repNo = 81 Then ' the lag report chart dataset
                repVW2 = Session("RepVW2")
                sSql = Session("RepSQL2")
                myODA2 = New OracleDataAdapter(sSql, myConn)
                myODA2.Fill(myData2, repVW2)
                myRepDoc.SetDataSource(myData2)
            End If
    I can't seem to find an ASP example for a second source.
    The error is:
    Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME1\VAAACO1\LOCALS~1\Temp\crLagReport {7ED5D479-C8D6-4FD8-B017-85199BD6BB55}.rpt: Unable to connect: incorrect log on parameters.
    Is it possible to include a second dataset in .NET?

    Hello Chris,
    I have never seen any code with 2 datasets.
    Anyway, please see here some [VB samples for .NET|https://smpdl.sap-ag.de/~sapidp/012002523100006252812008E/net_web_smpl.exe].
    Maybe you can change this code to your needs.
    [Please see here for more samples|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm]
    Best regards
    Falk

  • Looping thru sub report based on dataset in main report.

    Hello all,
    I have a report which has few parameters and I scheduled  it to run and export in excel. This report run multiple time based on parameter value and then export the data into different excel file. 
    Here is what I'm looking for:
    1. Create a main report with temporary data set with all the parameter values.
    2. Run sub report with parameter values from main report and then export it to excel file, I assume it will help to create one single excel file with multiple tabs.
    Questions are:
    1. How I can create s dataset in main report (may be use XML as a data source) and write a query? Since I don't have access to database I cannot add a table for parameters values so I need to know how I can create a dataset with all the values
    2. Is this a right approach or there is a another way to handle it?
    Look forward for expert advice.
    Thanks,
    P

    Hi Parry2k,
    According to your description, you want to create a report with several parameters and configure subscription to send delivery the report to users, but you haven’t permission to access database.
    According to my knowledge, as long as a user can connect to a SQL Server instance, the user is able to create temporary tables, there are no special permissions. To use XML as data source, we can select XML from type drop-down list, then embed xml in dataset
    query text box.
    To set parameter values, we can create Available values and Default Values manually or create datasets for the parameter, then get values from the datasets.
    In this case, I would recommend you asking database administrator to grant permission to access database to you. Creating temporary tables is not a good approach to solve the problem.
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Multiple data sets: a common global dataset and per/report data sets

    Is there a way to have a common dataset included in an actual report data set?
    Case:
    For one project I have about 70 different letters, each letter being a report in Bi Publisher, each one of them having its own dataset(s).
    However all of these letters share a common standardized reference block (e.g. the user, his email address, his phone number, etc), this common reference block comes from a common dataset.
    The layout of the reference block is done by including a sub-llayout (rtf-file).
    The SQL query for getting the dataset of the reference block is always the same, and, for now, is included in each of the 70 reports.
    Ths makes maintenance of this reference block very hard, because each of the 70 reports must be adapted when changes to the reference block/dataset are made.
    Is there a better way to handle this? Can I include a shared dataset that I would define and maintain only once, in each single report definition?

    Hi,
    The use of the subtemplate for the centrally managed layout, is ok.
    However I would like to be able to do the same thing for the datasets in the reports:
    one centrally managed data set (definition) for the common dataset, which is dynamic!, and in our case, a rather complex query
    and
    datasets defined on a per report basis
    It would be nice if we could do a kind of 'include dataset from another report' when defining the datasets for a report.
    Of course, this included dataset is executed within each individual report.
    This possibility would make the maintenance of this one central query easier than when we have to maintain this query in each of the 70 reports over and over again.

  • Error: Failed to open the connection when opening Crystal Report in CMC or

    Hello all,
    I am getting theError: Failed to open the connection when opening Crystal Report in CMC or Infoview
    with access database as the datasource which is in the network drive.

    Hi Sonali,
    This is because Crystal Reports does not recognize database connection from share drive
    1. Save the database locally on server machine
    2. Create a new database on server and link the new database with the database on Network.
    Steps to link the database.
    1.Create a new test database on server.
    2. Go to File --> Get External Data --> Link tables | Select the database on Network Drive.
    3. Select all the tables from the database.
    4. Save the Database  e.g. Test.mdb.
    5. Create an ODBC Connection on server machine, with the same name as on client machine using test.mdb database.
    Note: Click on Advanced button, enter the default user id and password for the odbc connection, it is not mandatory to give Login Name and Password, only if the user id and password are given then we need to provide the same user id and password in the CMC database configuration.
    6. Create a report using this ODBC connection, and save the report to Enterprise.
    Regards,
    Navin

  • "Failed to open the connection" - Add-on Crystal Reports (SAP B1 2007A)

    I have Created One Crystal Report.
    When I Preview Report (Administration>Crystal Reports>Select Report-->Print and Preview),
    System displays the following error message.
    " Failed to open the connection."
    Can you help me?
    Kind regards
    Margarida Pedroso
    PT

    You may check these threads:
    Re: Crystal Reports Add-on error on workstations
    Crystal Report Add On - Connection error.
    Crystal Reports install errors on workstation
    Thanks,
    Gordon

  • How to use a connection ODBC in  crystal reports viewer?

    Hi Guys!
    I need to know if for update a report in crystal reports viewer, is necessary, have a connection SAP Business Objects Business Intelligence. How to use a connection ODBC in  crystal reports viewer?

    Hi Guys!
    I need to know if for update a report in crystal reports viewer, is necessary, have a connection SAP Business Objects Business Intelligence. How to use a connection ODBC in  crystal reports viewer?

  • Linq2sql Connection string for crystal report. Report requires logon

    If I take out the connection string info the report runs fine from my machine but any other user it asks for logon information so I am trying to add the connection info. The line that is not compiling is `cr1.SetDatabaseLogon(connection, cr1);`
    What am I doing wrong? Any help would be appreciated!
        private void launchReport(int pKReport)
            using (DataClasses1DataContext db = new DataClasses1DataContext())
                var query = (from s in db.expenseHdrs
                             join d in db.expenseDtls on s.rptNo equals d.rptNo
                             where s.rptNo == pKReport
                             from g in db.employees
                             join r in db.expenseHdrs on g.pk equals r.empPk
                             select new
                                 s.period,
                                 s.description,
                                 s.department,
                                 s.rptNo,
                                 s.reimbursement, g.name,
                                 d.expDate,
                                 d.expType,
                                 d.expDesc
                CrystalReport1 cr1 = new CrystalReport1();
                ConnectionInfo connection = new ConnectionInfo();
                connection.DatabaseName = "intranet";
                connection.UserID = "sa";
                connection.Password = "*****";
                cr1.SetDatabaseLogon(connection, cr1);
                cr1.SetDataSource(query);
                crystalReportViewer1.ReportSource = cr1;
    I also tried changing the code after my query to below but I still have the exact same problem as before when I didnt have the connection string credentials. On every user but myself I get the same sql server login screen and no matter what I enter it fails. I think it is due to there being no database name which it will not allow me to manually enter.
         CrystalReport1 cr1 = new CrystalReport1();
                    cr1.FileName = @"C:\Intranet\CrystalReport1.rpt";
                    ConnectionInfo connectionInfo = new ConnectionInfo();
                    connectionInfo.ServerName = "svr-sql";
                    connectionInfo.DatabaseName = "intranet";
                    connectionInfo.UserID = "sa";
                    connectionInfo.Password = "*****";
                    SetDBLogonForReport(connectionInfo, cr1);
                    cr1.SetDataSource(query);
                    crystalReportViewer1.ReportSource = cr1;
        private void SetDBLogonForReport(ConnectionInfo connectionInfo, CrystalReport reportDocument)
                Tables tables = reportDocument.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
                    TableLogOnInfo tableLogonInfo = table.LogOnInfo;
                    tableLogonInfo.ConnectionInfo = connectionInfo;
                    table.ApplyLogOnInfo(tableLogonInfo);

    The code I use is as follows:
    Dim crDatabase As Database
    Dim crTables As Tables
    Dim crTable As Table
    Dim crTableLogOnInfo As TableLogOnInfo
    Dim crConnectionInfo As ConnectionInfo
    Dim crReportDocument As ReportDocument
    CrConnectionInfo = New ConnectionInfo
    With crConnectionInfo
    .ServerName = "dbconn1"
    .DatabaseName = "Pubs"
    .UserID = "vantech"
    .Password = "vantech"
    crDatabase = crReportDocument.Database
    crTables = crDatabase.Tables
    End With
    crDatabase = crReportDocument.Database
    crTables = crDatabase.Tables
    For Each crTable In crTables
    crTableLogOnInfo = crTable.LogOnInfo
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo
    crTable.ApplyLogOnInfo(crTableLogOnInfo)
    Next
    This assumes that there are no subreports (or at least that if there are subreports, they use identical db connection info).
    My recommendation would be to test the above code with a simple test report (one table, one field). If you have subreports, you may need to set the logon for those also - depends on how the subreports are implemented. Subreport logon code would be something like this:
    Dim crSubreportDocument As ReportDocument
    crSubreportDocument = crReportDocument.OpenSubreport("Ron")
    crConnectionInfo = New ConnectionInfo
    With crConnectionInfo
    .ServerName = "Rcon1"
    .DatabaseName = "Northwind"
    .UserID = "vantech"
    .Password = "vantech"
    End With
    crDatabase = crSubreportDocument.Database
    crTables = crDatabase.Tables
    For Each crTable In crTables
    crTableLogOnInfo = crTable.LogOnInfo
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo
    crTable.ApplyLogOnInfo(crTableLogOnInfo)
    Next
    Alternatively, you could download the db logon writing utility that is attached to this KB and implement that.
    - Ludek
    Follow us on Twitter
    Got Enhancement ideas? Try the SAP Idea Place
    Share Your Knowledge in SCN Topic Spaces

  • Need clarification on no of datasets in a report

    Hi All,
        Please let me know is it required to place only one dataset in a report to get the print and layout options perfectly(Designing). 
    Waiting for valuable replies.

    Number of datasets have no relation with print and layout. The number of datasets depends on how many data sources you want to get the data from and in how many different wasys.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to connect to the Crystal Reports Server XI R2 installed in other machi

    Hi,
    we are 3 people here we have Crystal Reports Server XI R2 installed in one machine and Crystal Repoprts XI  DEsigner ( downloaded trial version) in all the machines ,
    in my machine only Crystal Repoprts XI  DEsigner ( downloaded trial version) is installed , how to connect to the Crystal Reports Server XI R2 which is installed in other machine
    Regards,
    kathyaini

    Hi,
    thankyou for your  response,
    my problem here is as soon as i open CR Designer , and if i  click on either New Report,Blank Report, or  standard report wizard  it is saying "failed to create database connection"
    on which ever thing i click it is telling the same "failed to create database connection" i created the user DSN properly , i could not create System DSN i dont know why.
    can u please guide me
    and one more thing on the machine where CR server is installed , on the same machine designer is also installed (i think u was telling the same) .  my question is how the server will know about the CR Designer installed in my machine.
    Regards,
    kathyaini

  • Unable to connect to Forms and Reports

    Hi,
    I'm unable to connect to Forms and Reports. I have done the following installations.
    1) First I have installed oracle 9i database in C:\oracle. oracle schema is devlp
    I was able to connect to database at scott/tiger@devlp
    2) I have downloaded oracle forms and reports from oracle site and installed.
    When installing forms and reports, the directory "oracle" is already in use message popped. So changed the path to C:\oraforms and installed both forms and reports.
    3) After installation, i tried to connect to forms/reports but couldnot connect. Error TNS could not connect.
    4) When i checked the TNSNAMES.ORA, the DEVLP string is available.
    Where should i changed the tnsnames??????
    Please anybody let me know how to have correct tnsnames and where.
    Thanks in Advance
    Chettarjee

    Mr. Sybrand,
    Thanks for the reply and I understood your point. Can you please further guide me to get an appropriate Oracle Forms/Reports (Developer) version in order to make application using Oracle Database 10g. Please note that most of my experience is in D2K 2000 rel:6. and unfortunately I came into software development after a long gap that is why not much aware about latest version out there of Oracle Forms/Reports.
    But is there really no way to connect D2K rel:6 with DB 10g !!!
    Regards,
    Zia

  • How to connect Java to crystal report

    How to connect java with crystal report ?
    Which are the API's for that

    In all this time you never considered searching?
    Cross post
    http://forum.java.sun.com/thread.jspa?threadID=791154

  • How I connect remote database in report builder

    username myname
    password mypass
    database test
    database server 192.165.21.32
    port 1521
    how can I connect in oracle 11g report builder ??

    Hello,
    Add an entry like below in the file tnsnames.ora (ORACLE_INSTANCE/config)
    ora11g =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.165.21.32)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = servicename)
    REPLACE servicename by the servicename for your DB or use a SID.
    then , enter username / password and ora11g in the logon window
    regards

  • Creating a new connection when creating a report from scratch

    I've searched all around but I haven't managed to find any samples or forum posts that show how to create a connection when creating a report from scratch via RCAPI.  All of the code that I've found has been aimed at replacing the ConnectionInfo for an existing connection.  I figured that it would work something like this:
    m_crystalReport.setReportAppServer(ReportClientDocument.inprocConnectionString);
    m_crystalReport.newDocument();
    IConnectionInfo ci = new ConnectionInfo();
    PropertyBag propertyBag = new PropertyBag();
    propertyBag.put("Use JDBC", true);
    propertyBag.put("Connection URL", "jdbc:jtds:sqlserver://localhost:1433;databaseName=" + DB_NAME);
    propertyBag.put("Database Class Name", "net.sourceforge.jtds.jdbc.Driver");
    propertyBag.put("Database DLL", "crdb_jdbc.dll");
    ci.setAttributes(propertyBag);
    m_connection = new Connection();
    m_connection.setConnectionInfo(ci);
    m_connection.open();
    but this produces a NullPointerException within Connection.open().  If I leave the connection closed but add it to the report via DatabaseController.addConnection() then I just get the exception later on when I try to add tables using the connection.
    Can anyone give me any pointers please?
    Thanks,
    Rich.

    Just in case anyone else runs into this, I managed to fix it by leaving the connection closed and then using the connection info instead of the connection when creating tables, eg:
         ITable t = new Table();
         t.setAlias(v.getAlias());
         t.setName(v.getView().getName());
         t.setConnectionInfo(m_connectionInfo);
         getDatabaseController().addTable(t, null);

  • Database connection lost during running report

    Hello Experts, Our environment is WINDOWS2008 SERVER / ORACLE 10G / ORACLE REPORTS.
    The problem we are facing is , while running one of the particular reports which runs oracle reports , connection to database server gets lost. Acturally the form is printing a
    bar code label, this is performed by running oracle reports runtime 10g. I dont know what is the reason the database connectivity gets lost from reports runtime engine. But the form runtime engine working fine without any database connectivity issue. Kinldy help me to resolve this issue. thanks

    Please, close this thread and open a new one in the correct forum.
    Reports

Maybe you are looking for

  • Safari 5.0.2 (Mac) always crashes at startup on Intel based iMac OSX 10.6.5

    Hi all. I'm running Safari 5.0.2. on Mac OS X 10.6.5. Every time I start my iMac it always shuts down (crashes) and generates the following crash report. Any help to fix this issue would be appreciated. Thanks Brad Process: Safari [404] Path: /Applic

  • How to switch off automatic compilation function

    How can I switch off the arrow marks on the top left on the Inbox from automatically compiling my mails, bunching them together, often erroneously, and opening and closing whenever I run the mouse near it so that I can't even see my other mails. It's

  • Migrating from Brio 8.5 to EPM 11x

    Hi All, We are planning to migrate brio from 8.5 to 11.x.. 1.Which version we have to migrate from 8.5 ? Is it 11.1.2.2 or earlier versions? 2. How to download versions earlier 11.1.2.2(Ex:11.1.1.3)? 3.Our workspace has 300 user accesibililty,is it g

  • Schedule local process chain

    Hi, I have a requirement to schedule local PC to run every 8 hrs instead of daily as it does now.  Local process chain is called within a meta chain.  Is there a way I can schedule local process chain separately within a meta chain or I have to chang

  • Upgrading hardware in MacBook Pro 13" (Mid 2012)

    Hello, I'd like to upgrade my MacBook Pro 13" (Mid 2012). I've decided to replace my HDD with SSD, obviously, and add some RAM memory. I would appreciate if you let me know what do you think about the following hardware: Crucial 2x4GB DDR3 1600MHz CL