SwingWorker in practice

Sometimes ignorance seems a blessing. I really don't have any problems with my Swing application, a least not yet, until I read: "Long-running computations or input/output (I/O) bound tasks should never run on the Swing EDT." My application has plenty of database interaction, albeit no long-running tasks. However, since all network communication is potentially slow, I guess that the rule also applies to fast stored procedure calls.
I see myself now faced with a huge amount of SwingWorker classes, one for every DAO call, for example:
protected List<Foo> doInBackground() {
        DAOFactory fac = DAOFactory.getInstance();
        FooDAO dao = fac.getFooDAO();
        return dao.getFoos();
}Much of my code is now concerned with SwingWorkers and adding PropertyChangeListeners to these, which make me wonder if everybody takes this rule so literally or that a more pragmatic approach will also do. In other words, do you program for the worst case or for business as usual? Perhaps there is a better way of dealing with SwingWorkers? I am looking forward to your view and experiences on this matter.

Sometimes ignorance seems a blessing. I really don't have any problems with my Swing application, a least not yet, until I read: "Long-running computations or input/output (I/O) bound tasks should never run on the Swing EDT." My application has plenty of database interaction, albeit no long-running tasks. However, since all network communication is potentially slow, I guess that the rule also applies to fast stored procedure calls.
I see myself now faced with a huge amount of SwingWorker classes, one for every DAO call, for example:
protected List<Foo> doInBackground() {
        DAOFactory fac = DAOFactory.getInstance();
        FooDAO dao = fac.getFooDAO();
        return dao.getFoos();
}Much of my code is now concerned with SwingWorkers and adding PropertyChangeListeners to these, which make me wonder if everybody takes this rule so literally or that a more pragmatic approach will also do. In other words, do you program for the worst case or for business as usual? Perhaps there is a better way of dealing with SwingWorkers? I am looking forward to your view and experiences on this matter.

