File Dialog Box?? please help!

button1 is to generate a text file to extract the data. however, i want it to prompt me a file dialog box to allow me to choose the location i want to save it. i tried " javascript:document.execCommand('SaveAs','true','test.txt'); " but it only saves the html format. any idea how could i save the extracted data? kindly advise!!
<SCRIPT LANGUAGE="JavaScript">
               <%
               java.text.DateFormat ais = new java.text.SimpleDateFormat("dd-MM-yyyy hh.mm.ss");
               String formattedNowTime = ais.format(now);          
               int count = 1;
               %>
               function button1()
               <%
                    ResultSet rs3 = stmt3.executeQuery("SELECT W.Grp, W.Adm_No,SSN.Repeat_Cnt, S.Name, [Absent%], WarnNo, Issue_Date, Issue_By, FromDate, ToDate, S.TutGrp, T.TutorName FROM Warning_Letters W, Students S, Student_Study_Modules SSN, Tutors AS T "+
                               "WHERE SSN.Adm_No=S.Adm_No AND SSN.Module_Code=W.Module_Code AND S.Adm_No=W.Adm_No  AND W.Module_Code='"+moduleRQ+"' AND S.TutGrp=T.TutGrp  AND W.Issue_Date between #"+date1+"# AND #"+date2+"# ORDER BY Grp, S.Name, W.WarnNo");
                    //count++;
                    String path = ("C:\\\\temp\\\\" +moduleRQ+ " ("+modAbbr+") " +formattedNowTime+ ".txt");
                    File strFile = new File(path);
                    Writer objWriter = new BufferedWriter(new FileWriter(strFile));
                    objWriter.write(moduleRQ+ " / " +descRQ+ "("+modAbbr+")");
                    objWriter.write("          " +formattedNowTime);
                    objWriter.write("\r\n"+"Name"+"\r\t"+"\r\t"+"AdmNo"+"\r\t"+"W.No"+"\r\t"+"Issue"+"\r\t"+"By"+"\r\t"+"From"+"\r\t"+"To"+"\r\t"+"PEM");
                    while(rs3.next()){                    
                    String issuedname = rs3.getString("Name");
                    String admnumber = rs3.getString("Adm_No");
                    String warnNumber = rs3.getString("WarnNo");
                    String IssueBy = rs3.getString("Issue_By");
                    String IssueDate = rs3.getString("Issue_Date");
                    String fromDate=rs3.getString("FromDate");
                    String toDate=rs3.getString("ToDate");
                    String tName=rs3.getString("TutorName");
                    String[] monthArray={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
                    /*Converting Dates to "dd/mm/yyyy" format*/
                    String day      = IssueDate.substring(8,10);
                    String month      = IssueDate.substring(5,7);
                    IssueDate= day+" "+monthArray[Integer.parseInt(month)-1];
                    day      = fromDate.substring(8,10);
                    month      = fromDate.substring(5,7);
                    fromDate= day+" "+monthArray[Integer.parseInt(month)-1];
                    day      = toDate.substring(8,10);
                    month      = toDate.substring(5,7);
                         toDate= day+" "+monthArray[Integer.parseInt(month)-1];                          
                    objWriter.write("\r\n"+issuedname+"\r\t"+admnumber+"\r\t"+warnNumber+"\r\t"+IssueBy+"\r\t"+IssueDate+"\r\t"+fromDate+"\r\t"+toDate+"\r\t"+tName);                    
                    objWriter.flush();
                    objWriter.close();
               %>
          </SCRIPT>

Do not use JSP for that. Use a servlet. You can find here an example: http://balusc.blogspot.com/2007/07/fileservlet.html

Similar Messages

  • I am trying to open CR2 files from a Cannon EOS 1DX camera in Photoshop CS6 and I have already updated the Camera Raw Plug in but Photoshop is still giving me the cannot open files dialog box? Help?

    I am trying to open CR2 files from a Cannon EOS 1DX camera in Photoshop CS6 and I have already updated the Camera Raw Plug in but Photoshop is still giving me the cannot open files dialog box? Help?

    Canon 1DX support was added to ACR in version 6.7, 7.1.  An updated CS6 should be at level ACR 8.6.  If your ACR is not at level 8.6 try using CS6 menu Help>Updates.  If that does not install ACR 8.6 try downloading the ACR and DNG 8.6 converter and see if ACR 8.6 will install into your CS6.
    Adobe - Adobe Camera Raw and DNG Converter : For Windows
    Adobe - Adobe Camera Raw and DNG Converter : For Macintosh

  • Please fix: Common Open File Dialog Box to support Favorites (Follow-up: Better provisioning in the Windows client)

    One more thing:
    What's missing is favorites is a way to use the favorites space in the Common Open File Dialog Box.
    Please obsolete or (re)develop components in Windows, so those components support any new workflows in Windows!
    On example of an application where you cannot use Favorites is Adobe Photoshop. It uses the Common Open File Dialog Box in Windows (which does not support Favorites).
    Comparing Finder (MacOS) with Windows Explorer - you "seem" to have the option of using favorites to pin folders.
    Well, if your application calls Windows to use the Common Open File Dialog Box - it's actually NOT POSSIBLE AT ALL to navigate to the user concepts (user folders) pinned to favorites.
    Again, the favorites namespace is completely unused (not provisioned) out-of-the-box. That's may be ok, however it's not fully implemented across Windows and just another example of stuff accumulating up to being unusable.
    What's missing is favorites is a way to use the favorites space in the Common Open File Dialog Box.
    Ref.: Better provisioning in the Windows client
    https://social.technet.microsoft.com/Forums/en-US/dbb2102f-00b7-47ca-88f2-4f88cd9d3409/followup-starting-launching-and-switching-?forum=WinPreview2014Feedback#2aba34e9-6074-4750-8f66-425bdeacc705
    https://social.technet.microsoft.com/Forums/en-US/168bb9f9-ab18-42e6-9f20-5e36e71f742c/merging-the-task-bar-and-the-start-screen-area?forum=WinPreview2014Feedback#168bb9f9-ab18-42e6-9f20-5e36e71f742c
    https://social.technet.microsoft.com/Forums/en-US/59a5bb6a-0368-4f34-bea4-b9811ac0bf8c/dont-forget-development-of-the-start-screen-remember-virtualization-of-it-too-purpose-is-hud?forum=WinPreview2014Feedback#59a5bb6a-0368-4f34-bea4-b9811ac0bf8c
    https://social.technet.microsoft.com/Forums/en-US/c10168fe-a534-44aa-a0ec-e9defc71da5f/better-provisioning-in-windows-client-remember-templates-for-the-start-screen-like-the-need-for?forum=WinPreview2014Feedback#c10168fe-a534-44aa-a0ec-e9defc71da5f

    Congrats to Carmelo!
     Windows Phone and Windows Store Apps Technical Guru - February 2015  
    Carmelo La Monica
    Windows Phone 8: control Nokia Maps (Part 3)
    JH: "Part 3 of the series how to work with the Nokia maps control. As the previous articles this one contains a lot of code snippets and some pictures. Good work!"
    Ed Price: "A great topic, a fantastic breakdown of sections with clear descriptions, and a nice mix of code formatting and helpful images! Another stellar article from Carmelo! Great job including the link back at the end to the portal
    article!"
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Just updated itunes now menu bar has dissapeared no black and white box at top left and ctr b does not bring anything up. i need file view etc please help driving me crazy

    just updated itunes now menu bar has dissapeared no black and white box at top left and ctr b does not bring anything up. i need file view etc please help driving me crazy

    Is the iTunes window in FullScreen mode?
    If so, press esc key.

  • When I hit the escape key to close out the open file dialog box, firefox hangs or crashes.

    When I open the "open file" dialog box using the ctrl+O and then hit the escape key to exit the box, I get an error message which I'm not able to paste here.
    it says something about a runtime problem and if I try the same thing again to reproduce the problem, it will sometimes just hang and windows vista will tell me the program is not responding.
    I've checked to see if there are any crash IDs but none were found for this time frame.
    I have even disabled all add ons.
    I'm currently using vista 64 bit edition and Firefox 6, beta edition.

    Hi,
    Please also try right-clicking on the link corresponding to the language version and '''Save Target As''' to save the Firefox installer. If the problem persists, posting [http://answers.microsoft.com/ here] would also be helpful.
    [https://www.mozilla.org/en-US/firefox/all.html Firefox Latest]

  • Open a File Dialog Box to browse through image files

    Hi all
    I need to develop a code to open a File Dialog Box to browse through Image Files in Oracle 10g.
    Once the Image File is selected i need to save the file in a Table Column in the Backend Table.
    Please help me.
    Thanks
    Nakul Venkatraman

    Hi
    Thanks for your prompt response on this.
    I came across a Sample Form File which would allow the User to browse through files from local PC.
    Following is the code :
    declare
    dirname varchar2(255);
    v_filename varchar2(255);
    begin
         message('1');
    tool_env.getvar('E:\', dirname);
    message('2');
    dirname := dirname || '\project';
    message('3');
    v_filename := get_file_name(dirname,NULL,
    'All Files (*.*)|*.*|' ||
    'JPEG Files (*.jpg)|*.jpg|' ||
    'Bitmap Files (*.bmp)|*.bmp|' ||
    'TIFF Files (*.tif)|*.tif|' ||
    'CompuServe Files (*.gif)|*.gif|' ||
    'PC Paintbrush Files (*.pcx)|*.pcx|' );
    message('4');
    if v_filename is not null then
    read_image_file(v_filename,'ANY','pp_foto.foto');
    end if;
    end;
    The code is written inside WHEN-BUTTON-PRESSED Trigger.
    When i run the form it is not opening the dialog box.
    Please help.
    Regards
    Nakul

  • How to develop a file dialog box in a oracle forms

    please help me its an urgent task,
    how to develop a file dialog box in a oracle 6i forms
    in html we will use <input type ="file"/> to open a dialog box,so that we can upload file to the server .similarly how to upload a file using oracle.

    For Windows there is a library that comes with forms d2kwutil.pll that contains a package win_api_dialog. use the open_file procedure.
    NOTE******** when you select a file from whatever windows directory you choose, it will change your working directory to that directory so right after that you will need to reassign your working directory back to what it originally was.
    Also, you will need to have d2kwut60.dll in the same directory as your d2kwutil.pll. Both come with Developer.
    Example code is
    v_runpath := win_api_environment.get_working_directory(TRUE);
    v_filename := win_api_dialog.open_file('Find File','C:\','*.*',TRUE, 0, TRUE);
    win_api_environment.set_working_directory(v_runpath,true);
    Hope this helps

  • Open file dialog box - Excel 2011

    Not sure if this is the right forum to ask a question about running Office 2011 under Mavericks.
    Since upgrading to OSX 10.9, something very odd seems to have happend to the open file dialog box in Excel. The list of the files in the current folder is displayed, but the filename column is really narrow showing just 7 characters of each name. In contrast the date modified column is incredibly wide. I can manually adjust the filename column to make it wider so I can read the filenames, but each time I reopen Excel it has defaulted back to being very narrow.
    Does anyone know if there a preference setting somewhere that I can change in order to make the width default to something more readable so I don't have to manually change it every time I want to open a file. The Word and Powerpoint open dialog boxes appear normal, so the problem seems to be confined to Excel.
    I had been running the same version of Office 2011 under Snow Leopard and the change to Excel only appeared after upgrading the OSX 10.9.

    MalcolmBebb@Honeywell wrote:
    OK, I was a bit hasty. The thanks stand. Can't see how to edit the post, please consider the rest withdrawn.
    It's okay - we all get like that at some time or other.  I dread reading my posting history for that reason. 
    I'm just glad you got exactly the help you needed. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Provide a start path (folder) in a file dialog box

    Is there a way to have a file dialog box start in a specific folder without using the File Dialog express VI? (I also don't want to use a system exec).
    Thanks.
    Richard
    Solved!
    Go to Solution.

    I was refering to functions which support the desired feature. As you already encountered, the Open/Create/Replace File.vi does not support this.
    The Express VI "File Dialog.vi" uses the same file dialog as used in the example "Write to Text File.vi". You can find the VI using the link in the help of Open/Create/Replace File.vi.
    Please note that the context help of this File Dialog states that "LabVIEW no longer supports this function on the block diagram. National Instruments recommends you use the File Dialog Express VI instead."
    I assume that this text is written due to being platform-independent. It still works under Windows, but i can think of future releases of LV not to support this feature anymore (as stated in the help).
    And still, you did not answer why you don't want to use the express vi....
    Norbert
    Message Edited by Norbert B on 09-01-2009 10:08 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Opening a File Dialog Box

    Hi,
    could somebody help me with how to open a file dialog box.
    I have 1 class which has a window with the relevant widgets on it, I want to be able to click a button on the form and pop up a file chooser form then select a file or type in a new filename and then use the selected filename path in the original form to write data out to the chosen file.
    i understand that i need to use JFileChooser and it will need to be in a new class (like a dialog box would be).
    So basically what i have is 2 classes (the main app and a class called FileOpen.class) so how would i display the fileopen class with the JFileChooser component in it and return what ever is chosen into a string.
    e.g.
    String fileName = <what would go here?>
    kind regards

    thats the example filechooser i have working
    yet when i try and implement it in my program i just get countless exception errors, im not sure if its because my program extends Jframe and not JPanel
    here is my code:-
    package as4;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.util.*;
    import javax.swing.filechooser.*;
    import java.io.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public class Readap extends JFrame {
    JPanel contentPane;
    GridLayout gridLayout1 = new GridLayout();
    JPanel jPanel3 = new JPanel();
    GridLayout gridLayout3 = new GridLayout();
    JPanel jPanel1 = new JPanel();
    JTextArea txtaStatus = new JTextArea();
    JLabel jLabel1 = new JLabel();
    JTextField txtCon = new JTextField();
    JButton btnConnect = new JButton();
    JTextField txtPort = new JTextField();
    JTextField txtUser = new JTextField();
    GridLayout gridLayout2 = new GridLayout();
    JLabel jLabel6 = new JLabel();
    JPasswordField ptxtPass = new JPasswordField();
    JLabel jLabel5 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JTextField txtHost = new JTextField();
    JPanel jPanel2 = new JPanel();
    JPanel jPanel4 = new JPanel();
    GridLayout gridLayout4 = new GridLayout();
    GridLayout gridLayout5 = new GridLayout();
    JCheckBox chbOracle = new JCheckBox();
    JCheckBox chbOdbc = new JCheckBox();
    JScrollPane jScrollPane1 = new JScrollPane();
    JRadioButton rbtnComma = new JRadioButton();
    JRadioButton rbtnTab = new JRadioButton();
    JRadioButton rbtnSpace = new JRadioButton();
    ButtonGroup delChoice = new ButtonGroup();
    JPanel delPanel = new JPanel();
    JFileChooser fc;
    int dbChoice = 1;
    int conStatus = 0 ;
    String delimiter=",";
    String output="";
    JButton btnClear = new JButton();
    Dbfuncs mydb=new Dbfuncs();
    JPanel jPanel7 = new JPanel();
    JPanel jPanel6 = new JPanel();
    JPanel jPanel5 = new JPanel();
    FlowLayout flowLayout1 = new FlowLayout();
    JButton btnExecute = new JButton();
    JTextField txtQuery = new JTextField();
    JLabel jLabel7 = new JLabel();
    JButton btnOutput = new JButton();
    JLabel jLabel8 = new JLabel();
    GridLayout gridLayout7 = new GridLayout();
    BorderLayout borderLayout1 = new BorderLayout();
    JButton btnExit = new JButton();
    TitledBorder titledBorder1;
    TitledBorder titledBorder2;
    JCheckBox chbQuotes = new JCheckBox();
    JPanel jPanel8 = new JPanel();
    JCheckBox chbHeading = new JCheckBox();
    JPanel jPanel9 = new JPanel();
    ButtonGroup fileChoice = new ButtonGroup();
    JRadioButton rbtnOverwrite = new JRadioButton();
    JRadioButton rbtnAppend = new JRadioButton();
    //Construct the frame
    public Readap() {
    fc = new JFileChooser();
    fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    //setIconImage(Toolkit.getDefaultToolkit().createImage(Readap.class.getResource("[Your Icon]")));
    contentPane = (JPanel) this.getContentPane();
    titledBorder1 = new TitledBorder("");
    titledBorder2 = new TitledBorder("");
    contentPane.setLayout(gridLayout1);
    this.setSize(new Dimension(448, 434));
    this.setTitle("Read Database");
    gridLayout1.setColumns(1);
    gridLayout1.setHgap(2);
    gridLayout1.setRows(2);
    gridLayout1.setVgap(2);
    jPanel3.setLayout(gridLayout3);
    gridLayout3.setColumns(2);
    gridLayout3.setHgap(5);
    gridLayout3.setVgap(5);
    txtaStatus.setFont(new java.awt.Font("Dialog", 0, 10));
    txtaStatus.setBorder(BorderFactory.createLoweredBevelBorder());
    txtaStatus.setEditable(false);
    txtaStatus.setText(">>Program Loaded...");
    txtaStatus.setLineWrap(true);
    txtaStatus.setRows(5);
    txtaStatus.setWrapStyleWord(true);
    jLabel1.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel1.setToolTipText("");
    jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel1.setText("Please choose a database...");
    txtCon.setText("Access");
    btnConnect.setText("Connect");
    btnConnect.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnConnect_actionPerformed(e);
    txtPort.setEnabled(false);
    txtPort.setToolTipText("");
    txtPort.setText("1521");
    gridLayout2.setColumns(2);
    gridLayout2.setHgap(5);
    gridLayout2.setRows(6);
    gridLayout2.setVgap(2);
    jLabel6.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel6.setText("Password");
    jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel5.setText("Username");
    jLabel4.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel4.setText("ODBC Bridge");
    jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel3.setText("Port");
    jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
    jLabel2.setText("Host");
    txtHost.setEnabled(false);
    txtHost.setText("alfgar.coventry.ac.uk");
    jPanel2.setLayout(gridLayout2);
    contentPane.setMinimumSize(new Dimension(100, 110));
    jPanel4.setLayout(gridLayout4);
    gridLayout4.setColumns(1);
    gridLayout4.setHgap(2);
    gridLayout4.setRows(3);
    gridLayout4.setVgap(2);
    jPanel1.setLayout(gridLayout5);
    gridLayout5.setColumns(1);
    gridLayout5.setHgap(5);
    gridLayout5.setRows(2);
    gridLayout5.setVgap(5);
    rbtnComma.setText("Comma");
    rbtnComma.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    rbtnComma_actionPerformed(e);
    rbtnTab.setText("Tab");
    rbtnTab.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    rbtnTab_actionPerformed(e);
    rbtnSpace.setText("Space");
    rbtnSpace.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    rbtnSpace_actionPerformed(e);
    rbtnComma.setSelected(true);
    jLabel8.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel8.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel8.setText("Choose Delimiter Type");
    jPanel7.setLayout(gridLayout7);
    gridLayout7.setColumns(1);
    gridLayout7.setRows(6);
    jPanel6.setMinimumSize(new Dimension(434, 45));
    jPanel6.setPreferredSize(new Dimension(434, 45));
    btnExit.setText("Exit");
    btnExit.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnExit_actionPerformed(e);
    jPanel5.setBorder(titledBorder2);
    jPanel5.setMinimumSize(new Dimension(434, 187));
    jPanel3.setBorder(titledBorder1);
    btnExecute.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnExecute_actionPerformed(e);
    chbQuotes.setText("Wrap Data In Quotes");
    chbHeading.setText("Export Column Headings");
    rbtnOverwrite.setSelected(true);
    rbtnOverwrite.setText("Overwrite File");
    rbtnAppend.setText("Append File");
    jPanel7.setBorder(BorderFactory.createLineBorder(Color.black));
    btnOutput.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnOutput_actionPerformed(e);
    delChoice.add(rbtnComma);
    delChoice.add(rbtnTab);
    delChoice.add(rbtnSpace);
    delPanel.add(rbtnComma);
    delPanel.add(rbtnTab);
    delPanel.add(rbtnSpace);
    chbOracle.setAlignmentX((float) 10.0);
    chbOracle.setHorizontalAlignment(SwingConstants.CENTER);
    chbOracle.setText("Oracle");
    chbOracle.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    chbOracle_actionPerformed(e);
    chbOdbc.setAlignmentX((float) 10.0);
    chbOdbc.setHorizontalAlignment(SwingConstants.CENTER);
    chbOdbc.setSelected(true);
    chbOdbc.setText("MS ODBC");
    chbOdbc.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    chbOdbc_actionPerformed(e);
    btnClear.setText("Clear Status");
    btnClear.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    btnClear_actionPerformed(e);
    jPanel6.setLayout(flowLayout1);
    jPanel5.setLayout(borderLayout1);
    btnExecute.setText("Execute");
    txtQuery.setMinimumSize(new Dimension(280, 21));
    txtQuery.setPreferredSize(new Dimension(285, 21));
    jLabel7.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel7.setText("Enter Query");
    btnOutput.setText("Output To File");
    jPanel3.add(jPanel1, null);
    jPanel1.add(jPanel4, null);
    jPanel4.add(jLabel1, null);
    jPanel4.add(chbOdbc, null);
    jPanel4.add(chbOracle, null);
    jPanel1.add(jScrollPane1, null);
    jScrollPane1.getViewport().add(txtaStatus, null);
    jPanel3.add(jPanel2, null);
    jPanel2.add(jLabel2, null);
    jPanel2.add(txtHost, null);
    jPanel2.add(jLabel3, null);
    jPanel2.add(txtPort, null);
    jPanel2.add(jLabel4, null);
    jPanel2.add(txtCon, null);
    jPanel2.add(jLabel5, null);
    jPanel2.add(txtUser, null);
    jPanel2.add(jLabel6, null);
    jPanel2.add(ptxtPass, null);
    jPanel2.add(btnClear, null);
    jPanel2.add(btnConnect, null);
    jPanel6.add(jLabel7, null);
    jPanel6.add(txtQuery, null);
    jPanel6.add(btnExecute, null);
    jPanel7.add(jLabel8, null);
    jPanel7.add(delPanel, null);
    jPanel7.add(jPanel8, null);
    jPanel8.add(chbQuotes, null);
    jPanel8.add(chbHeading, null);
    jPanel7.add(jPanel9, null);
    jPanel9.add(rbtnOverwrite, null);
    jPanel9.add(rbtnAppend, null);
    jPanel7.add(btnOutput, null);
    jPanel7.add(btnExit, null);
    jPanel5.add(jPanel6, BorderLayout.NORTH);
    jPanel5.add(jPanel7, BorderLayout.SOUTH);
    contentPane.add(jPanel3, null);
    contentPane.add(jPanel5, null);
    fileChoice.add(rbtnOverwrite);
    fileChoice.add(rbtnAppend);
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    public static void main (String arguments[])
    JFrame frame = new Readap();
    WindowListener l = new WindowAdapter()
         public void windowClosing(WindowEvent e)
              System.exit(0);
    frame.addWindowListener(l);
    frame.pack();
    frame.setVisible(true);
    void chbOracle_actionPerformed(ActionEvent e) {
    dbChoice=0;
    chbOdbc.setSelected(false);
    jLabel4.setText("Conn String");
    txtCon.setText("acal");
    txtCon.setEnabled(true);
    txtPort.setEnabled(true);
    txtHost.setEnabled(true);
    txtaStatus.append("\n>>Oracle Database Selected");
    void chbOdbc_actionPerformed(ActionEvent e) {
    dbChoice=1;
    chbOracle.setSelected(false);
    jLabel4.setText("ODBC Bridge");
    txtCon.setText("Access");
    txtPort.setEnabled(false);
    txtHost.setEnabled(false);
    txtaStatus.append("\n>>MS ODBC Database Selected");
    void btnConnect_actionPerformed(ActionEvent e) {
    if (conStatus==0)
    String url = new String();
    String driver = new String();
    if (dbChoice==0)
    driver="oracle.jdbc.driver.OracleDriver";
    url = "jdbc:oracle:thin:@"+txtHost.getText()+":"+txtPort.getText()+":"+txtCon.getText();
    txtaStatus.append("\n>>Connecting to Oracle Database @ "+url+" via driver:"+driver);
    else
    driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    url = "jdbc:odbc:"+txtCon.getText();
    txtaStatus.append("\n>>Connecting to MS ODBC Database @ "+url+" via driver:"+driver);
    String dbStatus=mydb.openDb(url, driver, txtUser.getText(), ptxtPass.getText());
    txtaStatus.append("\n>>"+dbStatus);
    if (dbStatus=="Connection Successful")
    btnConnect.setText("Disconnect");
    conStatus=1;
    else
    mydb.dbClose();
    txtaStatus.append("\n>>Database Connection Terminated");
    btnConnect.setText("Connect");
    conStatus=0;
    void btnClear_actionPerformed(ActionEvent e) {
    txtaStatus.setText(" ");
    void rbtnComma_actionPerformed(ActionEvent e) {
    delimiter=",";
    void rbtnSpace_actionPerformed(ActionEvent e) {
    delimiter=" ";
    void btnExecute_actionPerformed(ActionEvent e) {
    txtaStatus.append(mydb.runQuery(txtQuery.getText() ) );
    void btnOutput_actionPerformed(ActionEvent e) {
    if (chbHeading.isSelected()==true)
    output=mydb.getAllColName(mydb.getColumnName())+"\n";
    else
    output="";
    Vector mydata=mydb.getResultData();
         int cnt=0;
         for (int index = 0; index < mydata.size(); index++)
              cnt+=1;
              if (cnt>1) output=output+delimiter;
    if (chbQuotes.isSelected()==true)
              output=output+"\""+mydata.elementAt(index)+"\"";
    else
    output=output+mydata.elementAt(index);
              if (cnt>=mydb.getNumCols())
                   output=output+"\n"; cnt=0;
    txtaStatus.append("\n>>"+output);
    int returnVal = fc.showOpenDialog(Readap.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file = fc.getSelectedFile();}
    void rbtnTab_actionPerformed(ActionEvent e) {
    delimiter="\t";
    void btnExit_actionPerformed(ActionEvent e) {
    System.exit(0);
    }

  • File Dialog Box often takes a long time to execute

    Hi all
    The Labview File Dialog Box Express VI sometimes takes 5 to 10 seconds to execute. On other occasions, it executes in a blink of an eye. Why is that so?
    I have tried to use the older Open/Create/Replace File VI as suggested in one of the forum's posts...but it behaves exactly the same way. Another problem is the trimming of the filename, which has also been reported and has NOT YET been solved.
    (By the way...Recently, I updated to LV 2012 SP2 by suggestion of the NI Update Manager, only to find out that I was not entitled to this SP (which apparently only includes bug fixes) and I will have to roll back to LV 2012. Still,  in the evaluation version I can see that the bug is not fixed. Labview must have a lot of serious bugs for NI to ask for a paid bug fix, in which some bugs remain after having been reported a long time ago..well...)
    What worries me now is that intermittent lag in the execution of the File Dialog (such a basic basic function of a program...). Anyone have any idea about this? The support menu said "Ask an engineer"...any of the NI engineers has any suggestion?
    Regards
    Helder
    Attachments:
    FileDialogTest.vi ‏26 KB

    First of all: Thank you very much for the objective answer. I suppose that yor actually ARE a NI engineer, as I had hoped for.
    lease find my comments above (helder---------------------)
    helder wrote:
    The Labview File Dialog Box Express VI sometimes takes 5 to 10 seconds to execute. On other occasions, it executes in a blink of an eye. Why is that so?
    What worries me now is that intermittent lag in the execution of the File Dialog (such a basic basic function of a program...). Anyone have any idea about this?
    The file dialog is provided by the OS, so if it is slow it is not LabVIEW's fault.
    What kind of computer do you have? Is this a laptop that spins down the HD to save power? In this case it needs to wait for the HD to spin up. (You can change the windows power profile or you can spend more money and get an SSD).
    Are you very low on memory?
    Does your LabVIEW program waste 100% CPU in parallel doing nothing due to bad coding?
    Are you pointing to a location that has millions of files?
    Are you pointing to a network location?
    helder:---------------------------------------
    I understand that the File Dialog is provided by the OS. But I have other applications on my PC and this doesn't happen - just in Labview. Sorry! And sometimes it
    doesn't happen. Every 10 times I open the File dialog Box, 5 times it takes long and 5 times it is immediate.
    (I am not low on memory, my coding is not bad>-look at the VI I sent, it just contains the fragment which uses the File Dialog Box and it behaves the same way! I am pointing to the same location that the other applications point to, I am not pointing to a network location, the PC is not spinning the disk down, etc etc.)
    But yes, I will try it on another PC
    (There was another post on the forum on this issue, but can't seem to find it now, just find my own post )
    I attach a video demo of what happens.
    helder wrote:
    Another problem is the trimming of the filename, which has also been reported and has NOT YET been solved.
    What problem is that? Can you elaborate? There is a known bug in the windows dialog box that sometimes the pre-filled file names are shifted and not fully visible. This is a windows bug documented by Microsoft and LabVIEW has no control over it. It is not NIs job to fix OS problems.
    helder:-------------------------------------------
    Of course you can't fix the OS.
    If it is a windows bug, we will have to live with it.
    A previous post on your forum did not provide me with that information (http://forums.ni.com/t5/LabVIEW/File-dialog-trimmi​ng-the-default-name/td-p/2189874). The fact that it is a windows bug was not mentioned there. 
    helder wrote:
    Hi all
    (By the way...Recently, I updated to LV 2012 SP2 by suggestion of the NI Update Manager, only to find out that I was not entitled to this SP (which apparently only includes bug fixes) and I will have to roll back to LV 2012. Still,  in the evaluation version I can see that the bug is not fixed.
    Patches are included, service packs are not included. I think this is well documented. Most users are on SSP, this way you are always entitled to the newest version.
    As with anything else, software has bugs. It is impossible to test a huge, complex system like LabVIEW under all scenarios. The possible number of combinations of hardware and other installed software on any particular computer probably exceeds the number of atoms in the universe. It is actually amazing how few bugs there are and how well it works. What "bug" are you talking about? Bugs are prioritized according to rules. Critical bugs are typically fixed very quickly. A cosmetic issue that only affects you and nobody else will take longer or might not even get fixed. Are you talking about a confirmed bug that could be reproduced by NI? Do you have a CAR#?
    helder:----------------------------------------
    I was referring to the file-name-shifting-cosmetic-bug that the October-2012 post had indicated. But if it is a Windows-bug, NI does not have any responsibility, of
    course.
    Regarding the bugs, of course they are unavoidable.
    helder wrote:
    Labview must have a lot of serious bugs for NI to ask for a paid bug fix, in which some bugs remain after having been reported a long time ago..well...)
    That sentence makes no sense! Why would the number of serious bugs depend on the cost of upgrading?? You are just rambling here....
    In an ideal world, NI would have an unlimited number of programmers that can work 24/7 to immediately fix any discovered bug. This would only be possible if all users are willing to pay an unlimited amount of money for the software. As I mentioned, bug fixes are free in the form of patches, and they come out regularly. Service packs include new features and are not free.
    helder:---------------------------------------
    "....include new features"..????
    ---->>From http://www.ni.com/labview/release-details/
    "LabVIEW 2012 Service Pack 1 is an exclusive update to LabVIEW 2012 for NI Standard Service Program (SSP) customers. There are no new product features introduced in service pack releases; instead, these releases provide bug fixes and improved stability for LabVIEW 2012. For a list of these bug fixes, click here."
    No new features, just bug fixes!"
    Moreover: If it isn't free, it shouldn' have let me update if I am not a SSP costumer.
    Now I have a 45 days evaluation version. After that, I have to uninstall and reinstall everything.That takes some time and effort.
    If there is a more direct way of rolling back t the previous version, please let me know.
    Thank you

  • How to create a custom file dialog box/vi (win)??

    Hello,
    I'd like to create a custom file dialog box to handle the reading of my tdms files. Basicly I want to extend the existing file select dialog box with a graphical preview of the data in the selected file. I know I can create all the logic for file selection by hand and use a list box to display the filelist, but I would rather prefer to somehow use the existing windows controls. So is it possible to get the windows file selector on the front panel of a vi and react to the user selection? If so, is there any example available on how to do this? Any other options? I'm using labview 8.2
    thanks for your input!
    klaus

    Klaus,
    I wouldn't know that Microsoft provides access to the controls that Explorer and file dialog consist of.
    There might be a different and more powerful solution though. The
    WINDOWS Explorer / file dialog have a plugin API that allows you to
    associate your own application for thumbnail creation with a particular
    file extension. That way, TDMS thumbnails will show in any instance of
    Explorer and
    File Dialog without you having to make your own dialog. Basically, you
    would need to compile the VI that creates the thumbnail into a
    LabVIEW-built DLL and then wrap this DLL with some C++ boilerplate code
    that Microsoft provides. You might want to have a look at the bottom of
    this article to get an idea of how the whole thing works:
    http://msdn.microsoft.com/msdnmag/issues/0600/w2kui2/default.aspx.
    Hope that helps,
    Herbert

  • How to open a save file dialog box in form

    hi
    all
    I have prob in form desing , i have open the save file dialog box , how to open a save dialog box
    and path of the select file to save in disk
    help
    thx

    hi
    user this query when-button-pressed trigger
    :txtfile := GET_FILE_NAME(directory_name =>'d:\ali_raza\backup\', file_filter=> 'DMP Files (*.dmp)|*.dmp|');
    Rizwan

  • File dialog box: how get  full path and filename

    Hello All
    i have a problem to save the full path and filename with file dialog box.
    I want to save full path and filename in the database for creating a link to a file.
    I use a file-dialogbox to choose a file.
    I see in the textfiled something like this
    \FULLPATH\filename.ppt
    but when i save the textvalue in the database or look at the seesionvalue I see
    this:
    F2087258868/filename.ppt
    but I need the full path to create a link. How I can get?
    I use version 2.2.1..
    Thanks
    Putcho

    Hi Putcho,
    You can create some javascript that puts it into a hidden item.
    In HTML Form Element Attributes: onChange="$x('P15_X').value=$x('P15_FILE').value;" Then create another process that stores the value of the hidden item in your own table...
    I quickly made an example with a normal text item, so you see it copies itself to the other box: http://apex.shellprompt.net/pls/apex/f?p=286:15
    Hope that helps,
    Dimitri
    http://dgielis.blogspot.com

  • Problem using the File Dialog Box in a Client/Server application

    I am developping a client-server application using Labview 5.1 . The application on the server acquires data from some instruments and saves it on file, while the application on the clients displayes such acquired data. For doing this I call some routines on the server via the "Open Application vi" (remote connection). All goes well except when I open on the server the "File Dialog Box vi" : in this case the application on the clients is blocked (is blocked the execution of the called vi on the server). Only when
    the File Dialog Box on the server is closed, the execution of the called vi on the server starts again.
    I need to use the File Dialog Box on the server, but I don' t want to stop at the same time
    the clients !!
    I need help for resolving such problem.
    Many thanks in advance !!!

    Hi!
    waldemar.hersacher wrote:
    "It seems that the VIs called by the clients are running in the user interface thread.
    A call to the file dialog box will call a modal system dialog. So LV can't go on executing VIs in the user interface thread."
    Are you sure? I think, that File Dialog, called by LabVIEW File Dialog from Advanced File Functions Palette doesn't blocking any cycles in subVI, which running in UI Thread. Look in my old example (that was prepared for other topic, but may be good for this topic too).
    2 linus:
    I think, you must a little bit reorganize you application for to do this. You must put your File Dialog into separated cycle. This cycle, of course, will be blocked when File Dialog appear on the screen. But other cy
    cle, which responsible for visualization will run continuosly at the same time...
    Attachments:
    no_block_with_file_open_dialog.zip ‏42 KB

Maybe you are looking for