Creating a dynamic style font with live cycle desginer ES 8.2

Can I control dynamicly the style (Italic) and the weight (bold) of  text in a  dynamic pdf form ( imade it with livecycle designer ES 8.2) that gets its  data from an XMl file.

Hi,
A lot of the information you need is in Adobe's scripting guide http://www.adobe.com/go/learn_lc_scriptingReference  Also there is a very useful Adobe guide to Calculations and Scripts (and while it is for version 6 it is still very good because of the way it is laid out) http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
The Javascript could be used in the Layout: Ready event.
For italic font:
if (...some test...)
     this.font.posture = "italic";
else
     this.font.posture = "normal";
For bold font:
if (...some test...)
     this.font.weight = "bold";
else
     this.font.weight = "normal";
The script will change the font for the complete field. I don't think you can change parts of a field.You can also change font colour and font type (the guides above will help).
Good luck,
Niall

Similar Messages

  • How to create a dynamic table region with dynamic VO

    Hi All,
    I have a requirement to create a dynamic table region with a dynamic VO.
    I need this because at runtime only the user will select the table name. So based on that table name, i have to create a table region to display the records.
    I already created a dynamic VO. Could anyone share the code for dynamic table region creation.
    Thanks in Advance.
    Thanks and Regards,
    Myvizhi

    Hi All,
    I have a requirement to create a dynamic table region with a dynamic VO.
    I need this because at runtime only the user will select the table name. So based on that table name, i have to create a table region to display the records.
    I already created a dynamic VO. Could anyone share the code for dynamic table region creation.
    Thanks in Advance.
    Thanks and Regards,
    Myvizhi

  • How to create a dynamic table region with dynamic VO in processFormRequest

    Hi All,
    I have a requirement to create a dynamic table region with a dynamic VO.
    I need this because at runtime only the user will select the table name. So based on that table name, i have to create a table region to display the records.
    I already created a dynamic VO. Could anyone share the code for dynamic table region creation.
    Thanks in Advance.
    Thanks and Regards,
    Myvizhi
    Edited by: Myvizhi Selvi on May 20, 2013 6:21 PM

    Hi,
    You can use following sample code to create advance table columns dynamically with colum groups as well.
    It assumes that you have already created advance table with ID EmpTblRN.
    Below code returns column heading dynamically and if you keep your VO column names and attributes
    same in all the cases (COL1, COL2.....) then you can easily use a loop to create advance table columns.
    It is attaching VO attributes to OAMessageStyledText bean in the last.
    Hope it helps.
    OAAdvancedTableBean advTable = (OAAdvancedTableBean)webBean.findChildRecursive("EmpTblRN");
    Serializable [] param = {currentWindowSeq.toString()};
    Datum[] colHeadingArray = (Datum[])am.invokeMethod("getColumnHeading", param);
    String oldGrpName = null;
    String newGrpName = null;
    OAColumnGroupBean columnGroup = null;
    DictionaryData columnFormat = new DictionaryData();
    columnFormat.put(WIDTH_KEY, "4%");
    for (int i = 0; i < colHeadingArray.length; i++)
    try
    oracle.sql.STRUCT os = (oracle.sql.STRUCT)colHeadingArray;
    Object[] colHeadAttr = os.getAttributes();
    newGrpName = (String)colHeadAttr[0];
    if(newGrpName!=null)
    if(!newGrpName.equals(oldGrpName))
    // Create a column group, create the set the column header,
    // and add the column group under the advanced table
    columnGroup = (OAColumnGroupBean)createWebBean(pageContext, COLUMN_GROUP_BEAN, null, "ColGroup"+i);
    OASortableHeaderBean columnGroupHeader = (OASortableHeaderBean)createWebBean(pageContext, SORTABLE_HEADER_BEAN, null, "ColGroupHeader"+i);
    columnGroupHeader.setText(newGrpName);
    // Retrieve from message dictionary
    columnGroup.setColumnHeader(columnGroupHeader);
    advTable.addIndexedChild(columnGroup);
    oldGrpName = newGrpName;
    // Create a column, create the set the column header, and add the column
    // under the column group
    OAColumnBean column1 = (OAColumnBean)createWebBean(pageContext, COLUMN_BEAN, null, "Column"+i);
    OASortableHeaderBean column1Header = (OASortableHeaderBean)createWebBean(pageContext, SORTABLE_HEADER_BEAN, null, "Column1Header"+i);
    column1Header.setText(colHeadAttr[1].toString());
    column1.setColumnHeader(column1Header);
    column1.setColumnFormat(columnFormat);
    columnGroup.addIndexedChild(column1);
    // Create the actual leaf item under the first column
    OAMessageStyledTextBean leaf1 = (OAMessageStyledTextBean)createWebBean(pageContext, MESSAGE_STYLED_TEXT_BEAN, null, "Leaf"+i);
    //OARawTextBean leaf1 = (OARawTextBean)createWebBean(pageContext, RAW_TEXT_BEAN, null, "Leaf"+i);
    leaf1.setViewAttributeName("Week"+(i+1));
    String destination = "OA.jsp?page=/xxqc/oracle/apps/per/leaveadvance/webui/EmployeeLeaveDetailPG&personId={@PersonId}";
    destination = destination + "&startDate="+colHeadAttr[1].toString()+"-"+(String)colHeadAttr[0];
    destination = destination + "&addBreadCrumb=Y&retainAM=Y";
    leaf1.setDestination(destination);
    OADataBoundValueViewObject cssjob = new OADataBoundValueViewObject(leaf1,"Color"+(i+1));
    //leaf1.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, cssjob);
    leaf1.setAttributeValue(UIConstants.RENDERED_ATTR, cssjob);
    column1.addIndexedChild(leaf1);
    catch(Exception e)
    System.out.println("e"+e);

  • Creating a dynamic web page with Dreamweaver CS6 academic version

    To create a dynamic web page with Dreamweaver CS6 academic version, setting up for testing server menu box just shows up and disappear. what is that issue?

    Anderson51 wrote:
    I'm new to this area ...  ...Like I said, I'm new and in way over my head - I think???? Help???
    Hmmm,
    I don't want to be the one to put you off.  I'm in over my head too but I really enjoy the pain of grappling with Dreamweaver.  It isn't really for the novice user and unlike any other app I know, it will be of greater benefit to those who have some knowledge of the underlying languages it deals with.  i.e. HTML, CSS and some others.  Strangely, I also hear from people that know the coding well, that they don't like/use/need Dreamweaver.
    If you only want one site, and don't really need to wrench your own unique identity from what you are doing, why not look at a free site from Wordpress.com?  I am sure you can use your own domain, and as you get proficient at it, you can expand what's there by paying for it.
    Just a thought
    Martin

  • Is there a program in CS6 that is compatible with Live Cycle?

    Is there a program in CS6 that is compatible with Live Cycle?

    Live Cycle products must be purchased separately. You can only view and partialyl edit the resulting PDFs in Acrobat/ Reader.
    Mylenium

  • Creating fillable forms with Live Cycle that can be emailed, saved, printed, etc. by anyone!

    So I started using livecycle because the forms one can make are astounding, its a great program except for sending the forms out to be filled in especially to those only with reader. I've looked over a lot of past discussions and the answers seemed too complicated. Here is a workaround for not so computer savy folks like myself.
    First, create your form, use everything the software has to offer to make your form exactly like you want and yes you can use the "submit by email button" that's what it's for.
    Second, once the form is complete one seemingly complicated step to fix the "attach as pdf instead of xml" if your form keeps attaching as "xml" if it already attaches as "pdf" then skip the rest of the "second step"
         go to the top and click the "view" menu, then select "xml source"
         then go back to top and click the "edit" menu then select "find"
         type "xml" without the quotations and keep clicking "find next" until you see the "submit" line (eg. <submit format="xml")
         change the "xml" to "pdf"then go back to the "design view column" if you get a "parts of this or that cannot be whatever" message just click ok or ignore
    Third, assumming you used the "submit by email" button like you should be the find that button and click the center somewhere, too the right a "field" box comes up
         enter your own email address, you can enter an stock email subject to or leave it blank
         also, a bit further down it says "presence" then "visible" I like to change "visible" to "visible (screen only)" this way it does not show on the printed version. That is one of the things i like the most about this program, you can put text boxes, signature boxes, any kind of
              box and make it visible, visible only on print, only on screen, etc. you just have to play around. It's nice to put a large text box with instructions for how the person should fill out and what to do that helps them and doesn't show up on print.
    Ok, the above is a lot of words but if you print it out and follow step by step you'll see how easy it is and after a couple runs you won't have to look at your cheat sheet again.
    Fourth, So, it was easy to figure out how to make a form the frustrating part was sending it out to be filled in save, printed whatever then sent back to me (now you). the problem is, the form has to be distributed to be approved so to speak. If it is just for one person that is no big
         deal, just first click "file" "save as" give it a name it reverts into adobe pro and asks how you would like to distribute, follow the instructions you send it to whomever you like they fill it out and submit it back because your email address is linked to the "submit as
         email" button. But what if its just a form you want on the company share drive anyone can open fill out, save, send to you or send to someone else, that's where it's tricky.
    Fifth, Distributing to yourself so you can approve the form for world wide dissemination.
         Same procedure as above for the single recipient but instead of sending to someone else you send it back to yourself by entering your own email address again when it asks "how would you like to distribute your form--same as above"
         click "send now via email" enter your address they will return it to (but it's not they this time its really yourself)...follow the instructions, specifiy a generic folder that will collect data (you can delete later, you don't have to collect data unless you want)
         put in your email address as the recipient. change the stock email subject and message if you'd like, then click done, it will email you the form. close out the live cycle and adobe programs and go to your inbox (may take a min)
    Sixth, open your attachment.(no remember you submitted the form to yourself but think of yourself as someone else like a customer) when the form is open you can enter stock fields if you like or do nothing...click the submit by email button, follow the instructions and s
         send it back to yourself again (don't get confused...it's really you as the customer sending back to yourself as the owner of the form) if you are a criminal think of it as like "laundering money through a bank" you are laundering the form through your own email system
         close out the form and go to your inbox again an open the returned form. now when you open it there is something new. there is a box that says "this file is a completed form (even though you didn't enter any data---it's a laundered form now) and leave it on the
         "add to existing data set" which is the one you created earlier in the generic folder....click "ok", now the form changes once again, there is a new look to the top, don't worry about it just go to the top right of the form and click on "options" then "save file as" give it
         a name again and remember where you saved it to. then close adobe and say yes when it asks you if "you want to save changes to your data set"....say yes!!
    7th, forget the data set, no longer is important...find the form you saved and open it. go to the top and click the "advanced" button then "enable user rights in adobe reader" then click "save now" this is the final form so name it appropriately and place it where you want
         people to find it, they can now open, fill out, print, save as, email, whatever. The only downside is if they use the submit by email it automatically defaults to your email but when their email client opens they can delete your address and put someone else if they want.
    thats it...lots of words but it really is easy after you do it a couple of time. the final downside, if the final form works but you decide to change anything on it with LiveCycle, you have to go back through all the steps or it will tell whoever opens it in reader that the original
         has change and they cannot do anything with it, but it's ok, make your changes or improvement, by now you are an expert at laundering live cycle forms, take you 5 min, no worries!
    Happy Laundering!!
    Sean
    NOTE: this procedure only validated with LiveCycle 8.0

    Here is the window you will see when you choose Enable Usage rights.
    Note: That means that you can not edit any content once USAGE Rights are envoked.
    So you must make sure all corrections to documents made and perfect before Envoking rights.

  • Create OMR with Live Cycle ES

    Hi everybody,
    I've wondered if there is a possibility to integrate OMR (optical mark recognition) function from Adobe Live Cycle Production Print ES into Live Cycle ES.
    kind regards
    Michael

    No, you could not integrate a function between LCPP and LC Output.
    LCPP is not a j2ee application so the inter-process communication is simply not there.
    If you need OMR in LC Output I'm afraid you will have to code it into the form file in LC Designer. LCPP has the capability built into it's post processing feature set.

  • Fdf format should work with pdf's made with Live Cycle Designer!!!

    using: Adobe Acrobat Professional 8.0; Windows XP.
    I have need to take data from a SQL database and display that data on various forms that were created by a city Agency, the DOB. Some of the forms were created using Adobe Acrobat version 6. For those forms I am able to create an .fdf file and open the associated pdf by using a run statement in my prorgramming language. This is very nice. The fdf format is easy to recreate, and the run statement opens the pdf with the data displayed automatically, WHICH IS MY DESIRED END RESULT!!! Users click a button in my program, they get a form with the data on it.
    Now the DOB has created new PDF forms that were made using Live Cycle Designer. Much to my suprise, documents create by the designer cannot handle the fdf data format, just xml. This is a real problem for someone trying automatically populate a pdf from data collected not using the form itself. The xml data format cannot automatically open the document and populate the form data the way the fdf does. I spoke with tech support and they had no answer for me but to recreate the forms. That will take me days.
    It is hard for me to understand why you would create a tool such as Live Cycle Designer that prevents a user such as I from using all of the features of your Adobe Acrobat Professional 8.0 product. Very suprising.

    You might ask about this in the regular forum. There are several form experts there that may be able to help you.

  • Creating a dynamic nested menu with xml data received from a webservice

    I need to create a dynamic menu based on a xml returned by a webservice.
    the xml comes basically in this format:
    [quote]
    <resposta>
        <status>Success</status>
        <mensagem>Whatever</mensagem>
        <dados>
            <projeto nome="name" cliente="client name">
                <atividade nome="name">
                    <etapa>
                        <nome>name</nome>
                         <other_attributes>...</other_attributes>
                    </etapa>
                    (other etapas)
                 </atividade>
                 (other atividades)
            </projeto>
            (other projetos)
        </dados>
    </resposta>
    [/quote]
    What I need is to create a menu like:
    - Projeto.Nome - Projeto.Cliente:
        - Atividade.nome:
            (start button) etapa1
            (start button) etapa2
    - Projeto2.Nome - Projeto2.Cliente:
        - Atividade.nome:
            (start button) etapa1
            (start button) etapa2
    And so on...
    I've tried using an HTTPService and a DataGroup, this code above works fine for  display the projeto's names:
    [quote]
    <s:HTTPService id="loginService"
                            url="http://timesheet.infinitech.local/services"
                            method="POST" contentType="application/xml"
                            result="handleLoginResult();"
                            fault="handleFault(event);" >
                            <s:request xmlns="">
                                <requisicao>
                                    <tipo>login</tipo>
                                    <usuario>{campoUsuario.text}</usuario>
                                    <senha>{campoSenha.text}</senha>
                    </requisicao>
                </s:request>
    </s:HTTPService>
    and the DataGroup:
    <s:DataGroup dataProvider="{tarefasService.lastResult.resposta.dados.projeto}" width="100%" y="100" x="20"
                         includeIn="Principal">
                <s:layout>
                    <s:VerticalLayout />
                </s:layout>
                <s:itemRenderer>
                    <fx:Component>
                        <s:ItemRenderer>
                            <s:layout>
                                <s:HorizontalLayout />
                            </s:layout>
                            <s:Button />
                            <s:Label text="{data.nome}" />
                        </s:ItemRenderer>
                    </fx:Component>
                </s:itemRenderer>
            </s:DataGroup>
    [/quote]
    I have then tried including another datagroup inside the datagroup item renderer, but I just couldn't get it to work anyway, and tried it in a lot of ways... (basically, it would be a datagroup with dataProvider={data.atividade}).
    Can anyone tell me how to get this to work?
    I've uploaded an example xml, you can use it as the url for the HTTPService:
    http://www.pdinfo.com.br/example.xml
    Thanks in advance.

    Hi,
    A lot of the information you need is in Adobe's scripting guide http://www.adobe.com/go/learn_lc_scriptingReference  Also there is a very useful Adobe guide to Calculations and Scripts (and while it is for version 6 it is still very good because of the way it is laid out) http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
    The Javascript could be used in the Layout: Ready event.
    For italic font:
    if (...some test...)
         this.font.posture = "italic";
    else
         this.font.posture = "normal";
    For bold font:
    if (...some test...)
         this.font.weight = "bold";
    else
         this.font.weight = "normal";
    The script will change the font for the complete field. I don't think you can change parts of a field.You can also change font colour and font type (the guides above will help).
    Good luck,
    Niall

  • Adobe Acrobat  X1 Pro- cannot edit a PDF we created. It says to use Live Cycle, Does this Adobe subscirption not include Live Cycle? The earlier version of Adobe did.

    Cannot edit a PDF we created in Adobe Acrobat X1 pro. The form tells use to use Live Cycle to edit. Does the X1 subscription not include Live Cycle? Our earlier versions of Adobe did include Live Cycle

    No. You have to purchase LCD separately now.
    On Mon, Apr 13, 2015 at 5:23 PM, celestes5673329 <[email protected]>

  • Problem with creating an dynamic internal table with only one field.

    Hi,
    i create an internal table like this:
    FIELD-SYMBOLS: <GT_ITAB>      TYPE TABLE,
                   <GS_ITAB>,
                   <FS>.
    DATA: GT_DATA TYPE REF TO DATA.
    DATA: GS_DATA TYPE REF TO DATA.
    DATA: TABNAME   LIKE DD03L-TABNAME.
    DATA: FIELDNAME LIKE DD03L-FIELDNAME.
    DATA: TBFDNAM   TYPE TBFDNAM VALUE 'LFA1-NAME1'.
    SPLIT TBFDNAM AT '-' INTO TABNAME FIELDNAME.
    CREATE DATA GT_DATA TYPE TABLE OF (TABNAME).
    ASSIGN GT_DATA->* TO <GT_ITAB>.
    CREATE DATA GS_DATA  LIKE LINE OF <GT_ITAB>.
    ASSIGN GS_DATA->* TO <GS_ITAB>.
    SELECT * FROM (TABNAME) INTO CORRESPONDING FIELDS OF TABLE <GT_ITAB>.
      BREAK-POINT.
    it works OK.
    Now i want to create an internal table not like LFA1 but with LFA1-NAME1 Field TBFDNAM.
    It's not only LFA1-NAME1 it shell be the value of TBFDNAM.
    When i change
    CREATE DATA GT_DATA TYPE TABLE OF (TABNAME).
    to
    CREATE DATA GT_DATA TYPE TABLE OF ( TBFDNAM).
    i get an shortdump.
    Any idea?
    Regards, Dieter

    Hi Dieter,
    Your approach is ok, but it will create dynamic table without a structure of NAME1. Only the line type will be suitable (but field name will not exists -> hence the error in the select statement).
    In this case you need to create a dynamic table which structure consists of one field named NAME1.
    This code is the appropriate one:
    " your definitions
    DATA: tabname LIKE dd03l-tabname.
    DATA: fieldname LIKE dd03l-fieldname.
    DATA: tbfdnam TYPE tbfdnam VALUE 'LFA1-NAME1'.
    FIELD-SYMBOLS <gt_itab> TYPE table.
    "new ones
    DATA: it_fcat TYPE lvc_t_fcat WITH HEADER LINE.
    DATA: gt_itab TYPE REF TO data.
    " get table and fieldname
    SPLIT tbfdnam AT '-' INTO tabname fieldname.
    " create dynamic table with structure NAME1 (only one field)
    it_fcat-fieldname = fieldname.
    it_fcat-tabname = tabname.
    APPEND it_fcat.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = it_fcat[]
      IMPORTING
        ep_table                  = gt_itab
      EXCEPTIONS
        generate_subpool_dir_full = 1
        OTHERS                    = 2.
    CHECK sy-subrc = 0.
    " dereference table
    ASSIGN gt_itab->* TO <gt_itab>.
    " insert data only to NAME1 field
    SELECT * FROM (tabname) INTO CORRESPONDING FIELDS OF TABLE <gt_itab>.
    I checked, this works fine:)
    Regards
    Marcin

  • How to create an dynamic internal table with the structure of a ddic table

    Hi all,
    I want to fill ddic-tables (which I already created) in my abap dictionary with data out of CSV-files (which are located on the CRM-Server).  The ddic tables have different amount of fields.
    I started with creating a table which contains the name of the tables and the path to the matching CSV-file.
    At the beginning I'm filling an internal table with part of this data (the name of the ddic-tables) - after that I am looping at this internal table.
    LOOP AT lt_struc ASSIGNING <lfs_struc>.
         LOOP AT lv_itab1 INTO lv_wa1 WHERE ztab_name = <lfs_struc>.
         lv_feld = lv_wa1-zdat_name.
        ENDLOOP.
        CONCATENATE 'C:\-tmp\Exportierte Tabellen\' lv_feld INTO lv_pfad.
        Do.
        OPEN DATASET lv_pfad FOR INPUT IN TEXT MODE ENCODING NON-UNICODE IGNORING CONVERSION ERRORS.
        READ DATASET lv_pfad INTO lv_rec.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        enddo.
        REPLACE ALL OCCURRENCES OF '"' IN lv_rec WITH ''.
        SPLIT lv_rec AT ';' INTO TABLE lt_str_values.
        INSERT into (<lfs_struc>) values lr_str_value.
        CLOSE DATASET lv_pfad.
    endloop.
    This is not the whole code, but it's working until
    SPLIT lv_rec AT ';' INTO TABLE lt_str_values.
    I want to split all the data of lv_rec into an internal table which has the structure of the current ddic-table, but I didn't find out how to do give the internal table the structure of the ddic-table. In the code I used an internal tyble type string but I should be the structure of the matching tabel.
    If I try to create an internal table by using a fiel symbol, I am told, that the data types are not matching.
    Has anyone an idea?

    Hi Mayari,
    though you were successfull with
    METHOD cl_alv_table_create=>create_dynamic_table
    I must warn you not to use it. The reason is that the number of tables created is limited, the method uses GENERATE SUBROUTINE statement and this triggers an unwanted database commit.
    If you know the DDIC structure, it is (starting with ECC6.0) much easier:
    field-symbols:
      <table> type standard table.
    data:
      lr_data type ref to data.
    Create data lr_data type table of (<DDIC structure>).
    assign lr_data->* to <table>.
    The split code can be simplified gaining speed loosing complexity not loosing functionality.
    field-symbols:<fs_s> type any.
    field-symbols:<fs_t> type any.
    SPLIT lv_rec AT ';' INTO table it_string.
    loop at it_string assigning <fs_s>.
      assign component sy-tabix of wa_string to <fs_t>.
    if sy-subrc = 0.
      <fs_t> = <fs_s>.
    endif.
    at last.
      append <fs_itwa3> to <ft_itab3>.
    endat.
    endloop.
    Though it may work as Keshav.T suggested, there is no need to do that way.     
    Regards,
    Clemens

  • How to specifiy the provider to be Oracle.ManagedDataAccess.Client when creating a dynamic connection string with EF Code First from Database?

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

    I am trying to use the relatively new Code First from Database with the newest EF (6.x) and on an Oracle database (11g, but I have installed the newest ODTwithODAC). First of all, it works fine as long as the connection string is inside the App.Config file. But when I try to build it dynamically in the C# code (or rather, statically at the moment) it fails. I have it working with a dynamically built connection string when doing Model from Database though, so I'm at a loss right now.
    First, I have created a second constructor for the context class that takes a string and does base(connectionString). Then I build the connection string via
    OracleConnectionStringBuilder oracleBuilder = new OracleConnectionStringBuilder();
    oracleBuilder.DataSource = "TEST.BLA.COM";
    oracleBuilder.UserID = "ABC";
    oracleBuilder.Password = "abc";
    oracleBuilder.PersistSecurityInfo = true;
    string connection = oracleBuilder.ToStrin();
    Now trying to open an EntityConnection by giving to it this provider-specific connection string (or even the static one from the App.Config) doesn't work; I get "keyword not supported: user id"). Trying it by creating a context and giving this connection string doesn't work either. I'm pretty sure that this is because I didn't specify the provider to use; after all, it should use the Oracle.ManagedDataAccess.Client provider and not an SQL Server based one.
    I then tried to get around this by using an EntityConnectionStringBuilder on top and specifying the provider keyword there, but then I get "keyword not supported: provider" when using it in the context constructor, and "the 'metadata' keyword is always required" when using it with the EntityConnection constructor.
    As I said above: I bet it's the provider that I have to specify somehow, but I don't know how. The code that does work is the following:
    using (var context = new Model())
    context.Database.Connection.Open();
    context.Database.Connection.Close();
    When I read context.Database.Connection.ConnectionString, it is exactly the provider-specific connection string I created above, but I don't know where to specify the provider again. Do you know of any way to do this? Certainly there must be one.
    PS: I have also posted this question on http://stackoverflow.com/questions/27979454/ef-code-first-from-database-with-managed-oracle-data-access-dynamic-connection because it is quite urgent and I'd like to use Code First from Database. Otherwise I'd have to go "back" to using Model from Database again, which is not ideal because we have updatable views where the .edmx-file has to be edited after every reload of the model, while with Code First from DB inserting into the view automatically works.

  • How to create a dynamic table (repeating) with static header?

    Hello
    My purpose is to create a table which should be dynamically filled at runtime depending on the number of elements in the datasource($record.list). If the list is empty, the table shouldn't be displayed at all.
    I created a subform which holds a table, ticking "Repeat Subform for each data item" and I set the binding of the table elements to $record.list[*].myelement. This works fine so far.
    For the table header I created a second subform with a table having exactly the same size like the other table with text fields that contain the table header texts.
    My problem now is that I would like to control the display of the subform which serves as table header row depending on whether $record.list is empty or not.
    What's the best way to do this? How can I have access to the datasource for a form?
    Thank you very much for your help!!!
    Best regards
    Bettina Hepp

    Hi,
    Instead of creating the header row outside the table.
    Create it inside the same table as header row.
    So when you create a condition then automatically applicable for the header row also.
    This is the best option.
    Regards,
    sasi

  • How to create a dynamic screen (play with containers !) ?

    Hello,
    Here is the screen I want to do (one splitter with two containers) :
    |                               
    |    | button 1 |          | button 2 |             
    |________________________________________
    |                                                                          
    |                                                                          
    |         My_container                            
    |                                                                          
    |________________________________________
    I would like to perform these actions :
    - click on button 1 : an ALV (cl_gui_alv_grid) is displayed in "my_container"
    - click on button 2 : an html document (CL_DD_DOCUMENT) is displayed in "my_container"
    The first action is always a success : if I click on button 1 or 2 the corresponding object is correctly displayed in my container.
    But the second action always failed if I click on another button : nothing happens.
    Example :
    1- I click on button 1 : my alv appears
    2- I click on button 2 : nothing happens, I can see that contents of my containers have been changed (in debug) but my screen is not updated.
    I tried to free my container with call method or "free" instruction but it's not working.
    Do you have any idea ?
    I can send my code if it could help.
    Thanks,
    Simon
    Edited by: Simon Desbonnets on Dec 1, 2010 9:20 AM

    Hello,
    Ok here is another code : one docking container with two buttons. One click on a button update the main screen to show either an alv, either a cl_dd_document (I used your code, you could be able to run it quickly):
    First part : class, perofrms and declarations :
    DATA: it_sbook      TYPE TABLE OF sbook,
          it_sflight    TYPE TABLE OF sflight,
          alv          TYPE REF TO cl_gui_alv_grid,
          doc_container TYPE REF TO cl_gui_custom_container,
          document      TYPE REF TO cl_dd_document,
          docking               TYPE REF TO cl_gui_docking_container.
    *       CLASS cl_my_event_handler DEFINITION
    CLASS cl_my_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_submit_buttons FOR EVENT clicked OF cl_dd_button_element
                                                           IMPORTING sender.
    ENDCLASS.                    "cl_my_event_handler DEFINITION
    *       CLASS cl_my_event_handler IMPLEMENTATION
    CLASS cl_my_event_handler IMPLEMENTATION.
      METHOD handle_submit_buttons.
        CASE sender->name.
          WHEN 'BUT1'.
            CALL METHOD doc_container->set_visible
              EXPORTING
                visible = 'X'
              EXCEPTIONS
                OTHERS  = 3.
            CALL METHOD alv->set_visible
              EXPORTING
                visible = space
              EXCEPTIONS
                OTHERS  = 3.
          WHEN 'BUT2'.
            CALL METHOD doc_container->set_visible
              EXPORTING
                visible = space
              EXCEPTIONS
                OTHERS  = 3.
            CALL METHOD alv->set_visible
              EXPORTING
                visible = 'X'
              EXCEPTIONS
                OTHERS  = 3.
        ENDCASE.
      ENDMETHOD.                    "handle_submit_buttons
    ENDCLASS.                    "cl_my_event_handler IMPLEMENTATION
    DATA: my_handler TYPE REF TO cl_my_event_handler.
    *&      Form  create_ctrl_panel
    *       Create 2 buttons in the docking container
    FORM create_ctrl_panel .
      DATA button1 TYPE REF TO cl_dd_button_element.
      DATA button2 TYPE REF TO cl_dd_button_element.
      DATA : dd_doc_btn TYPE REF TO cl_dd_document,
             form_btn TYPE REF TO cl_dd_form_area.
      CREATE OBJECT dd_doc_btn.
      CALL METHOD dd_doc_btn->add_form
        IMPORTING
          formarea = form_btn.
      CALL METHOD form_btn->add_button
        EXPORTING
          label  = 'Button 1'
          name   = 'BUT1'
        IMPORTING
          button = button1.
      SET HANDLER my_handler->handle_submit_buttons FOR button1.
      CALL METHOD form_btn->add_button
        EXPORTING
          label  = 'Button 2'
          name   = 'BUT2'
        IMPORTING
          button = button2.
      SET HANDLER my_handler->handle_submit_buttons FOR button2.
      CALL METHOD dd_doc_btn->merge_document.
      CALL METHOD dd_doc_btn->display_document
        EXPORTING
          parent             = docking
        EXCEPTIONS
          html_display_error = 1
          OTHERS             = 2.
    ENDFORM.                    " Create_ctrl_panel

Maybe you are looking for