Similar Messages

  • Best Practice: Sharing Action Task

    My application has two Action implementations. One is "SaveAs" which shows a JFileChooser and then saves to file using SwingWorker to keep GUI responsive. The other is "Exit" which does exactly the same (but only if the lokal document is "dirty") and terminates the application after that. It works pretty well.
    But it is not nice that 90% of the code is duplicated, so the question is, what is the best practice?
    One could imagine a lot of possible solutions, like:
    - Exit extends SaveAs, or both extending a common super class. Technically right, but rather strange: What shall that super class be named besides a synthetical "ExitAndSaveAsSuperClass"...?
    - Exit calls SaveAs and passes a parameter telling SaveAs to exit after SwingWorker is finished. Technically possible, but horizontal calls always have a bad smell of SpaghettiCode.
    - Exit and SaveAs both have no own code besides telling a third class to do the work. Looks like a good separation of Action and Task. But looks like breaking a butterfly on a wheel.
    - etc.
    So what I like to know is not whether anybody has any more ideas or what anybody thinks about the above ideas. My question actually is whether there has been emerged a "best practice" for this problem (sharing of Action Task)? I mean, Swing is around for decades now so I assume that there are lots of best practices existing, but I just did not found them so far on the web...?

    Perhaps refactor the common save-as functionality in a method of the class, and have the two listeners both use it.

  • SwingWorker in Applet

    Hi,
    I have a question on using class SwingWorker and Applets.
    My usecase is this:
    I have an applet with a menue (java.awt.Choice). My applet implements ItemListener and so I can register
    the applet as itemlistener for the menue.
    I have an inner class in the applet which extends SwingWorker. This worker is constantly running in the background - when the user
    makes a choice in the menu, the worker is notified and some logic is carried out.
    I need the worker to be constantly running in the background. So, in method done() - the last thing I do is to re-instantiate the worker itself.
    Is this ok? Code below:
    public class myapplet ....{
          private MyWorker worker;
          init(){
               worker = new MyWorker();
         class MyWorker extends SwingWorker....{
              protected String doInBackground(){
                  while(true){
                     if(userMadeChoiceInTheMenu()){
                          return "someValue";             
              public void done(){
                   try{
                       showNewPageBasedOnUsersChoiceInTheMenue();
                   finally{
                        worker = new MyWorker();
                       worker.execute();
    }best regards, Håkan
    Edited by: 933709 on Jul 11, 2012 1:06 AM
    Edited by: 933709 on Jul 11, 2012 1:07 AM

    First, best practices guides exists to be followed, they prevent you from getting strange errors like this one you got.
    I'll not enumerate your mistakes here, I'll just try to help you, but you should really try to follow some coding rules.
    The problem could be this:
    There is no guarantee that your objects will be collected at the end of your applet, or if the user reload the page, or even if he closes the tab and open another.
    Calling System.gc() just asks kindly to the garbage collector, but it will probably not run.
    What does it have to do with your applet?
    Let's take a look:
    public abstract class SwingWorker<T, V> implements Runnable, Future<T> {    
        private static ExecutorService executorService = null;This code will run only when your class is loaded the first time. Considering that it's still in the memory when the page is reloaded, it will not be executed and your old ExecutorService will be used instead of a new one, and it could will be in an illegal state!
    Holp it helps,
    Henrique Abreu

  • Initializing JDialogs or Other GUI Components within SwingWorker

    Hello Every one,
    I have been using SwingWorker class heavily in my application and recently I noticed that If I click on a button twice or thrice the third or 4th it takes more time to perform the action in which SwingWorker is being used. So I started reading more about SwingWorker and after reading number of articles and posts on this forum I believe I am not using SwingWorker correctly. But, I am not still sure ( or may be I am afriad or I am not ready to change my code in so many files and so many locations :(
    So I thought to ask some gurus following questions, in this forum before I proceeed with the code refactoring.
    Question 1:* I am performing GUI operations in doInBackground() is it ok to perform swing operations or create swing components in this method of SwingWorker?
    Example Code :
    jbtnModifyUser Action Event
    private void jbtnModifyUserActionPerformed(java.awt.event.ActionEvent evt) {
    setButtonsState(false);
    final SwingWorker worker = new SwingWorker() {
    protected Object doInBackground() {
    try {
    openUserModifierDialog(SELECTED_PROFILE);
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {
    return null;
    public void done()
    setButtonsState(true);
    worker.execute();
    }Open Dialog Method wich I call from several other Swing Components Action performed event
    private void openUserModifierDialog(UserProfile profile) throws ServerException {
    UserModifierDialog modifier = new UserModifierDialog(_frame, true, profile);
    modifier.pack();
    modifier.setVisible(true);
    if (modifier.isModified()) {
    resetFields();
    populateUserTable();
    } If I click 3 to 4 times same button the 4th or 5th time the dialog opens after soem delay like 10 seconds. But in first two three click it opens quickly like in 2 to 3 seconds. Is it due to the fact that I am perfoming Swing GUI operations in doInBackgroundMethod()?
    Question 2: Should I use EventQueue.invokeLater() but as far as I have learned from the articles, the actionPerformed events already run on EDT.
    Question 3:_ Each dialog has multiple swing components like combo boxes, tables, tress which it populates after fetching data from the Database in its constructor. It takes like 1 to 2 seconds to bring data and initialize all swing components. Once the Dialog is initialized in the constructor I call my own function to set the existing user details ( As shown below ).
    I need to set all the details before I show the Dialog to the user. To achieve this what is the best practice? Where should I use SwingWorker in current scenario? in Dialog's PostInitialize()? In Dialog's Constructor()? or in the Frame's openModifierDialog()?
    public UserModifierDialog(java.awt.Frame parent, boolean modal, UserProfile userprofile)
    throws ServerException {
    super(parent, modal);
    if (userprofile != null) {
    SELECTED_USER_PROFILE = userprofile;
    }else{
    //throw new Exception("Invalid user record. User profile cannot be null. ");
    initComponents();
    postInitialize(); // my function called to set the user details on the screen
    private void postInitialize() throws ServerException {
    _userManager = new UserManager();
    initializeAllPermissions();
    initializeUserGroups();
    setFields(SELECTED_USER_PROFILE);
    private void initializeUserGroups() throws ServerException {
    _jcbUserGroup.removeAllItems();
    _jcbUserGroup.setModel(new ArrayListModel(_userManager.getAllUserGroups ()));
    _jcbUserGroup.setSelectedIndex(0);
    private void setFields(Userprofile profile) throws ServerException{
    _jlblUserID.setText(profile.getUserid().toString());
    _jtfUserName.setText(profile.getUsername());
    _jtfFirstName.setText(profile.getFirstname());
    _jtfLastName.setText(profile.getLastname());
    _jtfPassword.setText(profile.getPassword());
    _jtfConfirmPassword.setText(profile.getPassword());
    _jtaDescription.setText(profile.getDescription());
    _jcbUserGroup.setSelectedItem(_userManager.getUserGroup(profile.getUserGroupID()));
    } Question 4: I noticed that if I use following code in my openModifierDialog function to execute the worker rather then its own execute method the dialog opens quickly each time.
    Is it good idea to use the following to execute a SwingWorker or I shouldn't as I may fall in some threading issues later on which I am not aware of?
    Thread t = new Thread(worker);
    t.start();Hope to hear some useful comments / answers to my queries.
    Thanks in advance.
    Regards

    Thanks for your prompt reply and answers to my queries.
    Well, I know there are enormous faults in this code. Thats why I am seeking guru's advice to clean the mess. Let me give you breif background of the code. The current code was written by some one else using old version of SwingWorker and I am just trying to clean the mess.
    All the JDialog or Swing Components intialization code was in construct() method of previous SwingWorker. Later on when the SwingWorker became the part of Java SE 6 all application code was refactored and the GUI components initialization was moved to the new function doInBackground().
    The sample code represents the current condition of the code. All I needed was a shortcut to clean the mess or to avoid changes at so many places. But it seems that there is no easy workout for the current situation and I have to change the entire application code. I have gone through the SwingWorker API and tutorial @ [http://java.sun.com/developer/technicalArticles/javase/swingworker] and I am doing following to clean this mess.
    Well the following code is proposed refactoring of the previous code. Hope to hear your comments on it.
    private void jbtnModifyUserActionPerformed(java.awt.event.ActionEvent evt) {
    try{
    openUserModifierDialog(SELECTED_PROFILE);
    } catch (Exception ex) {
    logger.error(ex);
    //show some message here
    } finally {
    private void openUserModifierDialog(UserProfile profile) throws ServerException {
    UserModifierDialog modifier = new UserModifierDialog(_frame, true, profile);
    modifier.pack();
    modifier.setVisible(true);
    if (modifier.isModified()) {
    resetFields();
    //UserModifierDialog Constructor
    public UserModifierDialog(java.awt.Frame parent, boolean modal, UserProfile userprofile)
    throws ServerException {
    super(parent, modal);
    if (userprofile != null) {
    SELECTED_USER_PROFILE = userprofile;
    } else {
    //throw new Exception("Invalid user record. User profile cannot be null. ");
    initComponents();
    postInitialize(); // My function called to set the user details on the screen
    private void postInitialize() {
    _userManager = new UserManager();
    setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
    final SwingWorker worker = new SwingWorker() {
    protected Object doInBackground() {
    try {
    return _userManager.getAllUserGroups(); //returns ArrayList of all user groups from database
    } catch (ServerException ex) {
    //Show Message here
    return null;
    protected void done() {
    try {
    if (get() != null) {
    _jcbUserGroup.setModel(new ArrayListModel((ArrayList) get()));
    _jcbUserGroup.setEditable(false);
    setFields(SELECTED_USER_PROFILE);
    else
    //show some error to user that data is empty
    } catch (InterruptedException ex) {
    //show message here
    } catch (ExecutionException ex) {
    //show message here
    } finally {
    setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
    worker.execute();
    private void setFields(Userprofile profile) throws ServerException {
    _jlblUserID.setText(profile.getUserid().toString());
    _jtfUserName.setText(profile.getUsername());
    _jtfFirstName.setText(profile.getFirstname());
    _jtfLastName.setText(profile.getLastname());
    _jtfPassword.setText(profile.getPassword());
    _jtfConfirmPassword.setText(profile.getPassword());
    _jtaDescription.setText(profile.getDescription());
    _jcbUserGroup.setSelectedItem(_userManager.getUserGroup(profile.getUserGroupID()));
    }In some places where data is way too huge I am going to use process and publish methods of SwingWorker.
    Now I have another question, how I can notify/throw any exceptions occured inside SwingWorker doInBackground method or done method to the function who executed SwingWorker. Currenlty I am catching the excpetions in the done method and showing a dialog box. But I want to throw it to the postInitialize method the method who created and executed the Worker. What is the best practice of handling exceptions in SwingWorker methods.
    Do you see any problems in proposed refactoring?
    Hope to hear your comments.
    Regards

  • (hopefully) simple, dumb swingworker question

    I'm experimenting with Swing for the first time, after coming from PHP (non-threaded, non-GUI, etc). I'd like to build a button that does some long-running background task, so, working my way through Sun tutorials, I've come to SwingWorker. I understand some of it, but the major sticking point to me right now is getting data back from the thread. For instance, if my thread were to go out and do some calculation...how do I get that back in the EDT to display it? I gleaned that I should only affect the GUI from the EDT ... correct? I've created a second class to model the worker task. My code (some auto-generated by netbeans) is below:
    ++++++++++++++++++++++++++++++++++++++ MainFrame.java ++++++++++++++++++++++++++++++++
    package swingworkertest;
    public class MainFrame extends javax.swing.JFrame {
    /** Creates new form MainFrame */
         public MainFrame() {
              initComponents();
         /** This method is called from within the constructor to
          * initialize the form.
          * WARNING: Do NOT modify this code. The content of this method is
          * always regenerated by the Form Editor.
         @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            goButton = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            goButton.setText("Go");
            goButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    goButtonActionPerformed(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(58, 58, 58)
                    .addComponent(goButton)
                    .addContainerGap(59, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(44, 44, 44)
                    .addComponent(goButton)
                    .addContainerGap(56, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
         private void goButtonActionPerformed(java.awt.event.ActionEvent evt) {
              WorkerTask workerTask = new WorkerTask();
              workerTask.execute();
          * @param args the command line arguments
         public static void main(String args[]) {
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        new MainFrame().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton goButton;
        // End of variables declaration
    }+++++++++++++++++++ WorkerTask.java ++++++++++++++++++++++
    package swingworkertest;
    import javax.swing.SwingWorker;
    public class WorkerTask extends SwingWorker<String, Integer> {
         private Throwable error = null;
         /** The function that is running in the worker thread */
         @Override
         public String doInBackground() {
              String ret = "this is my returned data";
              System.out.println("I'm in doInBackground, with data ["+ret+"]");
              return ret;
         @Override
         public void done() {
              String data = null;
              try {
                   data = get();
                   System.out.println("Hey, I'm in done(), and have data");
                   System.out.println(data);
              } catch (Exception ignore) {
                   System.out.println("Oh yea, got an exception in done");
              return;
    }+++++++++++++++++++++++++++++++++++++++++++++++++++
    So, once my thread runs, how do I get back the data so it can be displayed (or put into some other Swing component)? Is there an event listener I should be using? Something along those lines?
    Any help, or even a point in the correct direction, would be very helpful.
    Thanks in advance!
    Edited by: crotty on May 13, 2010 2:01 PM

    Hi, camickr, thanks for your response. I guess my question might be one of scope then. I understand that done() and process() are run on the EDT, but when done() (for example) is run, it's run in the scope of the WorkerTask class (which is a separate class outside of my main class, and not a inner class). So the WorkerTask class doesn't have access to the private Swing components, like goButton in my example.
    I put the WorkerTask class outside because it seemed to me that these tasks would be easier to work on if they were separate from the main EDT class, however, that may not be the case. Is it better practice to put SwingWorker extending classes as inner classes in the main class, and use other classes to actually do the work? (And how many times can I use the word class in one sentence?)
    In any case, the done() method call is performed (and has access to the computed data via get()), but doesn't seem to return anything to the EDT in a place where I have programmatic access to it, or a place where I can alter any swing components. If I'm wrong (which is most likely the case), could you point me towards where I've gone wrong?

  • Logical level in Fact tables - best practice

    Hi all,
    I am currently working on a complex OBIEE project/solution where I am going straight to the production tables, so the fact (and dimension) tables are pretty complex since I am using more sources in the logical tables to increase performance. Anyway, what I am many times struggling with is the Logical Levels (in Content tab) where the level of each dimension is to be set. In a star schema (one-to-many) this is pretty straight forward and easy to set up, but when the Business Model (and physical model) gets more complex I sometimes struggle with the aggregates - to get them work/appear with different dimensions. (Using the menu "More" - "Get levels" does not allways give the best solution......far from). I have some combinations of left- and right outer join as well, making it even more complicated for the BI server.
    For instance - I have about 10-12 different dimensions - should all of them allways be connected to each fact table? Either on Detail or Total level. I can see the use of the logical levels when using aggregate fact tables (on quarter, month etc.), but is it better just to skip the logical level setup when no aggregate tables are used? Sometimes it seems like that is the easiest approach...
    Does anyone have a best practice concerning this issue? I have googled for this but I haven't found anything good yet. Any ideas/articles are highly appreciated.

    Hi User,
    For instance - I have about 10-12 different dimensions - should all of them always be connected to each fact table? Either on Detail or Total level.It not necessary to connect to all dimensions completely based on the report that you are creating ,but as a best practice we should maintain all at Detail level only,when you are mentioning any join conditions in physical layer
    for example for the sales table if u want to report at ProductDimension.ProductnameLevel then u should use detail level else total level(at Product,employee level)
    Get Levels. (Available only for fact tables) Changes aggregation content. If joins do not exist between fact table sources and dimension table sources (for example, if the same physical table is in both sources), the aggregation content determined by the administration tool will not include the aggregation content of this dimension.
    Source admin guide(get level definition)
    thanks,
    Saichand.v

  • Best practices for setting up users on a small office network?

    Hello,
    I am setting up a small office and am wondering what the best practices/steps are to setup/manage the admin, user logins and sharing privileges for the below setup:
    Users: 5 users on new iMacs (x3) and upgraded G4s (x2)
    Video Editing Suite: Want to connect a new iMac and a Mac Pro, on an open login (multiple users)
    All machines are to be able to connect to the network, peripherals and external hard drive. Also, I would like to setup drop boxes as well to easily share files between the computers (I was thinking of using the external harddrive for this).
    Thank you,

    Hi,
    Thanks for your posting.
    When you install AD DS in the hub or staging site, disconnect the installed domain controller, and then ship the computer to the remote site, you are disconnecting a viable domain controller from the replication topology.
    For more and detail information, please refer to:
    Best Practices for Adding Domain Controllers in Remote Sites
    http://technet.microsoft.com/en-us/library/cc794962(v=ws.10).aspx
    Regards.
    Vivian Wang

  • Add fields in transformations in BI 7 (best practice)?

    Hi Experts,
    I have a question regarding transformation of data in BI 7.0.
    Task:
    Add new fields in a second level DSO, based on some manipulation of first level DSO data. In 3.5 we would have used a start routine to manipulate and append the new fields to the structure.
    Possible solutions:
    1) Add the new fields to first level DSO as well (empty)
    - Pro: Simple, easy to understand
    - Con: Disc space consuming, performance degrading when writing to first level DSO
    2) Use routines in the field mapping
    - Pro: Simple
    - Con: Hard to performance optimize (we could of course fill an internal table in the start routine and then read from this to get some performance optimization, but the solution would be more complex).
    3) Update the fields in the End routine
    - Pro: Simple, easy to understand, can be performance optimized
    - Con: We need to ensure that the data we need also exists (i.e. if we have one field in DSO 1 that we only use to calculate a field in DSO 2, this would also have to be mapped to DSO 2 in order to exist in the routine).
    Does anybody know what is best practice is? Or do you have any experience regarding what you see as the best solution?
    Thank you in advance,
    Mikael

    Hi Mikael.
    I like the 3rd option and have used this many many times.  In answer to your question:-
    Update the fields in the End routine
    - Pro: Simple, easy to understand, can be performance optimized  - Yes have read and tested this that it works faster.  A OSS consulting note is out there indicating the speed of the end routine.
    - Con: We need to ensure that the data we need also exists (i.e. if we have one field in DSO 1 that we only use to calculate a field in DSO 2, this would also have to be mapped to DSO 2 in order to exist in the routine). - Yes but by using the result package, the manipulation can be done easily.
    Hope it helps.
    Thanks,
    Pom

  • Temp Tables - Best Practice

    Hello,
    I have a customer who uses temp tables all over their application.
    This customer is a novice and the app has its roots in VB6. We are converting it to .net
    I would really like to know the best practice for using temp tables.
    I have seen code like this in the app.
    CR2.Database.Tables.Item(1).Location = "tempdb.dbo.[##Scott_xwPaySheetDtlForN]"
    That seems to work, though i do not know why the full tempdb.dbo.[## is required.
    However, when i use this in the new report I am doing I get runtime errors.
    i also tried this
    CR2.Database.Tables.Item(1).Location = "##Scott_xwPaySheetDtlForN"
    I did not get errors, but I was returned data i did not expect.
    Before i delve into different ways to do this, i could use some help with a good pattern to use.
    thanks

    Hi Scott,
    Are you using the RDC still? It's not clear but looks like it.
    We had an API that could piggy back the HDBC handle in the RDC ( craxdrt.dll ) but that API is no longer available in .NET. Also, the RDC is not supported in .NET since .NET uses the framework and RDC is COM.
    Work around is to copy the temp data into a data set and then set location to the data set. There is no way that I know of to get to the tempdb from .NET. Reason being is there is no CR API to set the owner of the table to the user, MS SQL Server locks the tempdb to that user has exclusinve rights on it.
    Thank you
    Don

  • Best Practice for Significant Amounts of Data

    This is basically a best-practice/concept question and it spans both Xcelsius & Excel functions:
    I am working on a dashboard for the US Military to report on some basic financial transactions that happen on bases around the globe.  These transactions fall into four categories, so my aggregation is as follows:
    Year,Month,Country,Base,Category (data is Transaction Count and Total Amount)
    This is a rather high level of aggregation, and it takes about 20 million transactions and aggregates them into about 6000 rows of data for a two year period.
    I would like to allow the users to select a Category and a country and see a chart which summarizes transactions for that country ( X-axis for Month, Y-axis Transaction Count or Amount ).  I would like each series on this chart to represent a Base.
    My problem is that 6000 rows still appears to be too many rows for an Xcelsius dashboard to handle.  I have followed the Concatenated Key approach and used SUMIF to populate a matrix with the data for use in the Chart.  This matrix would have Bases for row headings (only those within the selected country) and the Column Headings would be Month.  The data would be COUNT. (I also need the same matrix with Dollar Amounts as the data). 
    In Excel this matrix works fine and seems to be very fast.  The problem is with Xcelsius.  I have imported the Spreadsheet, but have NOT even created the chart yet and Xcelsius is CHOKING (and crashing).  I changed Max Rows to 7000 to accommodate the data.  I placed a simple combo box and a grid on the Canvas u2013 BUT NO CHART yet u2013 and the dashboard takes forever to generate and is REALLY slow to react to a simple change in the Combo Box.
    So, I guess this brings up a few questions:
    1)     Am I doing something wrong and did I miss something that would prevent this problem?
    2)     If this is standard Xcelsius behavior, what are the Best Practices to solve the problem?
    a.     Do I have to create 50 different Data Ranges in order to improve performance (i.e. Each Country-Category would have a separate range)?
    b.     Would it even work if it had that many data ranges in it?
    c.     Do you aggregate it as a crosstab (Months as Column headings) and insert that crosstabbed data into Excel.
    d.     Other ideas  that Iu2019m missing?
    FYI:  These dashboards will be exported to PDF and distributed.  They will not be connected to a server or data source.
    Any thoughts or guidance would be appreciated.
    Thanks,
    David

    Hi David,
    I would leave your query
    "Am I doing something wrong and did I miss something that would prevent this problem?"
    to the experts/ gurus out here on this forum.
    From my end, you can follow
    TOP 10 EXCEL TIPS FOR SUCCESS
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/204c3259-edb2-2b10-4a84-a754c9e1aea8
    Please follow the Xcelsius Best Practices at
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a084a11c-6564-2b10-79ac-cc1eb3f017ac
    In order to reduce the size of xlf and swf files follow
    http://myxcelsius.com/2009/03/18/reduce-the-size-of-your-xlf-and-swf-files/
    Hope this helps to certain extent.
    Regards
    Nikhil

  • Best-practice for Catalog Views ? :|

    Hello community,
    A best practice question:
    The situtation: I have several product categories (110), several items in those categories (4000) and 300 end-users.    I would like to know which is the best practice for segment the catalog.   I mean, some users should only see categories 10,20 & 30.  Other users only category 80, etc.    The problem is how can I implement this ?
    My first idea is:
    1. Create 110 Procurement Catalogs (1 for every prod.category).   Each catalog should contain only its product category.
    2. Assign in my Org Model, in a user-level all the "catalogs" that the user should access.
    Do you have any idea in order to improve this ?
    Saludos desde Mexico,
    Diego

    Hi,
    Your way of doing will work, but you'll get maintenance issues (to many catalogs, and catalog link to maintain for each user).
    The other way is to built your views in CCM, and assign these views to the users, either on the roles (PFCG) or on the user (SU01). The problem is that with CCM 1.0 this is limitated, cause you'll have to assign one by one the items to each view (no dynamic or mass processes), it has been enhanced in CCM 2.0.
    My advice:
    -Challenge your customer about views, and try to limit the number of views, with for example strategic and non strategic
    -With CCM 1.0 stick to the procurement catalogs, or implement BADIs to assign items to the views (I experienced it, it works, but is quite difficult), but with a limitated number of views
    Good luck.
    Vadim

  • Best practice on sqlite for games?

    Hi Everyone, I'm new to building games/apps, so I apologize if this question is redundant...
    I am developing a couple games for Android/iOS, and was initially using a regular (un-encrypted) sqlite database. I need to populate the database with a lot of info for the games, such as levels, store items, etc. Originally, I was creating the database with SQL Manager (Firefox) and then when I install a game on a device, it would copy that pre-populated database to the device. However, if someone was able to access that app's database, they could feasibly add unlimited coins to their account, unlock every level, etc.
    So I have a few questions:
    First, can someone access that data in an APK/IPA app once downloaded from the app store, or is the method I've been using above secure and good practice?
    Second, is the best solution to go with an encrypted database? I know Adobe Air has the built-in support for that, and I have the perfect article on how to create it (Ten tips for building better Adobe AIR applications | Adobe Developer Connection) but I would like the expert community opinion on this.
    Now, if the answer is to go with encrypted, that's great - but, in doing so, is it possible to still use the copy function at the beginning or do I need to include all of the script to create the database tables and then populate them with everything? That will be quite a bit of script to handle the initial setup, and if the user was to abandon the app halfway through that population, it might mess things up.
    Any thoughts / best practice / recommendations are very appreciated. Thank you!

    I'll just post my own reply to this.
    What I ended up doing, was creating the script that self-creates the database and then populates the tables (as unencrypted... the encryption portion is commented out until store publishing). It's a tremendous amount of code, completely repetitive with the exception of the values I'm entering, but you can't do an insert loop or multi-line insert statement in AIR's SQLite so the best move is to create everything line by line.
    This creates the database, and since it's not encrypted, it can be tested using Firefox's SQLite manager or some other database program. Once you're ready for deployment to the app stores, you simply modify the above set to use encryption instead of the unencrypted method used for testing.
    So far this has worked best for me. If anyone needs some example code, let me know and I can post it.

  • Best Practice Table Creation for Multiple Customers, Weekly/Monthly Sales Data in Multiple Fields

    We have an homegrown Access database originally designed in 2000 that now has an SQL back-end.  The database has not yet been converted to a higher format such as Access 2007 since at least 2 users are still on Access 2003.  It is fine if suggestions
    will only work with Access 2007 or higher.
    I'm trying to determine if our database is the best place to do this or if we should look at another solution.  We have thousands of products each with a single identifier.  There are customers who provide us regular sales reporting for what was
    sold in a given time period -- weekly, monthly, quarterly, yearly time periods being most important.  This reporting may or may not include all of our product identifiers.  The reporting is typically based on calendar-defined timing although we have
    some customers who have their own calendars which may not align to a calendar month or calendar year so recording the time period can be helpful.
    Each customer's sales report can contain anything from 1,000-20,000 rows of products for each report.  Each customer report is different and they typically have between 4-30 columns of data for each product; headers are consistently named.  The
    product identifiers included may vary by customer and even within each report for a customer; the data in the product identifier row changes each week.  Headers include a wide variety of data such as overall on hand, overall on order, unsellable on hand,
    returns, on hand information for each location or customer grouping, sell-through units information for each location or customer grouping for that given time period, sell-through dollars information for each location or customer grouping for that given time
    period,  sell-through units information for each location or customer grouping for a cumulative time period (same thing for dollars), warehouse on hands, warehouse on orders, the customer's unique categorization of our product in their system, the customer's
    current status code for that product, and so on.
    Currently all of this data is stored in a multitude of Excel spreadsheets (by customer, division and time period).  Due to overall volume of information and number of Excel sheets, cross-referencing can take considerable time.  Is it possible to
    set-up tables for our largest customers so I can create queries and pivot tables to more quickly look at sales-related information by category, by specific product(s), by partner, by specific products or categories across partners, by specific products or
    categories across specific weeks/months/years, etc.  We do have a separate product table so only the product identifier or a junction table may be needed to pull in additional information from the product table with queries.  We do need to maintain
    the sales reporting information indefinitely.
    I welcome any suggestions, best practice or resources (books, web, etc).
    Many thanks!

    Currently all of this data is stored in a multitude of Excel spreadsheets (by customer, division and time period).  Due to overall volume of information and number of Excel sheets, cross-referencing can take considerable time.  Is it possible to
    set-up tables .....
    I assume you want to migrate to SQL Server.
    Your best course of action is to hire a professional database designer for a short period like a month.
    Once you have the database, you need to hire a professional DBA to move your current data from Access & Excel into the new SQL Server database.
    Finally you have to hire an SSRS professional to design reports for your company.
    It is also beneficial if the above professionals train your staff while building the new RDBMS.
    Certain senior SQL Server professionals may be able to do all 3 functions in one person: db design, database administration/ETL & business intelligence development (reports).
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Best Practice to fetch SQL Server data and Insert into Oracle Tables

    Hello,
    I want to read sqlserver data everry half an hour and write into oracle tables ( in two different databases). What is the best practice for doing this?
    We do not have any database dblinks from oracle to sqlserver and vice versa.
    Any help is highly appreciable?
    Thanks

    Well, that's easy:
    use a TimerTask to do the following every half an hour:
    - open a connection to sql server
    - open two connections to the oracle databases
    - for each row you read from the sql server, do the inserts into the oracle databases
    - commit
    - close all connections

  • Best Practice for Image placement and Anchored Frames for use in Robohelp 9

    Hi,
    I'm looking for the best practices in how to layout my images in Framemaker 10 so that they translate correctly to Robohelp 9.  I currently have images inside of Anchored frames that "Run into" the right side of my text. I've adjusted the size of the anchored frame so that my text flows correctly around the image. Everything looks good in Framemaker! Yeah! The problem is that when I link my Framemaker document to Robohelp, the text does not flow around my image in the same manner. On a couple of Robohelp screens the image is running into the footer. I'm wondering if I should be using tables in Framemaker in order to get the page layout that I'm looking for. Also, I went back and forth...is this a Framemaker question or is this a Robohelp question. Any assistance would be greatly appreciated.

    I think Jeff is meaning this section of the RoboHelp forums:
    http://forums.adobe.com/community/robohelp/robohelp_framemaker

Maybe you are looking for

  • Why is the panorama tab button missing from my tab bar

    Just downloaded Beta 4 and find the panorama button is missing from the tab bar. Your video showing how to manipulate tabs show the button on the right hand side of the tab bar, on my download it is missing why, also some of the other bars shown in y

  • Photoshop elements 5.0 won't open when downloaded on my pc

    i have an old version of Elements (5.0) which I used to have downloaded on my pc (operating system is Vista) which I removed.  When I reloaded it to my pc with the cd it appears to download the application but I can't open it.  Anyone have a clue as

  • Export and import oracle xe application users

    How can i import a user'sexport script using sqlplus? i make a export with application->export->users to a file exportuser.sql but when i'm try to import with sqlplus i get ORA-20001: Unauthorized access (wwv_flow_api.set_credentials). I need to make

  • OCR and Voting Disk partition

    Dear all I uninstall clusterware. And i want to install again that but when i made partition in windows 2003 then CVU fail the stage command. I did the following things.. 1) diskpart --->select Disk 1----> clean -->exit (both the nodes) 2) diskpart -

  • My New domain controller wont see the pdc

    hi, i have a windows 2003 pdc that is the only one on the network, previous IT people did not have a BDC or system back up. Now the current domain controller is giving trouble, i tried to install a secondary 2003 domain controller (BDC) but it dose n