Changing datasource at runtime

In reporting tools like BIRT, it is possible to change the database URL, user name etc at runtime. When I scheduled a report using infoview I could not see any means to change the JDBC URL to point to another database host.

Hi Pradeep,
Please find the steps below to create a Business View with the Dynamic data connection. And yes it is possible to add connection to "dynamic data connection" list.
To create a Data Connection
u2022     On the File menu, select New, and then select Data Connection The u201CChoose a Data Sourceu201D dialog box appears
u2022     Expand the folders as necessary and select a data source
u2022     Click OK and save a Data Connection object
As we are creating the DDC we need to have minimum two Data connections.
To create a Dynamic Data Connection
u2022     On the File menu, select New, and then select Dynamic Data Connection. The u201CChoose a Data Connectionu201D dialog box appears
u2022     Expand the folders as necessary and select a Data Connection.
u2022     Click Add.
u2022     Continue selecting and adding Data Connections as necessary; click Close when you are finished and save a Dynamic Data Connection
To create a Data Foundation
u2022     On the File menu, select New, and then click Data Foundation.The u201CChoose a Data Connectionu201D dialog box appears.
u2022     Select a Data Connection or a Dynamic Data Connection and click OK. If you want to add another Data Connection or Dynamic Data Connection, click Add Connection. Expand the various table nodes, select a table, and click Add.
u2022     Continue adding tables as needed.
u2022     Click Close.
To create a Business Element
u2022     On the File menu, select New, and then select Business Element. Expand and select the Business Fields in tables, formulas, and SQL expressions; then, click Add.
u2022     Click Close.
To create a new Business View
u2022     On the File menu, select New, and then select Business View.
u2022     In the Object Explorer, right-click the Business Elements node, and click Insert Business Elements.
u2022     Click Add. Continue selecting and adding Business Elements as required.
u2022     Click Close to continue
Then you can have your Crystal Reports based on these Business Views.
I hope this helps you and let me know if this works for you.
Prashant.

