Creating View Object with different criteria

Hi,
I have a requirement to execute the following queries in the application logic. We have YEAR table with mileage rates with different effective dates. If the service date is greater than any of the existing effective dates we need to get the rate with that effective date. if the service date is less than the existing effective dates, then we have to get the rate with least effective date.
SELECT mileage_rate, ... FROM year
WHERE eff_date =  (SELECT MAX(eff_date) FROM   year WHERE  eff_date <= :bServiceDate)
SELECT MILEAGE_RATE, .... FROM YEAR WHERE
EFF_DATE =  (SELECT MIN(EFF_DATE) FROM YEAR)
We have to execute the 1st query and if there is no matching records then we have to take the second query with min effective date. At present we are creating two view objects for the above scenario. Is there any possibility to create one view object with different criteria. What is the best solution to handle the above problem in ADF.
Thanks and Regards,
S R Prasad

Well on the ViewObjectImpl you can fire the method getQueryHitCount() passing in the required ViewRowSetImpl. If you get the query hit count as 0, use can attached the other query and execute it.

Similar Messages

  • BC4J: problems creating view object with multiple entity objects

    Hi,
    I working with a view object which contains two entity objects with parent-child relationship like this:
    ViewObject - ParentEntityObject - PId
    PAttribute
    CId (FK)
    (- ParentChildAssociation)
    - ChildEntityObject - CId
    - CAttribute
    The 'Read Only' and 'References' options are checked for the association in the view object.
    I'm creating a new row using this view object. The parent object should be created new and the child object already exists in the database, so I'm setting only the attributes of the parent object (including foreign key).
    After creating the row I display it in a jbo:DataTable and only those attributes coming from the parent object are displayed. The attributes of the child object are not set. After a commit all attributes appear.
    The problem is, that I want to display the new row with all attributes to the users BEFORE they commit.
    I tried to set the child attributes, but they are read only by definition and even when I unchecked the 'Read Only' option and set the attributes to 'Always Updateable' in the view object it is giving me
    JBO-27008: Attribute set for CAttribute in view object ViewObject failed.
    Is there a way to make all attributes of the child object visible in the view object without committing changes?
    (JDev 9.0.2.822)
    Any help would be appreciated.
    Regards,
    Christian

    Once again the structure, sorry.
    ViewObject
    |-ParentEntityObject
    ..|-PId
    ..|-PAttribute
    ..|-CId (FK)
    |-ParentChildAssociation
    |-ChildEntityObject
    ..|-CId
    ..|-CAttribute
    Christian

  • How to create View Object with Multiple Updatable Entity Objects

    I want both the entities in the view object to support creating new rows but when i give create insert it allows to insert only on the parent and not the child. I found this link
    http://docs.oracle.com/cd/E21043_01/web.1111/b31974/bcadvvo.htm#CEGCAJCI which overrides the exiting classes. but i would like to do it declarative . Is there any other way to do it?
    I am using Jdeveloper 11g version 2.
    Thanks in advance,
    Rakesh

    But when i tried to add a new row it showed this error
    oracle.jbo.AttrValException: JBO-27014: Attribute LookupTypeId1 in FoundationModuleAM.VikLookupTypeBaseVO is required.
         at oracle.jbo.server.JboMandatoryAttributesValidator.validate(JboMandatoryAttributesValidator.java:224)
         at oracle.jbo.server.EntityDefImpl.validate(EntityDefImpl.java:3095)
         at oracle.jbo.server.EntityCache.validate(EntityCache.java:3599)
         at oracle.jbo.server.EntityImpl.validateEntity(EntityImpl.java:2285)
         at oracle.jbo.server.EntityImpl.validate(EntityImpl.java:2464)
         at oracle.jbo.server.DBTransactionImpl.validate(DBTransactionImpl.java:4515)
         at oracle.insurance.viking.foundation.model.common.VikingDBTransactionImpl.validate(VikingDBTransactionImpl.java:46)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2008)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
         at oracle.insurance.viking.foundation.model.common.VikingDBTransactionImpl.commit(VikingDBTransactionImpl.java:37)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
         at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
         at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
         at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  • Create View Object programattically from XML input

    Hi,
    I have requirement to create view object from xml at run time in ADF application. is there any way to create view object dynamically in java program from xml?
    My requirement is to call a webservice and generate view object from the response of the web service call.
    Thanks

    I want to create view objects from different web services and the same will be available to the developer at the time of development. I don't want to create web service proxies for each of the web service. this will simplify the developers task to create proxy and data controls. the one thing developer has to do is select the service and base on the service the view objects will be created to develop pages accordingly.

  • View object with bind variables in subqueries

    Hi,
    i create view object with this query:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    My binding style is oracle named.
    Then I add the bind variables:
    p_cuit this is the only required
    p_ndoc
    p_deno
    but when i run the app module with p_cuit = 20123456780 i get this error:
    (oracle.jbo.SQLStmtException) JBO-27122: Error SQL durante la preparación de la sentencia. Sentencia: Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    ----- Nivel 1: Detalle 0 -----
    (java.sql.SQLException) Falta el parámetro IN o OUT en el índice:: 3
    How can i do this ?
    thanks.

    Thanks! that's right the bind variables when i use it on where clause must be required, so i change my sql to:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit <> 0 )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = decode(:p_deno,'null',null,upper(:p_deno)) or
    :p_deno = 'null')
    AND (NDOC = decode(:p_ndoc,0,null,:p_ndoc) or
    :p_ndoc = 0)
    and grado_confiab > 0
    and my bind variables:
    p_ndoc required default value 0
    p_cuit required default value 0
    p_deno required default value null
    and works ok!
    thanks a lot !!!!

  • Creating a .pdf with different page views

    I'm tyring to create a .pdf with different page views.  For example as the viewer goes through the .pdf some pages I would like viewed as "single page view" and others "two page view".  Is this possible?   I'm working with Adobe Acrobate Pro.  Thanks for any suggestions.

    It's possible to use the Page Open actions to trigger a view mode change but it's messy - if the user tries to override them because they prefer to zoom in, etc. then they'll get very annoyed when things keep resetting.
    To create a Page Open action, open the thumbnails panel, right-click on a page, choose Page Properties, then the Actions tab. You can use the Execute a Menu Item tool to fire one of the view modes.

  • Is it possible to create 2 Date objects with different hashcode.

    Hi,
    I want to create 2 java.util.Date objects with different hashcodes. Is it possible??
    Regards,
    Farooq

    import java.util.Date;
    import java.util.Calendar;
    public class TwoDates {
        public static void main(String[] args) {
            Calendar oneCal = Calendar.getInstance();
            oneCal.set(Calendar.YEAR, 1903);
            Calendar anotherCal = Calendar.getInstance();
            Date oneDate = oneCal.getTime();
            Date anotherDate = anotherCal.getTime();
            System.out.println(oneDate.hashCode() + " " +
                               anotherDate.hashCode());
    -14330615 -825112150

  • Is it posible to create objects with different names dinamically?

    Hi,
    I'm creating an app that manages different wireless nodes in a network and I was thinking that I could create a class called Node which would have a constructor that every time I created an object Node, I would pass the address and some other data about the Node and the constructor will save all that data and also create a unique ID for every Node object.
    Now the problem is that I need to be able to discover all the nodes in my network every time the user clicks a Ping button. So every time the users clicks Ping I need to do a ping and create as many Node objects as nodes I have in my network. The thing is I don't know how to make it create the node objects with different names so after I've created all the nodes objects I can refer to one of them.
    Something like this.
    int Id=0;
    id++;
    Node node+Id = new Node();
    I think its not possible to do something like that. If it isn't how can I do to refer to one of the objects I've created?
    Thanks.

    Twistx77 wrote:
    Thanks to both of you. I'll check out the Link and if I can't find the solution there I'll make the array , I don't know how I didn't think about doing that. There are two collections you should study specifically:
    First you have the ArrayList which in essense is a growable array. This means you don't have to decide in advance how big it can be.
    Second there's the HashMap. It's sometimes called an associate array. Such an array doesn't have fixed position indexes like an ordinary array. Instead each index (called key) is associated with a value but the keys don't have any particular order. Still, given a certain key, finding the corresponding value in a HashMap is almost as fast as an array access.

  • Is it possible to create a Synonym with different column names

    Hi,
    I want to create a Synonym with different columns names (Columns not in original table) . I am not sure if this can be done . Any suggessions...
    Thanks in advance....

    Synonyms are not limited to tables. Accroding to the SQL Reference, a synonym is:
    an alternative name for a table, view, sequence, procedure, stored function, package, materialized view, Java class schema object, user-defined object type, or another synonym.
    In fact, synonyms are not even validated until they are used:
    SQL> create synonym my_synonym for table_which_does_not_exist;
    Synonym created
    SQL> select * from my_synonym;
    select * from my_synonym
    ORA-00980: synonym translation is no longer valid

  • A dynamic table based on run-time created view object -- please help!

    Hello!
    I'm trying to create a dynamic table based on an run-time created view object. All go ok, but table binding component take the first view/iterator state and don't reflect changes they have. Please, take a look:
    1. At run-time the view is being replaced by new red-only one based on query in application module:
    getQueryView().remove();
    createViewObjectFromQueryStmt("QueryView", statement);
    2. Page definition file contains an iterator (using iterator or methodIterator - doesn't matter) binding and table, which binds to the iterator, like:
    <methodIterator id="distributeQuery1Iter" Binds="distributeQuery1.result"
    DataControl="QueryServiceDataControl" RangeSize="10"/>
    <table id="distributeQuery11" IterBinding="distributeQuery1Iter"/>
    3. The page code uses <af:table>. But, if I use table binding (it's right) like this:
    <af:table var="row" value="#{bindings.distributeQuery11.collectionModel}">
    <af:forEach items="#{bindings.distributeQuery11.attributeDefs}" var="def">
    the table will never changed (i.e. still show the first view instance).
    When I tried to use iterator binding directly (it's bad and cannot provide all needed features unlike CollectionModel from table binding) I saw that table works!
    (Code is somehing like:
    <af:table var="row" value="#{bindings.myIterator.allRowsInRange}">
    <af:forEach items="#{bindings.myIterator.attributeDefs}" var="def">
    Why the table binding do not reflect changes in iterator? Or should I use different approach?
    Thanks in advance!
    Ilya.

    I got it to work! I used a hybrid approach comprised of some of your code and some of Steve Muench's AcceessAppModuleInBackingBean example.
    In the setBindings method, I execute an app module method that redefines the query, then I used your code to delete and recreate bindings and iterator:
    public void setBindingContainer(DCBindingContainer bc) {
    this.bindingContainer = bc;
    rebuildVO();
    The rebuildVO() method looks like the code you provided in your example:
    private void rebuildVO() {
    DCDataControl dc;
    DispatchAppModule dApp;
    DCBindingContainer bc;
    DCIteratorBinding it;
    OperationBinding operationBinding;
    ViewObject vo;
    DCControlBinding cb;
    try {
    bc = getBindingContainer();
    dc = bc.findDataControl(DATACONTROL);
    dApp = (DispatchAppModule)dc.getDataProvider();
    // Execute App Module Method to rebuild VO based upon new SQL Statement.
    dApp.setDispatchViewSQL();
    vo = dApp.findViewObject(DYNAMIC_VIEW_NAME);
    it = bc.findIteratorBinding(DYNAMIC_VO_ITER_NAME);
    it.bindRowSetIterator(vo, true);
    // logger.info("Remove value binding...");
    cb = bc.findCtrlBinding(DYNAMIC_VIEW_NAME);
    cb.getDCIteratorBinding().removeValueBinding(cb);
    bc.removeControlBinding(cb);
    // logger.info("Creating new value binding...");
    FacesCtrlRangeBinding dynamicRangeBinding =
    new FacesCtrlRangeBinding(null,
    bc.findIteratorBinding(DYNAMIC_VO_ITER_NAME), null);
    // logger.info("Add control binding...");
    bc.addControlBinding(DYNAMIC_VIEW_NAME, dynamicRangeBinding);
    } catch (Exception e) {
    e.printStackTrace();
    And my App Module method that redefines the view object looks like this:
    public void setDispatchViewSQL() {
    String SQL =
    "begin ? := PK_BUsiNESS.F_GETDISPATCHVIEWSQL();end;";
    CallableStatement st = null;
    String ViewSQL = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,
    DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type LONGVARCHAR
    st.registerOutParameter(1, OracleTypes.LONGVARCHAR);
    st.execute();
    ViewSQL = ((OracleCallableStatement) st).getString(1);
    findViewObject(DYNAMIC_VO_NAME).remove();
    ViewObject vo = createViewObjectFromQueryStmt(DYNAMIC_VO_NAME, ViewSQL);
    vo.executeQuery();
    } catch (SQLException s) {
    throw new JboException(s);
    } finally {
    try {
    st.close();
    } catch (SQLException s) {
    s.printStackTrace();
    When I run it I get my desired results. One thing I don't quite understand is why when the page is first rendered it shows the last set of records rather than the first. Now I have to figure out how to put navigation URLS in each of the table cells.
    Thanks for your help; I would not have gotten this far without it,
    Jeff

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter.
    I have the query working with a PreparedStatement, but would like to use a View Object.
    When I use the PreparedStatement, I prepare the user defined type data like this:
    // get the data into an object array
    Object[] wSRecObjArr = wSRec.getObjectArray();
    // set up rec descriptor
    StructDescriptor WSRecDescriptor = StructDescriptor.createDescriptor("WS_REC",conn);
    // populate the record struct
    STRUCT wSRecStruct = new STRUCT(WSRecDescriptor,conn,wSRecObjArr);
    Then I can use this in the PreparedStatement like this:
    OraclePreparedStatement stat = null;
    ResultSet rs = null;
    stat = (OraclePreparedStatement)conn.prepareStatement("Select test_pkg.test_function(?) FROM DUAL");
    stat.setSTRUCT(1, wSRecStruct);
    rs = stat.executeQuery();
    I would like to do the same process with a View Object instead of the PreparedStatement.
    My question is "How do I create the input objects"?
    I obtain the View Object from the Application Module using findViewObject(). I don't actually have a connection object to pass into the StructDescriptor.createDescriptor method.
    I have tried just using Java Object Arrays (Object[]) to pass the data, but that gave an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Any help or pointers are greatly appreciated.
    Thank you.
    Edited by: 942120 on May 1, 2013 8:45 AM
    Edited by: 942120 on May 1, 2013 8:46 AM
    Edited by: 942120 on May 1, 2013 9:05 AM
    Edited by: 942120 on May 1, 2013 9:06 AM

    Custom domains are the way to go.
    When I try to pass custom domains that represent my user defined types - it works.
    However, one of the functions requires a table of a user defined type be passed in.
    I tried creating a domain of the table type. It forces me to add a field during creation (in JDEV), so I tried adding a field of type Array of Element of the domain representing the user defined type.
    I populate the table by setting the field I created, but the table is empty in PL/SQL (TEST_TAB.COUNT = 0).
    I also tried passing the oracle.jbo.domain.Array object, but that produced an error:
    java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call
    I also tried passing Object[], but that produced an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    How do I properly create, and pass an domain that represents a table of a user defined type?
    When I use a OraclePreparedStatement, I can pass a oracle.sql.ARRAY using stat.setARRAY.
    Thank you for the help you have provided, and any future advice.
    JDEV 10.1.2.3
    JDBC 10.2.0.5
    Edited by: 942120 on May 13, 2013 7:13 AM
    Edited by: 942120 on May 13, 2013 7:16 AM

  • Import package and create view object

    Hi,
    How can i import package from another project and create a new view object with my package and with the imported package.
    Thanks
    null

    Hi,
    How can i import package from another project and create a new view object with my package and with the imported package.
    Thanks
    null

  • Creating View Objects at Runtime for Validation

    In Oracle® Application Development Framework
    Developer’s Guide For Forms/4GL Developers tutorial there is a topic about Creating View Objects at Runtime for Validation.
    Is there any sample code available for this topic?
    Please help
    Regards
    S Karar

    I have created a helper method . The code is given below
    protected ViewObject getValidationVO(String viewObjectDefName) {
    // Create a new name for the VO instance being used for validation
    String name = "Validation_" + viewObjectDefName.replace('.', '_');
    // Try to see if an instance of this name already exists
    ViewObject vo = getDBTransaction().getRootApplicationModule().findViewObject(name);
    // If it doesn't already exist, create it using the definition name
    if (vo == null) {
    vo = getDBTransaction().getRootApplicationModule().createViewObject(name,viewObjectDefName);
    return vo;
    // Validation_bc4j_project of type ApplicationModule not found
    and created a validation method.
    The code inside validation method is given below.
    public boolean validateAvgMr(Number data) {
    String batch_catg = getQuality();
    // Get the view object instance for validation
    ViewObject vo = getValidationVO("bc4j_project.v_sqc0150");
    if (getTestStage()=="DOLLOP" && getQuality()=="DECO")
    // Set it's bind variables (which it will typically have!)
    vo.setNamedWhereClauseParam("batch_catg","DECO");
    vo.executeQuery();
    Number dol_mr_lcl=(Number)vo.first().getAttribute("DolMrLclStd");
    setStdMrLcl(dol_mr_lcl);
    return true;
    return true;
    I have checked the validation view and it is returing value with the same bind variable value but is not returning any value when using inside this method validation.
    I have checked several times but can't find the fault in the code.
    Please help

  • Implementing a view Object with Multiple Updateable Dependent Entity Objects

    Hello,
         I want to implement view object with multiple updateable entity object,
         i have refered this link its good https://forums.oracle.com/thread/63721
         here they have explained with 2 table,
         but when we have more then 5 tables and each table have Primary keys , Foreign key , Sequence and  trigger created on it. Then whats steps should i want to fallow.
         if possible some please provide the link or some one help me out how to do this .
         thanks in advance
         cheers

    Has the Advanced View Object Techniques been referred?

  • How to create a report with different page sizes

    Hi,
    I would like to create a report with different page sizes, it's possible to do it with diadem?
    When I change the layout parameters, changes afect to all sheets...
    Is there a way to change page size individually for each sheet?
    Thanks in advance.
    Marc

    Hi Marc,
    You can use the DocStart and DocEnd commands along with the PicPrint command to spool multiple print commands to the same output PDF file using the direct printer approach.  This should enable you to programmatically specify the page size differently for each sheet that you add to the print job.
    ' Print PDF Page by Page.VBS
    OPTION EXPLICIT
    Dim i, Path, OldPrintName
    Path = AutoActPath & "2D Stacked"
    Call DataDelAll
    Call DataFileLoad(Path & ".TDM")
    PDFFileName = Path & " Page by Page.pdf"
    IF FileExist(PDFFileName) THEN Call FileDelete(PDFFileName)
    OldPrintName = PrintName
    PrintName = "winspool,DIAdem PDF Export,LPT1:" ' Set to PDF printer
    PDFResolution = "72 DPI" ' "2400 DPI" , "default"
    PDFOptimization = TRUE
    PDFFontsEmbedded = FALSE
    PDFJPGCompressed = "high"
    PrintOrient = "landscape" ' orient paper
    Call PrintMaxScale("GRAPH") ' auto-max, see alternative margin setting variables below
    PrintLeftMarg = 0.181
    PrintTopMarg = 0.181
    PrintWidth = 10.67
    'PrintHeigth = 7 (read-only)
    Call WndShow("REPORT")
    Call DocStart ' Begin multi-page document/print job
    FOR i = 1 TO 4
    Call PicLoad(Path & ".TDR")
    Call GraphSheetNGet(1)
    Call GraphSheetRename(GraphSheetName, "Page " & i)
    Call PicUpdate
    Call PicPrint("WinPrint") ' Add a page to be printed
    NEXT ' i
    Call DocEnd ' End multi-page document/print job
    PrintName = OldPrintName
    Call ExtProgram(PDFFileName)
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

Maybe you are looking for