Dynamic datasource in ColdFusion via LCDS ES

Hi All,
I'm hitting a wall on a requirement for a Flex application which utilizes the LCDS version included with ColdFusion.
I have the project setup to use DAO's, Assemblers and ValueObject (cfc's) which I call from Flex via DataService implmentation and the fill(), getItem(), etc... methods.
I need to setup my ColdFusion layer to access multiple datasources from the same Flex application.  However, because of the way LCDS gets called from Flex, it doesn't seem that Application or Session variables in ColdFusion persist when I set them.  I was thinking I could just have the HTML (cfm) wrapper page for my Flex application set that, but it is not recognized when I go to make a fill or get call against the assembler.
I thought about passing the datasource as a parameter each time a call is made, but while that would work when I initiate fill and get methods, the sync methods are "invisible" and I wouldn't be able to append an argument to them.
So my issue is... how do I go about having ColdFusion read a dynamic variable to define it's datasource?
Thanks in advance for the help.
Brendan

Hi Ian,
Thanks very much for the reply.  While it doesn't provide the solution, you definitely hit the nail on the head as to the problem :-) 
Ben Forta provides and explanation (and solution) for what you describe here: http://www.forta.com/blog/index.cfm/2007/11/15/Flex-And-ColdFusion-Session-Variables  However, I tried his method out, and it didn't work for me... perhaps the difference between HTTP RemoteObject access, and RTMP DataServices.
You know... I tried it out a while ago before I had a better understanding of the problem... perhaps I'll try again :-)  Will post results of latest attempt...
Thanks again,
Brendan