Similar Messages

  • Changing Images at Runtime...it's sending me nuts (I'm a newbie, go easy)

    Hi all,
    I am trying change images at runtime and quite frankly it's driving me nuts. I'm pretty new to Java and don't understand some of the principles but I'm trying. I have this code below, that loads up a few images. I want to be able to change some/all of these images either on a timed even or on a button press, but all the things I've tried don't work. Can someone offer me some help....thanks in advance
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class bc extends JFrame implements ActionListener {
         public static void main(String[] args) {new bc();}
         bc() {
              //setUndecorated(true); // - this removed the titlebar!
                    setTitle("BC...");
              setSize(350,125);
              setResizable(false);
              setLocation(50,50);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setBackground(new Color(0,0,0));
              getContentPane().setBackground(new Color(255,255,255));
              JPanel hours = new JPanel();
              hours.setLayout(new GridLayout(4,2));
              hours.add(hour14);
              hours.add(hour24);
              hours.add(hour13);
              hours.add(hour23);
              hours.add(hour12);
              hours.add(hour22);
              hours.add(hour11);
              hours.add(hour21);
              JPanel mins = new JPanel();
              mins.setLayout(new GridLayout(4,2));
              mins.add(min14);
              mins.add(min24);
              mins.add(min13);
              mins.add(min23);
              mins.add(min12);
              mins.add(min22);
              mins.add(min11);
              mins.add(min21);
              JPanel secs = new JPanel();
              secs.setLayout(new GridLayout(4,2));
              secs.add(sec14);
              secs.add(sec24);
              secs.add(sec13);
              secs.add(sec23);
              secs.add(sec12);
              secs.add(sec22);
              secs.add(sec11);
              secs.add(sec21);
              JPanel helptext = new JPanel();
              helptext.setLayout(new GridLayout(4,2));
              helptext.add(new JLabel("8"));
              helptext.add(new JLabel("4"));
              helptext.add(new JLabel("2"));
              helptext.add(new JLabel("1"));
    //add action listenters
              changeImg.addActionListener(this);
              JPanel cp = new JPanel();
              cp.setLayout(new GridLayout(1,6));
              cp.setBackground(new Color(255,255,255));
              cp.add(hours);
              cp.add(mins);
              cp.add(secs);
              cp.add(helptext);
              cp.add(changeImg);
              setContentPane(cp);
              setVisible(true);
         public void actionPerformed(ActionEvent ae) {
              hour11.PaintOff(1);
              //JOptionPane.showMessageDialog(this, "changed");
              repaint();
    JPanel hour11 = new PaintOff(0);
    JPanel hour12 = new PaintOff(0);
    JPanel hour13 = new PaintBlank();
    JPanel hour14 = new PaintBlank();
    JPanel hour21 = new PaintOff(0);
    JPanel hour22 = new PaintOff(0);
    JPanel hour23 = new PaintBlank();
    JPanel hour24 = new PaintBlank();
    JPanel min11 = new PaintOff(0);
    JPanel min12 = new PaintOff(0);
    JPanel min13 = new PaintOff(0);
    JPanel min14 = new PaintOff(0);
    JPanel min21 = new PaintOff(0);
    JPanel min22 = new PaintOff(0);
    JPanel min23 = new PaintOff(0);
    JPanel min24 = new PaintOff(0);
    JPanel sec11 = new PaintOff(0);
    JPanel sec12 = new PaintOff(0);
    JPanel sec13 = new PaintOff(0);
    JPanel sec14 = new PaintOff(0);
    JPanel sec21 = new PaintOff(0);
    JPanel sec22 = new PaintOff(0);
    JPanel sec23 = new PaintOff(0);
    JPanel sec24 = new PaintOff(0);
    JButton changeImg = new JButton("change");
    }///---------This is my PaintOff class ---------------\\\
    import javax.swing.*;
    import java.awt.*;
    import java.awt.Image.*;
    public class PaintOff extends JPanel {
    Toolkit tk = Toolkit.getDefaultToolkit();
    public Image imgOff = tk.getImage("off.jpg");
    public Image imgOn = tk.getImage("on.jpg");
    public Image paintMe = tk.getImage("off.jpg");
         PaintOff(int a) {
              if(a == 1) {
                   vOn();
              } else {
                   vOff();
         public void vOn() {
            paintMe = imgOn;
         //JOptionPane.showMessageDialog(new bc(), "shown");
         public void vOff() {
            paintMe = imgOff;
         public void paintComponent(Graphics g) {
              g.drawImage(paintMe,0,0,this);
    }PaintBlank class is not included here, it's basically just the same as PaintOff but only has one image inside.
    When I try and compile this code, I get
    C:\jdk1.4\bin\bclock>javac bc.java
    bc.java:79: cannot resolve symbol
    symbol : method PaintOff (int)
    location: class javax.swing.JPanel
    hour11.PaintOff(1);
    ^
    1 error
    I don't understand this either, I've tried replacing "PaintOff(1)" with "vOn()" but I get the same error. This is baffling to be, as I thought that the hour11 would have access to all the methods inside the PaintOff class?
    Anyway, thanks for any help you guys give me!
    Cheers
    //Chris.

    Hi!
    Your problem is that you've used a widening conversion to convert from PaintOff to a JPanel. JPanel has no such method, and so the compiler is complaining that it can't find it.
    e.g
    public class NoCompile{
         public static void main(String args[]){
              One one = new Two();
              one.methTwo();
    public class Two extends One{
         public Two(){}
         public void methTwo(){
            System.out.println("Executed 2");
    public class One{
         public One(){}
         public void meth1(){}
    } will give you the same sort of error message. To make the compiler happy, use a cast.
    Now this will compile and gives the right result.
    public class NoCompile{
         public static void main(String args[]){
              One one = new Two();
              ((Two)one).methTwo();
    }So in your case, you want to do
    ((PaintOff)hour11).vOn();
    Does that help?
    :) jen

  • How to change datasource name based on the partition in configplan

    Hi
    Can any one please give me some solutions regarding how to change datasource name based on the partition in
    configplan.
    can't we do this in configuration plan?

    If you want to change template based on parameter. you have to use below syntax
    v_layout boolean
    V_LAYOUT:= FND_SUBMIT.add_layout(template_appl_name => 'SQLAP' -- application short name
    ,template_code => 'HUBAPAPN' -- template name
    ,template_language => 'en'
    ,template_territory => '00'
    ,output_format => 'PDF');
    Above can be used in plsql stored procedure before submitting Concurrent Program (Bi Publisher report) or may be you can try to add this code in Oracle reports after report or before report trigger
    Thanks
    Kamalakar

  • Change datasource of Crystal Report via code

    Hi all!
    I'm developing partner solution for SAP B1 8.8 in C# and prepared some nice crystal reports. But they are bound to my default database for now. I want to include them to my installation file and change saved datasource location (Server, Company Name, User name, User password) in my installation script as soon as I get this values, entered by user. But I don't know the way how to change datasource in rpt file. I've tried the following:
    using CrystalDecisions.CrystalReports.Engine;
    ReportDocument rDoc = new ReportDocument();
    rDoc.Load(@"C:\Temp\Report2.rpt");
    rDoc.DataSourceConnections[0].SetConnection("Server", "SBOTest", "manager", "manager");
    rDoc.SaveAs(@"C:\Temp\Report3.rpt");
    rDoc.Close();
    but it save no changes to rpt file.
    I think, this thread belongs mostly to Development/SDK thread, because here most of the people make programs and potentially met this problem in the past.

    public void SetCrystalLogin(string sUser, string sPassword, string sServer, string sCompanyDB, CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt)
                CrystalDecisions.Shared.ConnectionInfo oConnectInfo = new CrystalDecisions.Shared.ConnectionInfo();
                oConnectInfo.DatabaseName = sCompanyDB;
                oConnectInfo.ServerName = sServer;
                oConnectInfo.UserID = sUser;
                oConnectInfo.Password = sPassword;
                // Set the logon credentials for all tables
                SetCrystalTablesLogin(oConnectInfo, oRpt.Database.Tables);
                // Check for subreports
                foreach (CrystalDecisions.CrystalReports.Engine.Section oSection in oRpt.ReportDefinition.Sections)
                    foreach (CrystalDecisions.CrystalReports.Engine.ReportObject oRptObj in oSection.ReportObjects)
                        if (oRptObj.Kind == CrystalDecisions.Shared.ReportObjectKind.SubreportObject)
                            // This is a subreport so set the logon credentials for this report's tables
                            CrystalDecisions.CrystalReports.Engine.SubreportObject oSubRptObj = oRptObj as CrystalDecisions.CrystalReports.Engine.SubreportObject;
                            // Open the subreport
                            CrystalDecisions.CrystalReports.Engine.ReportDocument oSubRpt = oSubRptObj.OpenSubreport(oSubRptObj.SubreportName);
                            SetCrystalTablesLogin(oConnectInfo, oSubRpt.Database.Tables);
                oRpt.Refresh();
                oRpt.SetDatabaseLogon(sUser, sPassword, sServer, sCompanyDB, false);
                oRpt.VerifyDatabase();
                oRpt.Refresh();
            private void SetCrystalTablesLogin(CrystalDecisions.Shared.ConnectionInfo oConnectInfo, Tables oTables)
                foreach (CrystalDecisions.CrystalReports.Engine.Table oTable in oTables)
                    CrystalDecisions.Shared.TableLogOnInfo oLogonInfo = oTable.LogOnInfo;
                    oLogonInfo.ConnectionInfo = oConnectInfo;
                    oTable.ApplyLogOnInfo(oLogonInfo);
    Edited by: Konstantin Rakhuba on May 6, 2010 11:44 AM
    Edited by: Konstantin Rakhuba on May 6, 2010 11:45 AM

  • Changing picture at runtime using delphi

    Post Author: iman_400
    CA Forum: Other
    Please help me, is there anyway we can change picture at runtime using delphi 7.0 and CRXIR2?

    Hi, Lee;
    For the version of Crystal Reports that comes with .NET, you can use something like one of our samples shows:
    https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe
    Look for the sample, vbnet_win_DynamicImage.zip. It uses an ADO.NET dataset to change the image.
    For Crystal Reports XI R2 and Crystal Reports 2008, you can more directly change the image location using built in functionality.
    In the Designer, choose Insert > Picture. Choose a default image to show and save it. Right-click on it and select Format Graphic. Go to the Picture tab and click the formula button for Graphic location. Save the report.
    Then, at runtime you can populate the Formula with the new location for your image, either a URL or disk file location.
    See the following note for more information:
    [Image|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333333373334%7D.do]
    Best Regards,
    Jonathan

  • Change to the runtime the logon language with ABAP

    Hello,
    I have a  question.
    Is it possible to change to the runtime the logon language?
    With the URL-parameter example it worked.
    http://www.****bsp/sap/z_page/default.htm?sap-language=en
    But I need this in the event handler with ABAP coding.
    thanks Eren

    you can either use
    CL_HTTP_UTILITY->IF_HTTP_UTILITY~SET_REQUEST_URI
    uri = sap-language=FR
    or
    CL_HTTP_REQUEST->IF_HTTP_ENTITY~SET_FORM_FIELD
    name = sap-client
    value = FR
    or
    use
    SET LOCALE LANGUAGE 'S'. within your abap coding
    Regards
    Raja

  • [svn] 3839: Update the channel url to reflect the change in the runtime channel

    Revision: 3839
    Author: [email protected]
    Date: 2008-10-23 07:42:37 -0700 (Thu, 23 Oct 2008)
    Log Message:
    Update the channel url to reflect the change in the runtime channel
    Modified Paths:
    blazeds/branches/3.0.x/qa/apps/qa-manual/ajax/messaging/TextMessageRuntimeDest.html

    Many ways to do this. The easiest is to have a method in one of your classes that reads the data from the database and creates all the proper structure under a RootNode and then returns that RootNode.
    Whenever you want to refresh the tree, just call that method to recreate the root node (and all the underlying structure/nodes) and then re-set the root node of your tree model using the setRoot() method. That will cause it to refresh the display given the new root node.
    Once you have that working, you can get fancier and make it more efficient (only updating/firing events for the nodes that actually changed, etc).

  • 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

  • Changing DataSource Configuration using ConfigTool - Help Needed.

    Hello Everyones,
    I have an EP 7 which I have installed on a WAS ABAP + JAVA. The Data Soruce configuraion is in dataSourceConfiguration_abap.xml because of this I cannot create any new users in the Portal, can someone tell me how I can change this Config file using the ConfigTool and what procedure is to be used.
    Thanks for your help,
    John.
    Message was edited by: John Bray

    See Changing DataSource Configuration using ConfigTool - Help Needed.

  • How to change DataSource runtime in Oracle ADF.

    Hi All,
    In my requirement,Its seems to selecting dynamic data-source.let me explain my requirement i have a table in database username,passwords and schema name. from the login page i ll pass username,password and as drop-down I ll select schema.once i successfully logged-in can i access (execute, display data from ) selected schema from UI.in all sachems tables remain same but data is different.
    how to execute/change selected data-sources at run time if i am using Bc4J.
    please give me some solution.
    regards
    Siva

    Check Jobineshs blog http://jobinesh.blogspot.de/2011/04/modifying-application-modules-jdbc.html and Andrejus blog http://andrejusb.blogspot.de/2012/08/sample-application-for-switching.html
    Timo

  • Changing datasource of reports in a loop only works for first report.

    Hi,
    I have code that loops through a list of reports to change the datasource and save the change in the report. The idea is that this can be done at build time so time taken at runtime is only for opening the report and running it.
    The problem is that the first iteration of the loop works, and any further ones don't. Apart from closing the client document is there anything else that should be explicitly closed? I don't retrieve any ReportSource from the Client Document so I shouldn't need to dispose of that...I don't think. In particular is there something that should be done to the databaseController retrieved from the clientDoc after each loop?
    The code goes like the below:
    for(File report : reports){
         System.out.println("Preparing report: " + report.getAbsolutePath());
         ReportClientDocument clientDoc = CRJavaHelper.getReportClientDocument(
                   report.getAbsolutePath());
         CRJavaHelper.replaceDBConnection(clientDoc, props);
         clientDoc.close();
         System.out.println("Report " + report.getAbsolutePath() + " prepared.");
    getReportClientDocument does this:
    ReportClientDocument clientDoc = new ReportClientDocument();
    clientDoc.setReportAppServer("inproc:jrc");
    clientDoc.open(fullPath,
              OpenReportOptions.openAsReadOnly.value());
    return clientDoc;
    replaceDBConnection does the following:
    DatabaseController dc = clientDoc.getDatabaseController();
    logonDataSource(dc, username, password);
    prepareReport(dc, schema);
    ConnectionInfos cis = dc.getConnectionInfos(null);
    for (IConnectionInfo oldci : cis) {
         IConnectionInfo newci = new ConnectionInfo();
         newci.setKind(ConnectionInfoKind.SQL);
         newci.setAttributes(propBag);
         newci.setUserName(username);
         newci.setPassword(password);
         dc.replaceConnection(oldci, newci, null, DBOptions._useDefault
                   + DBOptions._doNotVerifyDB);
    SubreportController src = clientDoc.getSubreportController();
    IStrings strs = src.getSubreportNames();
    Iterator<?> it = strs.iterator();
    while (it.hasNext()) {
            String name = (String) it.next();
         ISubreportClientDocument subreport = src.getSubreport(name);
         DatabaseController sdc = subreport.getDatabaseController();
         cis = sdc.getConnectionInfos(null);
         for (IConnectionInfo oldci : cis) {
              IConnectionInfo newci = new ConnectionInfo();
              newci.setAttributes(new PropertyBag(propBag));
              newci.setUserName(username);
              newci.setPassword(password);
              sdc.replaceConnection(oldci, newci, null, DBOptions._useDefault
                        + DBOptions._doNotVerifyDB);
    clientDoc.save();

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

  • How to change datasource viewobject main query in .jsp

    Hi i have datasource DataSource viewobject="test"
    now in .jsp page i need to change it main query and after some things again back to default how i can doo it ?
    Thanks for tips!
    ID.
    Jdeveloper Studio Edition Version 11.1.1.6.0
    ADF Business Components
    11.1.1.61.92

    if you want to change where clause or modify the whole query look here
    Changing the WHERE clause or VO Query at runtime in Oracle ADF | Techartifact

  • Change DataSource of fields via code

    Hey there,
    is it possible to change the properties Name and FormulaName of the FieldObject programmatically (c#)? Both properties are readonly. We need to replace the fieldnames of many reports which contain a big count of fields. We don't want to do it in the designer, because this would be very time expensive.
    Is there a possibility to change the DataSource of the FieldObject programmatically? Or is it possible to remove fields and add new fields to the report (programmatically)?
    Thank you in advance.
    Kind regards from Germany
    Markus

    Hi Markus,
    No and maybe.... You can't change the reference of a specific field at runtime, the Auto-field Mapping function kicks in and it simply deletes the fields it can't find in the data source info.
    You can however clone the object, delete it and then make changes to the cloned object and then .Add to put the field back in place...
    See this page for starting points using RAS:
    NET RAS SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
    Don

  • How can I add an image to a project and change it at runtime?

    I'm using JBuilder6 and I thought I saw a control to add images but I can't find it. I also wanted to be able to change the control at runtime. Also how should I specify the path so it knows how to use it? I hate to hard code one in. Since this is probably gonna be ported to other OS does Java have a way around this? I was going to put the images into my project's directory. For me to be able to just include the file w/the extension do I need to put it in the src folder or will the main directory be accessible?

    To add an image, or other source file with JBuilder, you have a button call "Add to project", his icon is a folder with a green cross.
    To call the Image os independant, I sugest you to put your images in a folder "image" in your project folder. Then to call them, you could use this :
    image=new ImageIcon(AClass.class.getResource("image"+java.io.File.separator+imageName));Where AClass is a class of your project, in general, the class where you call getRessource;
    "image" is the name of the under folder where are the image in your project folder;
    imageName is a string with the name of the file witch contains the image, for exemple : "my image.gif"I hope I help you.
    JHelp.

  • Changed DataSource in R/3-- New PSA Table in BI ?????

    Hello Experts,
    I have one question. When someone change a DataSource in R/3 System, what happens it for the DataSource
    in BI at this time.
    An Error ? (TimeStamp)
    Or new PSA Table ???
    Thank you for your Answer..

    Dear Baris,
    Until and unless you replicate the Data Source in BW System there will no effect.
    Once you replicate the meta data and reactivate the D.S the a new PSA Table is generated.
    Hope this Helps....
    Dev

Maybe you are looking for

  • Goods Receipt against Process order mvt 262

    Hi, Is it possible to not to receive material against process order (262 mvt) if it is not issued using process order using 261. Do the needful. Regards Mohan

  • If else question.

    Hello, public void register() throws SQLException{      try {         databaseConnection();         PreparedStatement ps = con.prepareStatement("INSERT INTO reservation(ci,co,roomno,numb,roomty,nm,srn,phn,mail,sex)" +                 "VALUES (?,?,?,?

  • Slider .change question

    Hello. I'm need a real-time working slider, like a opacity or fill layer sliders. I'm trying to resolve this problem, but unfortunately i have no succes ) I experimenting with suspendHistory, activeHistoryState, PurgeTarget.HISTORYCACHES, app.refresh

  • Java.lang.NoSuchMethodError when try to use RDBMS WLI adapter sp2

    Hi, We have encountered a problem when trying to use the latest version of the WLI RDBMS adapter downloaded from the website. This adapter comes as an ear file of size 4026K. Has anyone been able to get this version to work?? Was using the earlier ve

  • Newbie question: adf Table

    I got an ADF table but it is to big. It has many rows. I want the table can show 10 rows each time and it has selections of next and previous items. Which properties's item should be changed? Where is the Table data streaming?