Changing panels in frame at runtime using NetBeans

Hi there,
I'm having trouble changing JPanels in a JFrame at runtime when they were both generated in NetBeans. I find that I can do this easily in a manually coded GUI with the code below. However with NetBeans generated frames and panels it doesn't seem to work.
So all I really would like to learn is how to change JPanels in a JFrame at runtime when both are generated by NetBeans (New>JFrame Form... and New>JPanel Form...) Any help would be much appreciated.
        // reset panel
        pMain.removeAll();    // main panel added to nb generated frame
        pMain.validate();     // call layout manager
        testPanel = new TestPanel();  // this class extends JPanel (generated)
        pMain.add(testPanel);     // add new panel
        pMain.setVisible(true);     // update panel
        pMain.revalidate();
        pMain.repaint();

Changing the layout to BorderLayout and adding the new panel to BorderLayout.CENTER with your code sample above doesn't seem to work though.This works for me.
I created a frame form and a panel form then set the frame layout to border layout and added a remove/add panel at the south.
frame code looks like this.
import java.awt.BorderLayout;
public class MainFrame extends javax.swing.JFrame {
private boolean isAdded;
private TestPanel panel; // this is the panel form
/** Creates new form MainFrame */
public MainFrame() {
isAdded = false;
initComponents();
// Generated code
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
if(!isAdded) {
panel = new TestPanel();
add(panel, BorderLayout.CENTER);
pack();
isAdded = true;
} else {
remove(panel);
isAdded = false;
validate();
repaint();
* @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 jButton1;
// End of variables declaration
Somehow I find it very hard to believe that NetBeans is not production ready....The reason we don't use the DnD in nb is that the generated code is not editable and it's hard to maintain.

Similar Messages

  • Frame Moving Runtime using Look and Feel

    Hi All,
    I need creating Frame Moving runtime using Look and feel (Oracle forms 10 g with swing concept). If any bodies know give me a idea and demo files.
    Thanks and Regards
    M.Sathiya

    Dear Francois,
    Thanks all are working good and result also perfect but frame and DnD is not properly working compile time no problem only problem is run time it given error :java.lang.VerifyError:(class:oracle/forms/fd/frame$FrameBorder;methed <init> Signature:(Loracle/forms/fd/frame;)V) please tell me how can solve this problem.
    Regards,
    M.Sathiya

  • Change panel in japplet at runtime

    I am fairly new to java, but here is what i am trying to do. I would like to have a button, when pressed, change a panel in my japplet and repaint. is this possible? i do not know anything about tabbed panes (i leanred with 1.2) so i'd like to stay away from them if i can. if anyone can help, i'd appreciate it.

    I would like to have a button, when pressed, change a panel in my japplet and repaint. is this possible?yes, Look at java.awt.CardLayout
    i do not know anything about tabbed panes (i leanred with 1.2) so i'd like to stay away from them if i can. they're pretty damn easy

  • How to change Flex Application frame rate at runtime

    hello,
    i have Flex application that need to change the Frame Rate at
    runtime.
    when i am changing it by using the slider component, here the
    code:
    private function onChangeSlider(e:Event):void
    frameRate = sliderFR.value;
    trace(frameRate);
    <mx:HSlider id="sliderFR" x="452" y="765" width="378.2"
    minimum="1" maximum="50" liveDragging="true" snapInterval="1"
    value="25" change="onChangeSlider(event)"/>
    the value is changed, but the frame rate is not changed.
    when i insert the binding to the <Application> tag i
    got error on this one, because i can't bind there items for the
    application level.
    how can i change the Flex frame rate at runtime?

    i found the solution!
    in Flex application you have frameRate properties that
    doesn't work at runtime in the ActionScript code.
    if you have a video that you want to change the speed of it,
    you need to change the stage.frameRate (of all the Player itself).
    and there is a catch here. if you will try to change it right after
    the application will start (like in: creationComplete event) you
    will have a runtime error.
    what you need to do is, change the stage.frameRate value
    after the all application is started from a button or other event
    in the system.
    this is working grate for fast/slow FLV playing
    enjoy!

  • How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    I don't think Finder does this (I've tried).
    iTunes does though. Where you can set artwork or the "poster frame"...
    This may not be what you want but if it helps, I know 2 ways  do this is
    Open the video in QuicktimePlayer7 | View | Set Poster Frame (even then, you might need to save it as .mov (ie in a 'mov container').
    Drag the file into iTunes and set the artwork (as in http://www.dummies.com/how-to/content/adding-album-cover-art-or-images-in-itunes .html)
    From there, iTunes will use that frame as the "poster frame" ie the photo/frame that shows when you browse your videos. Which is what you want, but limited to iTunes.
    When I do either of these above, the frame I set does not show when exploring files in "Finder" (or in the other Explorer tool I use called "Pathfinder").
    So it maybe, that exactly what you want, is not possible.

  • Changing picture at runtime using delphi

    Post Author: iman_400
    CA Forum: Other
    Please help me, is there anyway we can change picture at runtime using delphi 7.0 and CRXIR2?

    Hi, Lee;
    For the version of Crystal Reports that comes with .NET, you can use something like one of our samples shows:
    https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe
    Look for the sample, vbnet_win_DynamicImage.zip. It uses an ADO.NET dataset to change the image.
    For Crystal Reports XI R2 and Crystal Reports 2008, you can more directly change the image location using built in functionality.
    In the Designer, choose Insert > Picture. Choose a default image to show and save it. Right-click on it and select Format Graphic. Go to the Picture tab and click the formula button for Graphic location. Save the report.
    Then, at runtime you can populate the Formula with the new location for your image, either a URL or disk file location.
    See the following note for more information:
    [Image|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333333373334%7D.do]
    Best Regards,
    Jonathan

  • When I use the selection tool to move vector points and bend edges, I only see the change in wire frame.

    When I use the selection tool to move vector points and bend edges, I only see the change in wire frame.  Once I commit by letting go of the mouse button, the object does change.  It just previews with a wire frame. I would like to see the preview change on the solid object.  Is there a setting somewhere?
    I sure hope I am explaining this for people to understand .
    Thanks
    Ed

    Hi Ed,
    What do you mean by wire frame??And are you using selection or sub-selection tool since you have mentioned about vector point I doubt if it is sub-selection tool.Could you please attach a video demonstrating the issue where we see the mismatch in the preview and the output, so that we can understand the problem better and try to resolve it.
    Thanks,
    Sangeeta

  • How can I change the state of a runtime menu item programati​cally?

    Using LabView 6.1, I would like to change the state of the runtime menu item "Operate/Print at completion".
    The goal here is to print the VI front panel according to the operator choice (OK ->print, Cancel ->don't print)
    In a first release, I put a Stop function at the dialog output (activated by the cancel button) but this function stop the complete application and my idea where to stop only the VI in which the dialog is running.
    In a second release, I've tried to use the "Application
    control/Menu" but I receive every time an error:
    Error 88 occured at Cannot modify application menu item in the printtest.vi.
    Possible reasons: LabView, Runtime menu error...
    Any suggestion is appreciated.
    Re
    gards,
    phidu

    Instead of using the print at completion option, print the VI programatically if the user selects to print...open a reference to the VI you want to print and use an invoke node to print vi to printer.
    Alternatively create another VI with a layout optimized for printout, set it to print at completion and run and load the data into that VI if and only if the user OKs the print...
    Mads
    MTO

  • How do you create beans using NetBeans 5.5?

    I am referring to http://java.sun.com/docs/books/tutorial/javabeans/nb/index.html and I'm sorry but I can't follow any of this!
    I have NetBeans IDE 5.5 and I am trying to learn how to write beans using NetBeans, and the lessons involve things I can't find or understand, for example:
    re: http://java.sun.com/docs/books/tutorial/javabeans/writingbean/index.html
    <blockquote>
    Load the JAR file. Use the NetBeans IDE GUI Builder to load the jar file as follows:
    1. Start NetBeans.
    2. From the File menu select "New Project" to create a new application for your bean. You can use "Open Project" to add your bean to an existing application.
    3. Create a new application using the New Project Wizard.
    4. Select a newly created project in the List of Projects, expand the Source Packages node, and select the Default Package element.
    5. Click the right mouse button and select New|JFrameForm from the pop-up menu.
    6. Select the newly created Form node in the Project Tree. A blank form opens in the GUI Builder view of an Editor tab.
    7. Open the Palette Manager for Swing/AWT components by selecting Palette Manager in the Tools menu.
    8. In the Palette Manager window select the beans components in the Palette tree and press the "Add from JAR" button.
    9. Specify a location for your SimpleBean JAR file and follow the Add from JAR Wizard instructions.
    10. Select the Palette and Properties options from the Windows menu.
    11. Expand the beans group in the Palette window. The SimpleBean object appears. Drag the SimpleBean object to the GUI Builder panel.
    </blockquote>
    Sorry, you lost me literally after "Start NetBeans", the rest is Hungarian. I can't find "New Project Wizard"; I can't find "List of Projects", I can't find anything they are talking about nor do I know if any of this is relevant toward my learning how to write beans.
    Re: http://java.sun.com/docs/books/tutorial/javabeans/properties/properties.html
    "Inspecting Properties" seems impossible to do because the Inspector Window only shows a closed folder and nothing else ever. I can't figure out this part of the tutorial either.
    Can someone please explain this 3rd-grade-level to me: How to create a bean using NetBeans?
    Thanx
    Phil

    Phil,
    Before you embark on another very frustrating advanture using NetBeans, please go t hrough the NetBeans tutorial. The "New Project Wizard" is just select from the menu options -- "New Project". The "Hungarian" as you put it will not get better until you spend some time learning NetBeans. Learning something new, like beans, is frustrating enough, but to try to do it and use a tool that is not familiar may be beyond many individuals frustration level.
    Les

  • How to change the picture frame size in Lightroom 5 Book

    I would like to control the actual picture frame size when making a Book in Lightroom 5. Or else know the sizes of the different picture frames provided by choosing the different page layouts. That way I can either change the picture frame dimensions to accomodate each photo or change the image size to fit in the offered picture frame. I find that using the software as is winds up cropping the images in unwanted ways. Modifying the picture frame would be my preferred alternative. Appreciate any ideas

    Hi again Tony,
                I have been using Adobe Photoshop 7, Photoshop Elements, Perfect Photo Suite, Photo Studio, etc., changing Image size, placing a picture on a page and then, do a simple last minute size adjustment by using the arrows to stretch or shrink it in place. Things would be a lot simpler if I could do the same thing with the cells in Lightroom 5. Cell pad adjustments do not fill the bill.
    I think we’ve pretty much concluded this exchange. Thanks again for your effort.
        david
    ay [email protected]
    Sent: Wednesday, March 12, 2014 11:27 PM
    To: dgbrow
    Subject: How to change the picture frame size in Lightroom 5 Book
    Re: How to change the picture frame size in Lightroom 5 Book
    created by Tony Jay <http://forums.adobe.com/people/Tony+Jay>  in Photoshop Lightroom - View the full discussion <http://forums.adobe.com/message/6205206#6205206

  • Change of Video Frame One Sample Out of Sync with Correct Point on Timeline

    Change of Video Frame One Sample Out of Sync with Correct Point on Timeline.
    It has been found on the author's PC that, in Audition 3 in Multitrack View, a video file displayed in the video window will change its frame one sample later than it should do with respect to the correct point on the timeline. This has led to extra work having to be done by the author, as detailed later.
    To demonstrate this issue:
    Create a new multitrack session. Enable the Time and Video windows. Enable only 'Snap to Frames'.
    Using an external program, render a two-frame video clip at 25fps. Let the first frame contain the letter 'A', and the second frame contain the letter 'B'. Making sure that the Display Time Format is set appropriately, in this case at 'SMPTE 25 fps (EBU)', lock this clip on the multitrack timeline, ensuring that the clip starts at time 00:00:00:00.
    Create a mono audio clip of silence at 48kHz 32-bit that is two frames long. Lock it on an audio track, ensuring that the clip starts at time 00:00:00:00.
    Place the cursor at time 00:00:00:01 and create a cue marker at this point by pressing F8.
    Zoom into the timeline so that approximately twenty samples are visible, with the cursor lying on the cue marker in the middle of the screen. The Time window should display 00:00:00:01. The Video window should display the letter 'A'.
    Move the cursor back in time (leftwards) by one sample. The Time window should change its display to 00:00:00:00, whilst the Video window should still show the letter 'A'.
    Move the cursor forwards in time (rightwards) by one sample, so that it overlays the cue marker again. The Time window should change its display back to 00:00:00:01, whilst the Video window remains showing the letter 'A'.
    Move the cursor forwards in time (rightwards) by one more sample. The Time window's display should remain at 00:00:00:01, but the Video window should now display the letter 'B'.
    As can be seen from the above steps, the video's change of frame content occurs incorrectly one sample later than it should; the change of video frame content should occur simultaneously with the change of the frame number displayed in the Time window, which is at the point that the cue marker has been placed.
    The practical effect of this issue is that it has caused the author a huge amount of extra work on an 89-minute long soundtrack-for-video timeline. There were over 1100 changes of shot which the author wished to mark by placing cue markers at the beginning of every shot. This should have been a quite simple process of enabling 'Snap to Frames', stepping through the video, and laying cue markers down by pressing F8 when the shot was seen to change.
    Because currently the Video window (referencing the cursor laying over a cue marker
    i that has been placed on the timeline using the 'Snap to Frames' option
    ) will actually display the end moments of the previous frame rather than the beginning moments of the current frame, laying down a cue marker when the shot is seen to change will actually place that marker at the beginning moments of the second frame of the new shot, not at the beginning moments of the first frame of the new shot, i.e. the cue marker placed will be one frame later in time than it should be. If it is wished for the cue marker to, as best it can, represent the beginning moments of the first frame of the new shot, it has to be manually repositioned so that it is at least a sample later in time than the time at which the shot has actually changed, in order for the Video window to correctly display the content.
    The author had to manually reposition all 1100+ cue markers.
    Ideally, the Video window should display a change of video frame in synchronization with the change of the frame display in the Time window, which occurs at the position of the 'Snap to Frames' point.
    Part of the PC system's specification is detailed below:
    Windows XP Professional Version 2002 SP3;
    Adobe Audition 1.0 Build 3211.2;
    Ad

    obe Audition 2.0 Build 5306.2;
    Adobe Audition 3.0 Build 7283.0;
    ASRock 775dual-VSTA motherboard, BIOS Version P.3.00;
    2.80 GHz Intel Pentium D Processor 915 2x2MB L2 Cache;
    2GB DDRII 667 RAM;
    Matrox G550 DualHead AGPx4 VGA card for Audition's two main work screens;
    Matrox Productiva G100 MMS PCI VGA for two additional "static" information screens;
    4 x PATA HDDs for OS & programs, swapfile & temp, project file sources, and guide audio;
    Onboard Realtek ALC888 7.1 channel audio CODEC with High Definition audio;
    Lite-On DVDRW LH-18A1P;
    VIA OHCI Compliant IEEE 1394 Host Controller.
    ASIO4ALL version 2.8;
    Via Hyperion Drivers 5.16a - (VIA Chipsets INF Update Utility V3.00A, VIA PATA IDE Driver Package V1.90, VIA SATA IDE Driver Package V2.30A, AGP V4.60A);
    Matrox PowerDesk-SE 11.10.400.03;
    Matrox Millennium G550 Display Driver Version 5.99.005;
    Realtek High Definition Audio System Software Version R1.91, Audio Driver Version 5.10.0.5605;
    DirectX 9.0c March 2008;
    Microsoft .NET frameworks 1.1, 2.0 and 3.0 with all service packs.

  • GUI - Using NetBeans

    Hi,
    I am new to using NetBeans and have built a basic GUI using it. However, I want to change the background colour of my GUI to black and cant see how to do this using NetBeans. Please could someone explain to me how to do this.
    My code is as follows :-
    * GUIII.java
    * Created on 29 November 2007, 19:47
    package my.GUIII;
    public class GUIII extends javax.swing.JFrame {
    /** Creates new form GUIII */
    public GUIII() {
    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.
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jLabel1 = new javax.swing.JLabel();
    jDialog1 = new javax.swing.JDialog();
    jPanel1 = new javax.swing.JPanel();
    jButton5 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton1 = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jLabel1.setText("jLabel1");
    javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
    jDialog1.getContentPane().setLayout(jDialog1Layout);
    jDialog1Layout.setHorizontalGroup(
    jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 400, Short.MAX_VALUE)
    jDialog1Layout.setVerticalGroup(
    jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 300, Short.MAX_VALUE)
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Guiness Rugby League");
    setBackground(new java.awt.Color(0, 0, 0));
    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
    jButton5.setText("Exit");
    jButton4.setText("Clear");
    jButton3.setText("Update Database");
    jButton2.setText("Read Database");
    jButton1.setText("Read File");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
    .addComponent(jButton1)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jButton2)
    .addGap(18, 18, 18)
    .addComponent(jButton3)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jButton4)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jButton5)
    .addGap(36, 36, 36))
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addGap(20, 20, 20)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jButton1)
    .addComponent(jButton3)
    .addComponent(jButton4)
    .addComponent(jButton5)
    .addComponent(jButton2))
    .addContainerGap(21, Short.MAX_VALUE))
    jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\Blampied\\Desktop\\P_GPremLogo.gif")); // NOI18N
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(117, 117, 117)
    .addComponent(jLabel2))
    .addGroup(layout.createSequentialGroup()
    .addGap(25, 25, 25)
    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 457, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addContainerGap(42, Short.MAX_VALUE))
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 446, Short.MAX_VALUE)
    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addContainerGap())
    pack();
    }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new GUIII().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JDialog jDialog1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration
    }

    Use Component's setBackground method; See this tutorial that has examples of its use:
    http://java.sun.com/docs/books/tutorial/uiswing/components/jcomponent.html
    Please post future Swing questions in the Swing forum.

  • *** Canu2019t Change ServerName or DatabaseName At Runtime In Crystal Report!!!

    Canu2019t Change ServerName or DatabaseName At Runtime In Crystal Report. Why?
    HI thereu2026 This is just a simple Winform(not ASP) with a Crystal Report Viewer control on it that was called by another simple WinForm. Iu2019m trying to simply change the Server Name for a Crystal Report at runtime and it will not let me. Hereu2019s the code below. The database is identical to my development server database. This should be easy to do as I did below. I use SQL Server 2005(SPK 2) and Visual Basic 2008. I use the Crystal Reports 2008 standalone designer(seperate program), not the older one in the VS IDE. When I run the code it accepts changes to the user name and password but ignores any change to the ServerName or DatabaseName. Why?
    Mike in Los Angeles, Calif, USA
    Imports CrystalDecisions.CrystalReports.Engine
    Public Class CrystalReportForm2
        Private Sub CrystalReportForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            CrystalReportViewer1.LogOnInfo = New CrystalDecisions.Shared.TableLogOnInfos()
            Dim LogonInfo As New CrystalDecisions.Shared.TableLogOnInfo
            LogonInfo.TableName = "clients"
            'Force crystal report to use a different server AT RUNTIME than the development server!
            LogonInfo.ConnectionInfo.ServerName = "DATASERVER2"    u2018<- ignores changes to this!!
            LogonInfo.ConnectionInfo.DatabaseName = "CMSDATASQL"   u2018<- ignores changes to this!!
            LogonInfo.ConnectionInfo.UserID = "SQL_USER"           u2018<- accepts changes to this!!
            LogonInfo.ConnectionInfo.Password = "34567WERTD"       u2018<- accepts changes to this!!
            CrystalReportViewer1.LogOnInfo.Add(LogonInfo)
            'Testing only below!
            ' MsgBox("ServerName =" & CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.ServerName)
            'MsgBox("DatabaseName =" & CrystalReportViewer1.LogOnInfo(0).ConnectionInfo.DatabaseName)
            CrystalReportViewer1.SelectionFormula = "{openclientsquery.lastname} like  'c*'"
            'CrystalReportViewer1.SelectionFormula = "{clients.clientid} = '1111111'"
            CrystalReportViewer1.Refresh()
        End Sub
    End Class
    Edited by: Mike JJJ on Dec 25, 2008 7:26 PM
    Edited by: Mike JJJ on Dec 25, 2008 7:30 PM

    Yes, you have to simply loop through all the tables in the report and assign each one the same logon info and then reassign the report and refresh the report viewer. No need to use a .Net Dataset here. Eventhough I got the answer myself from studying the Crystal API reference thanks to all that answered! Hopefully this will help others. Mike in Los Angeles, Calif, USA.
    Imports CrystalDecisions.CrystalReports.Engine
    Public Class CrystalReportForm2
        Private Sub CrystalReportForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim MyReport As New Clients 'Instance of report!!!
            Dim myLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo
            Dim myTable As Table
            For Each myTable In MyReport.Database.Tables
                myLogonInfo = myTable.LogOnInfo
                myLogonInfo.ConnectionInfo.ServerName = " DATASERVER2"
                myLogonInfo.ConnectionInfo.DatabaseName = "CMSDATASQL"
                myLogonInfo.ConnectionInfo.UserID = "SQL_USER"
                myLogonInfo.ConnectionInfo.Password = "34567WERTD"
                myTable.ApplyLogOnInfo(myLogonInfo)
            Next myTable
            CrystalReportViewer1.ReportSource = MyReport
            CrystalReportViewer1.SelectionFormula = "{openclientsquery.lastname} like  'c*'"
            CrystalReportViewer1.Refresh()
        End Sub
    End Class
    PS - Hopefully, in the future Microsoft will improve(and document) its own report control and designer. Right now it's still crude and needs a lot more development to approach the usefulness that the Access Report Designer has. It's rediculous to depend on a third party reporting control(all business programs require reporting) when Visual Studio should have had/built one included from day one.

  • Changing installation path of the runtime? Install by User?

    Hello,
    I'm currently facing a situation where I need to deploy an
    AIR application to users who do not have admin rights.
    I know that AIR does not allow doing that. But I've tested
    that one of the main thing preventing from installing AIR on this
    definite environment is that writing is not allowed to program
    files folder.
    I've run tests using other install packaging tools and manage
    to make it working perfectly by targeting mydoc folder instead of
    program files folder and also by specifying a per user install.
    Everything works fine (even more advanced features not possible
    with the official installer like environment variables, patches...)
    I wonder if there's a way to say AIR to be installed on a per
    user base and to change the path of the runtime installation (this
    may not break the update mechanism because as far as I tested it,
    it just changes app information regarding its path).
    I understand clearly why Adobe do not want to make AIR
    standalone because it is against the entire focus of this
    technology. But I've read that plenty of people are in situation
    where they may use AIR to develop rich software application to
    produce tools internally of a company, without having to go with
    the expensive and time consuming process of going through the
    regular IT installation procedure. On the one hand Adobe may loose
    the advantage of having an entire company making AIR available on
    their computers worldwide, on the other hand they may improve in
    term of AIR latest version adoption and making this technology
    considered lightweight, flexible and useful technology within big
    international companies internal use. (and it may be a step before
    the full adoption within the company?)
    Thank you in advance for giving me the official approach on
    this point.
    Best regards.
    Cedric M. (aka maddec)

    This is a security feature, preventing scripts from accessing the full path of a file to be uploaded using &lt;input type="file">.
    In earlier versions of Firefox, your script might have asked the user's permission to access privileged information, but this feature was removed in the past few versions of Firefox.
    Why do you need the full path?

  • How to run SWT project using Netbeans?

    I get run time exception:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3236 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1030)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
    at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
    at swttest.Main.formLayout(Main.java:41)
    at swttest.Main.main(Main.java:36)
    Java Result: 1
    thanks;

    UnsatisfiedLinkError is a native library error, not classpath error, not to mention it's very common when starting to work with SWT. I've never tried SWT with NetBeans, in fact I don't use NetBeans much at all, I use Eclipse, personal preference, I've tried NetBeans but I'm just more comfortable with Eclipse. Anyway, to get this to work you need to add this argument to the launch configuration:
    -Djava.library.path=*path to the SWT dlls*
    There should be 3 of them and you just have to put the path to that directory, not each individual DLL.
    Being unfamiliar with NetBeans I can't tell you exactly how to do this, but I assume there is some sort of launch dialog where you can specify JVM arguments. Hopefully this helps.