Similar Messages

  • Dynamic Datasource creation

    I am trying to create datasources dynamically. Using an example from a previous
    post,
    mbeanHome = lookupMBeanHome();
    JDBCDataSourceMBean dsMBean = (JDBCDataSourceMBean)mbeanHome.createAdminMBean(poolName,"JDBCDataSource",
    mbeanHome.getDomainName());
    dsMBean.setJNDIName(poolName);
    dsMBean.setPoolName(poolName);
    dsMBean.addTarget(tserverMBean);
    dsMBean.setPersistenceEnabled(false);
    How can I retrieve the proper TargetMBean reference to send to the addTarget method.
    Does anyone know where I can find an entire class example of dynamically creating
    datasources, or something similar.
    Thanks in advance,
    Fahd

    Hi Fahd,
    Here is a sample I posted here some time ago
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.Iterator;
    import java.util.Set;
    import javax.naming.Context;
    import javax.sql.DataSource;
    import weblogic.jndi.Environment;
    import weblogic.management.configuration.JDBCDataSourceMBean;
    import weblogic.management.configuration.ServerMBean;
    import weblogic.management.MBeanHome;
    * This class demonstrates dymamic creation,
    * using and deletion of DataSource via
    * Weblogic management API.
    public class DynamicDataSource {
    private Context ctx = null;
    private JDBCDataSourceMBean dsMBean = null;
    private MBeanHome mbeanHome = null;
    private ServerMBean serverMBean = null;
    // DataSource attributes
    private String cpName = "yourPoolName";
    private String dsJNDIName = "dynamic-data-source";
    private String dsName = "dynamic-data-source";
    // Security credentials
    private String password = "admPasword";
    private String serverName = "yourServer";
    private String url = "t3://localhost:7701";
    private String userName = "system";
    * Creates and starts up a DataSource using
    * management API.
    public void createDataSource() throws SQLException {
    System.out.println("Creating DataSource...");
    try {
    // Get context
    Environment env = new Environment();
    env.setProviderUrl(url);
    env.setSecurityPrincipal(userName);
    env.setSecurityCredentials(password);
    ctx = env.getInitialContext();
    // Lookup for MBean home
    mbeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    serverMBean = (ServerMBean)mbeanHome.getAdminMBean(serverName,
    "Server");
    // Delete if DataSource MBean already exists in active domain
    Set dsMBeanSet = mbeanHome.getMBeansByType("JDBCDataSource",
    mbeanHome.getDomainName());
    Iterator iter = dsMBeanSet.iterator();
    while(iter.hasNext()) {
    JDBCDataSourceMBean dsmb = (JDBCDataSourceMBean) iter.next();
    if (dsmb.getJNDIName().equals(dsJNDIName)) {
    dsMBean = dsmb;
    deleteDataSource();
    break;
    // Create DataSource MBean
    dsMBean = (JDBCDataSourceMBean)mbeanHome.createAdminMBean(
    dsName, "JDBCDataSource",
    mbeanHome.getDomainName());
    // Set DataSource attributes
    dsMBean.setJNDIName(dsJNDIName);
    dsMBean.setPoolName(cpName);
    // Startup datasource
    dsMBean.addTarget(serverMBean);
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    * Symply gets and closes a connection from dynamic
    * DataSource. Will throw a SQLException if datasource
    * does not exists.
    public void createConnection() throws SQLException {
    System.out.println("Getting Connection...");
    try {
    DataSource ds = (DataSource)ctx.lookup (dsName);
    Connection conn = ds.getConnection();
    conn.close();
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    * Shuts down and deletes DataSource from configuratrion
    * using management API.
    public void deleteDataSource() throws SQLException {
    System.out.println("Deleting DataSource...");
    try {
    // Remove dynamically created datasource from the server
    dsMBean.removeTarget(serverMBean);
    // Remove dynamically created datasource from the configuration
    mbeanHome.deleteMBean(dsMBean);
    } catch (Exception ex) {
    throw new SQLException(ex.toString());
    public static void main(String args[]) {
    DynamicDataSource dds = new DynamicDataSource();
    try {
    dds.createDataSource();
    dds.createConnection();
    dds.deleteDataSource();
    } catch (SQLException ex) {
    ex.printStackTrace();
    "Fahd" <[email protected]> wrote in message
    news:[email protected]...
    >
    I am trying to create datasources dynamically. Using an example from aprevious
    post,
    mbeanHome = lookupMBeanHome();
    JDBCDataSourceMBean dsMBean =(JDBCDataSourceMBean)mbeanHome.createAdminMBean(poolName,"JDBCDataSource",
    mbeanHome.getDomainName());
    dsMBean.setJNDIName(poolName);
    dsMBean.setPoolName(poolName);
    dsMBean.addTarget(tserverMBean);
    dsMBean.setPersistenceEnabled(false);
    How can I retrieve the proper TargetMBean reference to send to theaddTarget method.
    >
    >
    Does anyone know where I can find an entire class example of dynamicallycreating
    datasources, or something similar.
    Thanks in advance,
    Fahd

  • How do I create a Dynamic PDF in ColdFusion

    I am using ColdFusion CS4 and I need to create a dynamic PDF certificate for the user when they finish a short test.
    Their name is in a session var and should dynamically enter in to the Name field of the certificate as well as the date.
    The user can print The PDF certificate, which must be protected to Allow Print only.
    I have a PDF created in Adobe Lifecycle Designer. This contains all the data and a text field Name and Data that needs the dynamic input from ColdFusion.
    <cfpdfform action="populate" source="certificate.pdf">
          <cfpdfsubform name="form1">
                <cfpdfsubform name="page1">
                      <cfpdfformparam name="employeeName" value="John Hollings" />
                      <cfpdfformparam name="date" value="#dateformat(now(), 'dd mmmm, yyyy')#" />
                      <cfpdfformparam name="submitURL" value="#CGI.SCRIPT_NAME#" />
                      </cfpdfsubform>
          </cfpdfsubform>
    </cfpdfform>
    Thsi work but the PDF textFields are open to edit, I need to lock down the PDF so only printing can operate...
    No Copy of data
    No Saving the file (if possible)
    Only print and close

    act332 wrote:
    If I make a form in Adobe Pro9 it opens Lifecycle and I am back there.
    Unfortunately, I am not using Acrobat 9/LiveCycle. So I cannot really provide any specifics there. For usage questions, you might try asking on the Acrobat/LiveCycle forums.   But from CF's perspective, the key is the form's _format_.  Acrobat (AcroForms) and LiveCycle forms are two totally different formats internally.  (Like MS Office 2007 files versus MS Office 2003 files). To flatten a form from CF, it must be an AcroForm:
    http://www.planetpdf.com/article.asp?ContentID=adobe_live_cycle_designer_and_acrobat_pdf_f orms_under_the_hood&page=1
    act332 wrote:
    I am trying to allow a user to print a document (certificate) with their name and date dynamically inserted, this document
    Well as I mentioned, you can use cfpdf or ddx to set whatever permissions you need. The default is "All" (ie all actions are allowed) but you can restrict the permissions by passing in a list of which permissions _should_ be allowed. Anything not included in the list will be restricted.
    <cfpdf permissions="None" ...>   OR
    <cfpdf permissions="AllowPrinting" ...>  OR
    <cfpdf permissions="AllowPrinting,AllowCopy" ...>  OR

  • Data load from to datasources to InfoCube via common Infosource in BI7

    Hi all,
    I need to load data from two diffent DataSource to one Infocube. Between this Infocube and DataSources there is one infosource common for both Datasources.
    Between Infocube and Infosource there is one transformation and between each DataSource and that single InfoSource there are individual transformations.
    I need to move data from each DataSource to infocube via InfoSource and through all the three transformations..
    I tried to create a DTP to load data from one DS1 to InfoCube. It worked fine. But while creating DTP from other DS to Infocube I am not able to use the transformation which I have created from InfoSource to Infocube. Its getting bypassed and systems creates a new transformation between DS2 to infocube.
    Can anybody help me for this???

    Hello all,
    Thanks for instant replies..
    We need have Infosource as we need to have currency transformation, and multi-stage transformation...
    My question is when I am creating a DTP for second DS it is bypassing the transformation which I have created between InofSource and DataSource...
    It is following that that transformation only for  first DS.. and not for the second one. Whereas, we need have that transformation (transformation between InfoSource and InfoCube) common for all DS which are loading data through InfoSource.

  • Dynamic datasource query in Content Presenter

    I have a Documents region with a custom Content Presenter template.
    I would like to use a dynamic datasource query with this, which makes use of the currently logged in user and the user's role.
    The task flow parameters look like this now:
    <parameters>
    <parameter id="taskFlowInstId"
    value="${'afd37bc3-bd2e-4e97-b838-74c975529633'}"/>
    <parameter id="datasourceType" value="${'dsTypeQueryExpression'}"/>
    <parameter id="datasource"
    value="${'SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:dDocType = \'Dagbericht\''}"/>
    <parameter id="templateCategory" value="${''}"/>
    <parameter id="templateView" value="${'dagberichten.list.template'}"/>
    <parameter id="maxResults" value="${'3'}"/>
    </parameters>
    What are my options to achieve this?

    Jaap,
    You can use expression language in that query to make it dynamic.
    You could either build the full query from a managed bean or just some parameters.
    here's how you can do it when building the query from a MB:
    This should be the method in your bean:
    public String getQuery(){
      String user = ADFContext.getCurrent().getSecurityContext().getUserName();
      String query = "SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:dDocType = 'Dagbericht' and ora:p:dCreatedBy = '" + user + "'";
      return query;
    }Your datasource parameter should be something like this:
    <parameter id="datasource" value="#{yourBean.query}"/>note: the "and ora:p:dCreatedBy..." might not be correct but it shows how you can dynamicly build the query.
    Hope this helps.

  • Using dynamic DataSources with WL 6.1

    Hi All,
    Here is an example of how to create, use and delete
    JDBC DataSources dynamically using JMX and WL 6.1.
    Regards,
    Slava Imeshev
    [DynamicDataSource.java]

    Hi Srinivas,
    "Srinivas Chennamaraja" <[email protected]> wrote in message news:[email protected]..
    Hi Slava!
    If I just have Weblogic 6.1 (as an Admin Server), Would I be able to create
    Dynamic DataSources?. The documentation says that you can't create aYes, you'll be able to create a datasource.
    dynamic Datasource in Weblogic. what is JMX?. I would appreciate if youThis is a brand-new feature.
    describe in detail?.Look here for JMX http://java.sun.com/products/JavaManagement/
    >
    can I create a any type of Datasources dynamically (like TXDatasources...).Yes, you can. Look at our doc site for details.
    http://e-docs.bea.com/wls/docs61/javadocs/weblogic/management/configuration/JDBCTxDataSourceMBean.html
    >
    thanks,
    Srini
    "Slava Imeshev" <[email protected]> wrote in message
    news:3b783560$[email protected]..
    Hi All,
    Here is an example of how to create, use and delete
    JDBC DataSources dynamically using JMX and WL 6.1.
    Regards,
    Slava Imeshev
    [att1.html]

  • Dynamically output a  image via struts insted of servlet

    Hello,
    I want to know how to dynamically output a image via struts insted of servlet;
    I can work it fine with the serverlet, this how i get it to work via serverlet:
    java class:
    public class ImageServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
    in web.xml :
    <servlet>
    <servlet-name>ImageServlet</servlet-name>
    <servlet-class>com.admin.transferform.ImageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ImageServlet</servlet-name>
    <url-pattern>/ImgServlet</url-pattern>
    </servlet-mapping>
    and access the pic in[b] jsp :
    <img src="/ImgServlet"></img>
    <br>
    I just want to know, how do i access via struct?
    i change the java class to :
    public class ImageServlet extends Action {
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    and in struts-config.xml :
    <action
    path="/image"
    type="com.admin.transferform.ImageServlet">
    </action>
    and i have tryed both these in jsp but none did work:
    in JSP :
    <img src="/image"></img>
    or
    <html:image src="/image" />
    can some one tell me, where did i went wrong pleaseee :)

    ImageServlet java :
    package com.admin.transferform;
    import java.io.*;
    import java.net.URLConnection;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    import org.apache.log4j.Logger;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class ImageServlet extends Action {
         private static Logger logger = Logger.getLogger(ImageServlet.class);
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
              try {
                   InputStream in = new BufferedInputStream(new FileInputStream("/export/projects/images/headernews.jpg"));
                   logger.debug("dec : trying to output the image file");
                   String s = URLConnection.guessContentTypeFromStream(in);
                   response.setContentType( s );
                   byte pic[]= new byte[in.available()];
                   in.read( pic );
                   OutputStream out = response.getOutputStream();
                   out.write( pic );
              } catch (IOException e) {
                   logger.error("Error opening file region", e);
              return null;
    in struts-config :
    <action-mappings>
    <action
    path="/image"
    type="com.waterfind.admin.transferform.ImageServlet">
    </action>
    </action-mappings>
    jsp :
    <img src="<html:rewrite action="/image"/>">
    or
    <img src="/myContext/image.do"/>
    none working still, any more help please :)

  • Help with dynamic datasource and record selection

                                                                                                                                                                                                                                                                                     <span>Hi, I&#39;m having some difficulty with part of an application I&#39;m trying to build, but here&#39;s some background first.<br /> <br /> I am a student at the University of Maryland, and I&#39;m writing an application for one of the departments here at the university.  It is sort of a front-end for an access database with a lot of extra functionality.  This includes reports.  First of all, the user can change the databse that the application uses, so I store that in an appsetting.  For this reason, I have to tell the report what database to use at runtime rather than using the database expert.  I am building a sort of report wizard in which the user selects certain values, and based upon those values, the SQL statement that the report gets data from changes.  So almost everything about the report&#39;s data is dynamic and will be determined at runtime.  <br /> <br /> So for example if the user chooses an officer report by chapter names, I do this (chapters is a comma delimited string):<br /> <br /><span style="font-weight: bold"> string sel = "SELECT * FROM [Undergrad Leadership] WHERE [Leadership Position] = &#39;" + txtPosition.Text + "&#39; AND [Chapter Name] IN (" + chapters + ");";</span><br /> <br /> The part I am lost on, is how to actually interface with crystal reports.  In the following code, conn is an OleDbConnection to the correct database, rep is the ReportDocument, and view is a CrystalReportsViewer.<br /> <br /><span style="font-weight: bold"> rep.DataSourceConnections[0].SetConnection(conn.DataSource, conn.Database, false); <br /> rep.RecordSelectionFormula = sel;</span><br /><span style="font-weight: bold"> view.ReportSource = rep;</span><br /> <br /> When I try to load the report, I get the following error message:<br /> Error in formula <Record Selection>:  a number, currency amount, boolean, date, time, date-time, or string is expected here.<br /> <br /> Also, assuming this formula gets fixed, how do I actually get fields from this formula and datasource onto my report, since I can&#39;t do it at design time?  Thanks in advance for the help.<br /> <br /> -Jared<br />    </span>

    <p>RCAPI (Report Creation and Modification) calls are only available with Crystal Reports Server RAS SDKs.  This means that using the bundled version of Crystal Reports for Visual Studio will not allow you to place fields onto the report.  A free copy of Crystal Reports Server comes with a registered copy of Crystal Reports Developer.  My guess is that you don&#39;t have either of these products and that you are just using the product that came with Visual Studio.</p><p>All is not lost.  The first question is, do you really need to add the fields at runtime?  In many cases developers just want to have control of the data that gets sent to the report and they are ok with having the same fields display.</p><p>In your code you are changing the datasource which is fine, and you are assigning a Record selection formula which is also fine.  </p><p>The problem with the record selection is that it doesn&#39;t fit the syntax of the Report.  I would suggest printing out the value that you programatically get for the formula and insert it into the Crystal Report Designer.  You will probably get the same error there and gets some  hints as to why it doesn&#39;t work.</p><p>What I would suggest is creating a template report that already has the fields on the report and then change its datasource at runtime and add a RecordSelectionFormula.</p><p>Otherwise you will have to use RAS to be able to add fields at runtime. </p><p>Rob Horne<br /><a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/blog/10</a></p>

  • Connecting to the Datasource in ColdFusion 8 vs CF 6

    Hi all,
    I have a CF6 application that is running well. However, I'm
    in the process of upgrading to CF8, and some of the code no longer
    works. I've scoured the documentation and haven't found information
    on the replacement code.
    My old code gets a datasource, acquires a database
    connection, uses the connection, and then closes the datasource.
    variables.dsService = CreateObject("java",
    "coldfusion.server.ServiceFactory").DataSourceService;
    variables.dsManager = dsService.getDman();
    variables.dataSource =
    variables.dsManager.getDataSource(<data source name goes
    here>);
    variables.dbConnection =
    variables.dataSource.getConnection();
    <code to use the db connection goes here>
    variables.dbConnection.close();
    Under CF8, the error message is "The getDman method was not
    found." So I've been unable to find any code that will let me get
    access to an object that implements DataSource, so that I can use
    my connections.
    Any advice would be appreciated.
    Mike K.

    not sure if these help:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=basiconfig_37.html
    http://localhost/CFIDE/adminapi/datasource.cfc
    Ken Ford
    Adobe Community Expert - Dreamweaver/ColdFusion
    Fordwebs, LLC
    http://www.fordwebs.com
    "MKK2" <[email protected]> wrote in message
    news:g6d5sa$s0q$[email protected]..
    > Hi all,
    >
    > I have a CF6 application that is running well. However,
    I'm in the process of
    > upgrading to CF8, and some of the code no longer works.
    I've scoured the
    > documentation and haven't found information on the
    replacement code.
    >
    > My old code gets a datasource, acquires a database
    connection, uses the
    > connection, and then closes the datasource.
    >
    >
    > variables.dsService = CreateObject("java",
    > "coldfusion.server.ServiceFactory").DataSourceService;
    > variables.dsManager = dsService.getDman();
    > variables.dataSource =
    variables.dsManager.getDataSource(<data source
    > name goes here>);
    > variables.dbConnection =
    variables.dataSource.getConnection();
    > <code to use the db connection goes here>
    > variables.dbConnection.close();
    >
    > Under CF8, the error message is "The getDman method was
    not found." So I've
    > been unable to find any code that will let me get access
    to an object that
    > implements DataSource, so that I can use my connections.
    >
    > Any advice would be appreciated.
    >
    > Mike K.
    >

  • Dynamic Reports without ColdFusion

    What is the best way to create attractive, printable dynamic
    report from Flex, not using ColdFusion? I'd be nice, since Adobe
    owns Flex and Acrobat, to make a simple way to generate PDF reports
    from Flex. FlashPaper would be okay too.

    What is the best way to create attractive, printable dynamic
    report from Flex, not using ColdFusion? I'd be nice, since Adobe
    owns Flex and Acrobat, to make a simple way to generate PDF reports
    from Flex. FlashPaper would be okay too.

  • Problems defining the datasource with coldfusion 9

    I just upgraded Macromedia MX7 with coldfusion 9. The local host was http://localhost:8500/ows. I am not sure if this address is the same for coldfusion 9. When I try to define the datasource, I still see Macromedia MX7 instead of coldfusion 9 in administor and I cannot proceed to Login because of the URL "http://127.0.0.1:8500/CFIDE/administrator/index.cfm", and a I get a message "the page cannot be displayed" Please HELP. Thanks, Conabre

    It sounds to me like you might have done a parallel install rather than an upgrade?
    Is there anything in your filesystem that looks like a CF9 install?
    What steps did you follow to perform the upgrade?
    If it's just a local machine, it might be quicker to not bother to work out what happened, and just install CF9 and migrate your stuff across to it, rather than doing an inline upgrade.  I have to concede I had such poor luck trying to upgrade CF in the past I abandoned it as a practice and always did a deinstall / resinstall rather than an upgrade.
    Adam

  • Creating dynamic datasources. Is this possible?

    Can I create a 'subset datasource' from an existing datasource
    and then pass this subset datasource to the <jbo:RowsetIterate>
    Let's assume I have a datasource containing 100 records.
    How is is possible to create a new datasource from the exiting datasource
    which will contain 10 records and then this new data source will be passed
    to <jbo:RowsetIterate>?
    I'd like to write a JSP Tag which reads the datasource and creates a subset datasource
    dynamically
    public class SubsetDS extends TagSupport
         public int doStartTag() throws JspException
            ApplicationModule am  = dataSource.getApplicationModule();
            ViewObject vo = am.findViewObject("V0");  
             while(vo.hasNext()){
            Row r = vo.next();
                   // Iterate based on a certain condition and put the new records
            // in a dynamically created DataSource
    Is this possible?

    I don't know about the custom JSP tag part, there is a <jbo:CreateViewObject> tag and ApplicationModule.createViewObject() methods for defining ViewObjects at runtime. We were not able to locate a mechanism for actually running a query against one VO to select rows for a second VO (whether defined at compile-time or runtime). We created a VO at runtime so we could base it's result set on another VO.
    See "Ways to Add a View Object Instance to the Data Model at Runtime" topic in JDev help (we're using 10.1.2, but there's a <jbo:CreateViewObject> tag going back to at least 9.0.3.3); I located using JDev's Help's text search for createviewobject.
    In our case, because the two queries were related (subset), we obtained the where clause from the VO that we defined at compile-time and whose where clause is being set at run time by values passed in from an HTML query form. We then applied that where clause to the dynamically created VO to get the desired subset.
    Hope that gives you a starting place and helps.

  • Filtering results based on dynamic date in coldfusion and access database

    Hello Guys, i am using a cfquery and am trying to return results based on date. the idea is to return entries that are less than or equal to date but am not getting any results but when i change to greater than or equal to i get the all results in databse which is wrong.
    Below is my code. is there something am doing wrong? Please help.
    <cffunction name="getBal" access="remote">
    <cfargument name="ID_biodata" type="string" required="true">
            <cfargument name="quater" type="string" required="true"/>
            <cfargument name="datePaid" type="date" required="true"/>
            <cfquery name="qBal" datasource="bond100">
    SELECT ID_biodata, quater, datePaid, amountPaid, manFees
    FROM collections
    WHERE datePaid <= <cfqueryparam cfsqltype="cf_sql_timestamp" value="#parseDateTime(arguments.datePaid)#">
                AND ID_biodata = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.ID_biodata#">
                AND quater = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.quater#">
                ORDER BY datePaid
    </cfquery>
            <cfquery dbtype="query" name="results">
            SELECT SUM(CAST(amountPaid as INTEGER) + CAST(manFees as INTEGER)) AS totalPaid
                FROM qBal           
            </cfquery> 
            <cfreturn results />
        </cffunction>

    Turn on debugging so that you can see what ColdFusion is sending to your database server.
    The debug info will show the SQL statement with query parameter values below it.
    Cheers
    Eddie

  • Create Dynamic Structure at Runtime via ALV-Methods!

    Hi Experts,
    i try to create at the ABAP Runtime a new Structure.
    FOR EXAMPLE: I have a internal Table "database" and i dont know their Structure or Typ.
    MY Question: How can i get the structuretype for this internal Table "database" ??
                                    I thought that it is possible with ALV-Methods, but i dont find the right way.
    First Step:       I must get the structure of this internal Table.
    Second Step: I must create a workarea/ line of this internal Table, that i can work row for row with the table.
    Have someone an code example for me, because iám very confused about this Problem.
    With kind regards.
    Ersin Tosun

    Hello,
    For this specific requirement, SAP has provided RTTI class.
    Below is a code snippet for your ready reference. In this example we're trying to get the structure of the dynamic table <ITAB> whose structure is not defined till run-time.
    TYPE-POOLS: abap.
    PARAMETERS: p_table TYPE tabname.
    DATA: dref TYPE REF TO data.
    FIELD-SYMBOLS <itab> TYPE STANDARD TABLE.
    CREATE DATA dref TYPE STANDARD TABLE OF (p_table).
    ASSIGN dref->* TO <itab>.
    DATA: go_tab_descr TYPE REF TO cl_abap_tabledescr,
          go_struc_descr TYPE REF TO cl_abap_structdescr,
          wa_comp TYPE abap_compdescr.
    go_tab_descr ?= cl_abap_tabledescr=>describe_by_data( <itab> ).
    CHECK sy-subrc = 0.
    go_struc_descr ?= go_tab_descr->get_table_line_type( ).
    LOOP AT go_struc_descr->components INTO wa_comp.
      WRITE: / wa_comp-name.
    ENDLOOP.
    I must create a workarea/ line of this internal Table, that i can work row for row with the table.
    Sorry i missed the Step 2:
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
                   <wa> TYPE ANY,
                   <val> TYPE ANY.
    LOOP AT <itab> ASSIGNING <wa>.
      LOOP AT go_struc_descr->components INTO wa_comp.
    *   To access the components of the structure dynamically
        ASSIGN COMPONENT wa_comp-name OF STRUCTURE <wa> TO <val>.
      ENDLOOP.
    ENDLOOP.
    BR,
    Suhas
    Edited by: Suhas Saha on Nov 18, 2010 7:26 PM

  • 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

Maybe you are looking for