Changing database location per Table at runtime is extremely slow in viewer

We are using the Crystal Reports 2008sp2 Viewer in windows forms .NET
application to display various reports based on a Pervasive database.  The
C# code dynamically changes the database table locations at run time.  The
location needs to be set for each table since the location may be different
for each table in the report. 
We have tried to methods to change the location.
1) Set  the Table.Location property in the ReportDocument.Database.Tables
collection.
foreach (Table table in rd.Database.Tables)
Table.Location = "New Path";
2) Set the TableLogOnInfo properties.
      TableLogOnInfo logonInfo = new TableLogOnInfo();
      logonInfo = table.LogOnInfo;
      logonInfo.ConnectionInfo.ServerName = dataPath;
      logonInfo.ConnectionInfo.LogonProperties[0] = new NameValuePair2("Data
File", dataPath);
      logonInfo.ConnectionInfo.LogonProperties[0] = new NameValuePair2("Data
File Search Path", path);
      table.ApplyLogOnInfo(logonInfo);
Both of these methods work, but have extremely slow performance.  Both
methods take between 2 and 3 seconds to execute per table.  Since many of
our reports have 20 - 30 table references ( sometimes more ), this can add
an additional 1-2 minutes to the display of a report.
It seems that the Crystal viewer object is doing some sort of verification
every time the database location is changed.  We have noted that as the
location is changed, the database is being accessed by the viewer.  Please
advise as to how to stop this behavior.  Is there a way to set the location
without the viewer verifying the change?
This problem is turning reports that run in the 2008 Report Designer in 3 seconds into reports that take
many minutes to run.  We will hear nothing but screaming from our 300 customers.
Thanks for any help.
Bill Smith

Hello,
I have a very similar issue but with Crystal XI and XI R2.
I'm using Oracle 10g, and changing a couple of properties using the following sequence for each table to change the login information and the table's current view (each view is a portion of the overall table):
IDatabaseTablePtr table = tables->GetItem(tableN);          
table->SetLogOnInfo(TheApp.GetDataSource(), TheApp.GetDatabase(), userID, pwd);
char tableLocation[201];
char tempTable[201], newTable[201];
strcpy(tableLocation, table->GetLocation());
// make new table name, put into newTable
table->PutLocation(newTable);
if (!table->TestConnectivity())
  ShowCrystalRE_Error(job);
Stepping through in my debugger, the SetLogOnInfo seems very quick, it's the PutLocation( ) that seems to be taking alot of time.
Any help would be greatly appreciated.
This is extremely fast on SQL Server, only noticeably slow on Oracle.

Similar Messages

  • Issue with changing database location at runtime

    I am having a similar issue to:
    Re: Issue with changing database location at runtime
    where I am using Crystal Reports 2008 SP 3 fix pack 3.3 and a OLE DB connection to a SQL 2008 R2 server. Running on a computer on the network where the report can see the original development server is fast, other computers where that server is not available are hanging 20 seconds before coming up.
    I am using the same code from the Crystal Sample app to change the connection on each table. I found that the slowness comes the first time the ReportDocument object is accessed to get the collection of database tables, before the connection info is set.
    Fix pack 3.4 was mentioned in that post.  Does fix pack 3.4 fix that issue? I don't see fix pack 3.4 on the downloads page (https://websmp130.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/bobj_download/main.htm)

    I just found on the reports that were having the issue there was a SQL Expression.  Per this thread:
    Re: Report load is slow after changing database servers
    There was an issue with that and the fix is not out til the end of Feb so I found a way not to use the SQL Expression and the speed is much better.
    However, your information provided led me to this post:
    Cannot Change Table Location, but Only for One Report
    And I am also experiencing an issue where the table location is not changing on one subreport and I will look into that as a possible solution.
    Thanks so much for your help.

  • Not working. Change database location trough VB 6

    Hi,
    I just finished two reports in Crystal 10 using an Access Database (database  location and query are hardcoded in the reports.
    I made a small vb 6 application to launch the reports. Now I need to change database location for the reports trough VB 6.  I have the following code, but it is not working. The reports do not show any data and I do not get any error. I think the problem is with the hardcoded query. The report is designed on this query and the field reference on the reports are like Command.Field1
    I just want tho change database location in VB, but I want the report take the query that is in it.
    I have the following code. How can I make them work.? Is there a better way to do it?
    Dim Report As New CR2 'set up the report
    Dim conn3 As New ADODB.Connection  'ADO connection
    Dim rs As New ADODB.Recordset      'rs connection
    Function F_ViewReport()
    'On Error GoTo End_FormLoad
        Dim sSQL2 As String
        gsRootJob = "4850"
        Dim sSQL2 As String
        gsRootJob = "4850"
    "SELECT Material.Job, Material.Indicator, PO_Detail.Order, Source.Act_Qty,  Vendor.Name, PO_Header.PO, PO_Detail.Due_Date FROM (((Material LEFT JOIN Source ON Material.Material_Req = Source.Material_Req) LEFT JOIN PO_Detail ON Source.PO_Detail = PO_Detail.PO_Detail) LEFT JOIN PO_Header ON PO_Detail.PO = PO_Header.PO) LEFT JOIN Vendor ON PO_Header.Vendor = Vendor.Vendor WHERE (((Material.Job) Like '" & gsRootJob & "*')) ORDER BY Material.Job, PO_Header.PO, PO_Detail.Line;"
        Report.DiscardSavedData
        Set conn3 = New ADODB.Connection
        conn3.Open "provider=Microsoft.jet.OLEDB.4.0; Data Source=" & App.Path & "\Data tables.mdb"
        Set rs = New ADODB.Recordset
        rs.Open sSQL2, conn3, adOpenKeyset, adLockReadOnly
        Report.Database.SetDataSource rs, , 1
        CRViewer2.ReportSource = Report
        CRViewer2.DisplayTabs = False
        CRViewer2.ViewReport
        CRViewer2.Zoom 1
        Screen.MousePointer = vbHourglass
    Please help!
    cc

    Hi Cris,
    It seems that you are having issue with SDK's.
    Post your question in SDK forum.
    [SAP Crystal Reports, version for Visual Studio;
    You can download samples from here:
    [https://www.sdn.sap.com/irj/boc/samples]
    That forum is monitored by qualified technicians and you will get a faster response there. Also, all SDK queries remain in one place and thus can be easily searched in one place.
    Thank you for your understanding,
    Regards,
    Shweta

  • Changing Changing Database Location During Runtime

    I'm using Netbeans 6.0.1. My database location ALWAYS change in place. That's why I'm planning that there would be a "Database Settings..." inside my program. But I don't know how to change the current: user, password, url settings of my program DURING RUNTIME. Here's my persistence.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
      <persistence-unit name="LibraryPU" transaction-type="RESOURCE_LOCAL">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>
        <class>desktopapplication2.Books</class>
        <properties>
          <property name="toplink.jdbc.user" value="root"/>
          <property name="toplink.jdbc.password" value="password"/>
          <property name="toplink.jdbc.url" value="jdbc:mysql://localhost:3306/Library"/>
          <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        </properties>
      </persistence-unit>
    </persistence>

    To solve the "why the hell would I want that stuff inside a jar file" issue, I googled a bit and found this
    style of approach in a Oracle forum. Essentially think of the persistence.xml file as an template
    that the program uses.
    I use a properties file to set all local DB configuration aspects. Load the properties at application
    startup and set then extract the required fields into a Map to create the persistent unit.
    All the "examples" I seen always use a static xml which is never what you need in the real
    world.
    Map properties = new HashMap();
    properties.put(TopLinkProperties.JDBC_URL, dbProps.getString("abc.jdbcurl") );
    properties.put(TopLinkProperties.JDBC_DRIVER, dbProps.getString("abc.jdbcdriver"));
    properties.put(TopLinkProperties.JDBC_USER, dbProps.getString("abc.user"));
    properties.put(TopLinkProperties.JDBC_PASSWORD, dbProps.getString("abc.password"));
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("abcPU", properties);
    entityManager = emf.createEntityManager();
    HTH Altimes.

  • Mapping Warning as cause of changing database location

    hello group,
    i am new in working with owb 10.2, so please forgive me trivial questions.
    now to the problem:
    i set up a location for my database, created some mappings and deployed them successfully.
    yesterday i got new connection details for accessing the database, then i registered/unregistered the location in the control center manager (was that right?).
    then i created some new mappings which use tables of the database.
    when trying to deploy the new mappings (action:create) i get this error-message.
    None
    INFORMATIONAL
    ORA-04052: error occurred when looking up remote object [email protected]@SRC_domain
    ORA-00604: error occurred at recursive SQL level 1
    ORA-02019: connection description for remote database not found
    MY_FIRST_MAP_mytable
    Create
    Warning
    ORA-06550: line 0, column 0:
    ORA-04052: error occurred when looking up remote object [email protected]@SRC_domain
    ORA-00604: error occurred at recursive SQL level 1
    ORA-02019: connection description for remote database not found
    what does this mean?
    was the way to change the location settings for the database wrong? or can this be achieved?
    can you give me some hints?
    thanks in advance,
    sven

    When you deploy a Connector you are creating a Database Link in the schema you are deploying the connector.
    With the replace option, you drop the database link and create it again, so all the objects referring the database link will be in "invalid" status, and you'll have to deploy them again (normally all the mappings, procedures and functions using the connector-databaselink).
    If you change the location information, sometimes the name of the databaselink created when deploying the connector change, OWB creates the database link using not only the name of the connector, includes some information of the location properties, so the replace option partially fails, because the drop database link sentence fails, the create database link sentence works properly, though, and in the database you have two db-links: the old one and the new one, so if you aren't aware to deploy again the objects using the old db-link to refer to the new DB-Link, they will stay referring to the old one. For example:
    The old information of LOCATION_SOURCE:
    HOST: host1
    PORT: port1
    SID: sid1
    When you deploy the connector MY_CONNECTOR in location LOCATION_TARGET referring the schema SCHEMA_TARGET, you create a DB-Link in SCHEMA_TARGET named SID1@MY_CONNECTOR
    If you change the information of LOCATION_SOURCE:
    HOST: host2
    PORT: port2
    SID: sid2
    And then deploy MY_CONNECTOR again, you create a new DB-Link in SCHEMA_TARGET, named SID2@MY_CONNECTOR, and with the REPLACE option you don't drop the SID1@MY_CONNECTOR DB-Link so all the objects referring to this old DB-Link will be valid, but referring to an incorrect DB-Link.
    Hope I've been able to make myself understand, I've read what I have written and seems a bit confusing. Regards.
    ANA GH

  • Table "StoredProcedure" not found when changing Database location in VS 2005.

    <p>I&#39;m having a problem changing the datasource location when generating a report using the report viewer in VS2005.  If the table is a stored procedure, I get the message "Table (StoredProcedureName) not found", but if the report references tables rather than a stored procedure the location is changed and the report runs successfully.  The same problem was reported in earlier versions of Crystal Reports and was fixed in a service pack, but I couldn&#39;t find any documentation on the VS2005 version. </p><p>Does anybody know how to fix this problem?  I am using CrystalDecisions.CrystalReports.Engine.dll version 10.2.3600.0 and SQL Server 2000.</p>

    Peggy, I wonder if getting the latest SP for CR 10.2 will be better for now. SP 1 can be downloaded from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
    I\Let us know if that does not resolve the issue and we'll take a closer look before going all the way to CR XI.
    With regards,
    Ludek

  • Crviewer and changing database

    the tutorial on  Adding Ability to Change Database Location at Runtime
    says
    In this tutorial you will change the name of the Database server, not the name of the Database.   It is not possible to change the name of the Database with the CrystalReportViewer control.
    since this seemed pretty clear i have not tested it
    but
    since it does not seem sensible  - after all you can change the connection string
    i wondered why it said this if not completely true

    Correction.
    There are a number of ways of handling database connections.
    1) CR Viewer SDK. Viewer SDK will only allow you to log on to the connection the report was designed off of. It will not ( as the note says) allow you to "change the name of the Database with the CrystalReportViewer control."
    2) CR Engine SDK. This SDK will allow you to change the logon information
    3) InProc RAS SDK. This SDK will allow you to change the logon info, change the database driver, add tables, remove tables and more.
    One thing to keep in mind; InProc RAS SDK does not ship with any VS bundles. But it does ship with Crystal Reports for Visual Studio 2010 and all "stand-alone" versions of CR.
    Oh, one more thing. See KB [1553921  - Is there a utility that would help in writing database logon code?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333933323331%7D.do]. It may prove to be quite useful.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to set database location for stored procedure

    Post Author: Pavel
    CA Forum: Data Connectivity and SQL
    I've already found out that setting location is not only my problem, but I can't understand the correct decision. We using CR to create reports, accessing the data in MSSQL by ODBC.
    Previously (up to version 8) I set location directly, editing the "Table" field in "Set Location" form. Command after report creation was:
    Proc(DBNAME.dbo.PROCEDURE_NAME;1)
    I erased "DBNAME.dbo.", so the correct command was
    Proc(PROCEDURE_NAME;1)
    After that, the report can run on any database name, any ODBC datasource with any owner name of procedure.
    Now we had to upgdate to CR 11 Developer Edition.
    Here I can't erase database location. But when I change database location to ODBC datasource for another database, the properties of stored procedure "Catalog" and "Owner" remain the same as they initiated when report was created! So, when report runs, it call
    exec OLD_DB_NAME.dbo.PROCEURE_NAME;1 ....
    So, the report doesn't work on customer database, because it has different name.
    How can I erase any database location in the report?We run reports using API from Gupta Team Developer applications, may be it is possible to set database location by API before running report?
    Plese help, any tips are usefull.

    Post Author: Pavel
    CA Forum: Data Connectivity and SQL
    When I set location to another database (i.e. another ODBC datasource) by clicking Update button, "Catalog" property is not changing! It remains unaltered. I had to remove procedure from report and then add procedure from another database, so there was a lot of formatting fileds after that.
    This is not a right decision. I didn't solved current problem, I only temporary patched it.
    The correct desision is to set location programmatically from application.But function PEGetNthTableLocation returns empty strings in CR11, or I incorectly declared this function (from CR8.5):
    BOOL CRPE_API PEGetNthTableLocation ( short printJob,  //handle to print job short tableN,  //number of table struct PETableLocation FAR *location     //structure pointer);typedef struct PETableLocation {    WORD StructSize;    char Location &#91;PE_TABLE_LOCATION_LEN&#93;; //256    char SubLocation&#91;PE_TABLE_LOCATION_LEN&#93;; //256    char ConnectBuffer&#91;PE_CONNECTION_BUFFER_LEN&#93;; //512} PETableLocation;

  • Frm-40208 from running in query mode. cannot change database fields

    Hi,
    Could some one help me with this.
    I am calling a form from another form. I am passing the parameter list to the calling form and doing a query by setting the block property. But when queries the message
    FRM-40208 Form running in query mode. cannot change database fields .
    I do not want the message to appear when they go the called form . Please some one could help me how could I avoid displaying the message.
    Regards
    Bain

    Hi,
    Good day! I am working with a module that also calls another form. It uses call_form with query mode parameter set to query_only. My problem is, whenever i call the other form using the call_form, it would display the called module and then as it populates the detail block of the called form, it will display frm-40208 from running in query mode. cannot change database fields per record. What I want is for the message to be displayed only once.
    I have tried capturing the error by using on-error trigger, but it doesn't go to that whenever the other form was being called. I think the message has to do with the post-query trigger, because it passes some values on a dbase block objects.
    Do you have any suggested solutions or workarounds to make the message display only once whenever the other form is being invoked by the call_form?
    I would greatly appreciate any suggestions/ideas.
    Thanks and regards,
    ASantiago

  • How can i change my location in ios 8

    How can i change my location in ios 8

    Settings > iTunes & App Store > Apple ID: > View Apple ID > sign in and change Country/Region.
    Note: You need a physical address & a valid credit card issued for that country that you want to change to.

  • Changing databases from MS SQL Express to MySQL in a  Report at runtime

    Hi all,
    I have an issue in changing databases from MS SQL Express to MYSQL or vice versa in a Report at runtime.
    Here is what I do:
    I create a very simple report with the Crystal Report Designer 2008 V 12.3.0.601.
    This report uses a stored procedure to retrieve it's data. I connect to the Database with JDBC.
    I have two Databases with similar schema and procedures: MS SQL Express an MySQL.
    When I create the report with MSSQL all parameters have the '@' character, as they are named. ok.
    I deploy this report in a JSP application with the crystaldecisions SDK an show it in html viewer format.
    The connection to the MSSQL DB gets established by my JSP and the CRJavaHelper.
    I pass the parameters through my URL to the JSP and finally to the CRJavaHelper (addDiscreteParameterValue)
    and everything works fine.
    The challenge starts, when I try to change the Datasource of this report to MySQL at runtime (which is a requirement in my project).
    I successfully can establish the DBConnection, but my stored procedure just doesn't get called!
    The report just displays totally empty, no Exceptions etc. are thrown. In the DB logfile I see the effort to find my procedure
    and that's all. The Statements called by the SDK finds the correct Procedure, but there's no call to the procedure.
    Of course I know, that MS SQL names it's procedures slightly different (';1' at the end), but even when I rename the table Alias to the correct name in CRHelperJava, I get no call to the procedure in MySQL. I also renamed the parameter-fields in changeDataSource(..) by casting the table to IProcedure and working on its methods. Still no success.
    What am I missing to do or what do I do wrong?
    Any suggestions or even solutions?
    Best Regards,
    Tom

    after all I have managed to set param Values, now I'm stuck because the parms seem to have dissappeared in the formula fields. E.g. I receive this Exception:
    <br><br>
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Ausnahme in Formel ""{@DurationMin}"" bei ""{dataProc.Duration}"":
    Dieser Feldname ist unbekannt.---- Error code:-2147467259 Error code name:failed
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2285)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:733)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:167)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:529)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:527)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:525)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:424)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:352)
         at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
         at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
         at com.crystaldecisions.sdk.occa.report.application.RowsetController.getSQLStatement(SourceFile:1485)
         at org.apache.jsp.report_jsp._jspService(report_jsp.java:360)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
         at java.lang.Thread.run(Unknown Source)
    Caused by: com.crystaldecisions.reports.dataengine.DataEngineException: Ausnahme in Formel ""{@DurationMin}"" bei ""{dataProc.Duration}"":
    Dieser Feldname ist unbekannt.
         at com.crystaldecisions.reports.dataengine.DataSourceManager.do(SourceFile:692)
         at com.crystaldecisions.reports.dataengine.DataSourceManager.new(SourceFile:607)
         at com.crystaldecisions.reports.dataengine.DataSourceManagerCoordinator.a(SourceFile:505)
         at com.crystaldecisions.reports.dataengine.DataSourceManager.a(SourceFile:1060)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:729)
         at com.crystaldecisions.reports.dataengine.DataProcessor2.a(SourceFile:699)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.i(SourceFile:1308)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.k(SourceFile:1297)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1310)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:661)
         ... 32 more
    Caused by: com.crystaldecisions.reports.formulas.FormulaException: Ausnahme in Formel ""{@DurationMin}"" bei ""{dataProc.Duration}"":
    Dieser Feldname ist unbekannt.
         at com.crystaldecisions.reports.formulas.o.a(SourceFile:1041)
         at com.crystaldecisions.reports.formulas.o.do(SourceFile:1013)
         at com.crystaldecisions.reports.formulas.o.new(SourceFile:688)
         at com.crystaldecisions.reports.formulas.o.else(SourceFile:459)
         at com.crystaldecisions.reports.formulas.f.void(SourceFile:65)
         at com.crystaldecisions.reports.formulas.FormulaParser.a(SourceFile:345)
         at com.crystaldecisions.reports.formulas.r.a(SourceFile:89)
         at com.crystaldecisions.reports.formulas.FormulaInfo.a(SourceFile:570)
         at com.crystaldecisions.reports.formulas.FormulaService.compile(SourceFile:347)
         at com.crystaldecisions.reports.reportdefinition.FormulaCompiler.a(SourceFile:139)
         at com.crystaldecisions.reports.reportdefinition.FormulaFieldDefinitionBase.compile(SourceFile:928)
         at com.crystaldecisions.reports.reportdefinition.o.a(SourceFile:1360)
         at com.crystaldecisions.reports.reportdefinition.o.a(SourceFile:1348)
         at com.crystaldecisions.reports.reportdefinition.o.a(SourceFile:4225)
         at com.crystaldecisions.reports.dataengine.DataSourceManager.do(SourceFile:687)
         ... 41 more
    <br><br>
    where dataProc is my stored procedure and @DurationMin is a function field.
    do I have to call verifyDatabase() when I have changed DBs and set the param Values?
    Is there a defined sequence to execute these steps?
    Edited by: tomspengler on Dec 8, 2011 1:55 PM

  • To change table data runtime when dropdown item is changed

    Hi,
    I have two ui elements(Dropdown by index and table) in single view .
    I need to display table as per drondown index item selection. Means i have to change table data runtime when dropdown item is changed.Please help me in that .Please provide code for same.
    Regards,
    gurprit Bhatia

    Hello gurprit Bhatia,
    On the view create a new action. Fill only the Name and Text and leave the other items default.
    In this event you can populate the table fields.
    Bound this newly created action (event) to the onSelect property of the 'DropDownByIndex'.
    Regards,
    Patrick Willems

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • Dynamic Creation of cells or change of cell behaviour of a table at runtime

    Hello all,
    Can anybody tell me how can we change the cell behaviour of a table at runtime or creating the table row with different cell properties dynamically at runtime in ABAP webdynpro.
    for ex the table at runtime can be like...
    The 1st row the 1st cell can be a check box.
    The 2nd row the 1st cell can be a input field.
    The 3rd row the 1st cell can be a radio selection field.
    Business Ex : Dynamic Attributes in BID Invitation
    Thanks in advance in clarifying the doubt.

    Hi Mani,
    You could use code similar to the following code in your WDDOMODIFY method of the view in which the table is placed.
    data wd_table_cell_editor type ref to cl_Wd_view_element.
      data wd_table_column      type ref to cl_wd_table_column.
    wd_table_cell_editor ?= view->get_element( ID ). (Or any other way to get the refernce to the table cell editor)
    wd_table_column ?= wd_table_cell_editor->get__parent( ).
    (Get a refernce to table column throught table cell editor or directly)
    Now use the set_cell_editor method of wd_table_column to set the column to check box or input or any other field of your requirement.
    Also, I suggest you to use ALV as it is simpler change the cell editor and it provides many other improved functionalities.
    Regards,
    Srini.

  • Changing Database connection at runtime in CR2008

    Hi,
    I have a VS2008 application which is using CR2008 to generate pdf reports for the user. Problem is I am not able to change the database connection to any server other than the one that was used to create the report template.
    My environment has CR2008 SP2. I have tried reports with no paramter as well as the ones with parameters both dont seem to work.
    I have already tried a couple of things:
    a) report document refresh after loading it
    b) setting the database connection as
    this._crReport.DataSourceConnections[0].SetConnection(dbServerName, dbName, dbUserId, dbPwd);
    c) setting the database connection as
    tbls = this._crReport.Database.Tables;
                    bool test = false;
                    foreach (Table tbl in tbls)
                        tblLogonInfo = tbl.LogOnInfo;
                        tblLogonInfo.ConnectionInfo = connInfo;
                        tbl.ApplyLogOnInfo(tblLogonInfo);
                        test = tbl.TestConnectivity(); ** note this alwys return a true for the changed database server
    I have read a couple of thread but none has worked for me...Is this a known issue with CR2008?
    Thanks
    Kajal

    Hi Kajal,
    I am assuming that you are not changing the schema of the report at any point of time. I would suggest you to try pointing to the other database through designer to make sure that you can hit the database and the schema is correct. You can also create a udl file to check the database connectivity.
    Then just for testing purpose you can try the following code:
    ReportDocument reportDoc = new ReportDocument();
    reportDoc.Load("path of the report");
    reportDoc.SetDatbaseLocation("uid","pwd","Servername","tablename");
    reportDoc.SetParameterValues("Parameter-Name","values");
    CrystalReportViewer.ReportSoure=reportDoc;
    Does that help?
    Thanks.

Maybe you are looking for