Maybe you are looking for

  • Is there a way to configure managed properties on a superclass?

    Hi, I'm looking for a way to set a managed property on a superclass of a managed bean rather than setting it on every single managed bean extending that superclass. Here's a simple scenario. I've got an application scoped managed bean called "configu

  • Using Find my Iphone

    Hello Fellow Apple iphone users, I recently tested out the 'Find my Iphone' app and found it to be very interesting and useless at the same time. reasons why it is useful : 1) It actually works when you send a message, play a sound or remote lock/wip

  • Browser is freezing every few minutes with facebook and not on other browsers, please help! i love mozilla, can't switch :)

    hey guys, im a devoted user of mozilla but lately whenever i open my facebook (or other sites with lots of adds) it freezes for like a minute, every few minutes. I didn't have this problem when I used explorer nor when doing it on other computers. so

  • Out of Category

    I should direct this question to Apple, but perhaps someone can help me. Is it possible to trade-in an older model, in this case, an iBook G4, for a MacBook and pay the difference? I don't know if Apple offers a non-educational trade-in program. Than

  • Link between Excise Invoice & Cenvat Utilization

    Hi All, After the creation if Sales excise invoice in case of exports, cenvat credit utilization is run fortnighly/Monthly from J2IUN. In the process, we enter the excise invoice for which cenvat credit is to be utilized. Then against each BED, ECS &