Adding a new tab to CrystalReportViewer and loading a new rpt into it

Hi,
I've been struggling with the following problem for a few days now and I would really appreciate any help you can offer.
I need to add a new tab to an existing instance of CrystalReportViewer and load a new crystal report (RPT) into it.
I wasn't able to do that and tried inserting an instance of a new CrystalReportViewer into the new tabpage, but I've encountered several problems with that solution as well, such as: by hiding the tree and all bars, I'm also removing the page navigation field of the new rpt.
Here is the code I've used:
TabControl tabControl = (TabControl)((PageView)crystalReportViewer1.Controls[0]).Controls[0];
DocumentControl tab2 = new DocumentControl(new ViewerDocument(new SubreportContext()));
tabControl .Controls.Add(tab2);
tabControl .TabPages[1].Text = "New Tab";
tabControl .SelectedTab = tab.TabPages[1];
  Now I need to load the rpt to the new tabpage
If I'm trying to add a new CrystalReportViewer into the tabpage:
ReportDocument oRpt2 = new ReportDocument();
oRpt2.Load(tempFile);
CrystalReportViewer newViewer = new CrystalReportViewer();
newViewer.Dock = DockStyle.Fill;
newViewer.DisplayGroupTree = false;
  newViewer.DisplayStatusBar = false;
  newViewer.EnableDrillDown = false;
  newViewer.DisplayStatusBar = false;
  newViewer.DisplayToolbar = false;
  newViewer.ReportSource = oRpt2;
   tab2.Controls.Add(newViewer);
Please let me know what is the best practice for this kind of operation.

Continue my question....
I've found a method that opens such a tab for me in one statement:
DocumentControl tab2 = ((PageView)crystalReportViewer1.Controls[0]).CreateNewReportDocument("new doc");
But I remain with question of how to load the new RPT into it?

Similar Messages

  • Each time master data full load removes previous data and load with new ?

    We load company code (0COMP_CODE) master data (full load).
    1st day, we check company code master data, the record count is 150, 2nd day, the record count is 90.  It sounds like the master data full load each time would clean the previous data and load with new data, am I right?  If what I guess is right, then what setup is controlling this?
    Thanks

    I dont think it does cleanup.
    MD records in the new load simply overwrite the records already present in the master data.
    I mean if same record comes again its overwritten.If new record it gets added.
    I wouldnt expect number of records to reduce drastically from 150 to 90.
    Maybe before MD activation records could be more(as there will be both M(modified) and A(active) records).
    cheers,
    Vishvesh

  • I am using FCP 7.0.3.on my Mac Pro. I bought a new mac book pro and loaded the software on to the lap top but the software is 6.0.3. How do i get the update to the lap top?

    I am using FCP 7.0.3 on my Mac Pro. I bought a new mac book pro and loaded the software on to the lap top but the software is 6.0.3. How do i get the update to the lap top?

    .. and by the way, the jump from FCP 6.0.3 to FCP 7.0 (or higher) isn't an "update"  It's a full version "upgrade" that has to be done using the install discs (or disc images).
    -DH

  • Can only open one link at a time; any page in new tab will seem to load but appears blank. I have to open a new browser to go to a new page. Why?

    This just began to happen yesterday. I have a MacBook Pro 10.7.5.
    I can always get to the first page that I open in a new browser, but any page after that that I try to open in a new tab will seem to load but the page is blank.
    This does not just happen with one website I have tried myriad of different sites.. only the first tab loads in a new browser. I am having to open a new browser if i want to go to another link - very frustrating..

    Hi - This is Eddie from NTK.
    We just released an updated version handling the new Firefox Beta - please grab it from https://addons.mozilla.org/en-us/firefox/addon/new-tab-king/versions/
    Apologies for the bad experience. We're working hard to chase the never-ending Mozilla release train...
    --eddie

  • Remove / unload external swf file(s) from the main flash file and load a new swf file and garbage collection from memory.

    I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
    This is the error message(s) I am receiving: "TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/Down3()"
    import nl.demonsters.debugger.MonsterDebugger;
    var d:MonsterDebugger=new MonsterDebugger(this);
    stage.scaleMode=StageScaleMode.NO_SCALE;
    stage.align=StageAlign.TOP_LEFT;
    stage.addEventListener(Event.RESIZE, resizeHandler);
    // loader is the loader for portfolio page swf
    var loader:Loader;
    var loader2:Loader;
    var loader3:Loader;
    var loader1:Loader;
    //  resize content
    function resizeHandler(event:Event):void {
        // resizes portfolio page to center
    loader.x = (stage.stageWidth - loader.width) * .5;
    loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    /*loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;*/
    addEventListener(Event.ENTER_FRAME, onEnterFrame,false, 0, true);
    function onEnterFrame(ev:Event):void {
    var requesterb:URLRequest=new URLRequest("carouselLoader.swf");
    loader = null;
    loader = new Loader();
    loader.name ="carousel1"
    //adds gallery.swf to stage at begining of movie
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requesterb);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    // stop gallery.swf from duplication over and over again on enter frame
    removeEventListener(Event.ENTER_FRAME, onEnterFrame);
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent):void {
    // re adds listener for contact.swf and about.swf
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
    var requester:URLRequest=new URLRequest("carouselLoader.swf");
        loader = null;
    loader = new Loader();
    loader.name ="carousel"
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    removeChild( getChildByName("about") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of gallery.swf
    MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    function Down1(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    var requester:URLRequest=new URLRequest("contactLoader.swf");
    loader2 = null;
    loader2 = new Loader();
    loader2.name ="contact"
    loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader2.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader2);
    loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    function Down3(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    var requester:URLRequest=new URLRequest("aboutLoader.swf");
    loader3 = null;
    loader3 = new Loader();
    loader3.name ="about"
    loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader3.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader3);
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    removeChild( getChildByName("carousel") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
    stop();

    Andrei1,
    Thank you for the helpful advice. I made the changes as you suggested but I am receiving a #1009 error message even though my site is working the way I wan it to work. I would still like to fix the errors so that my site runs and error free. This is the error I am receiving:
    "TypeError: Error #1009: Cannot access a property or method of a null object reference."
    I'm sure this is not the best method to unload loaders and I am guessing this is why I am receiving the following error message.
         loader.unload();
         loader2.unload();
         loader3.unload();
    I also tried creating a function to unload the loader but received the same error message and my portfolio swf was not showing at all.
         function killLoad():void{
         try { loader.close(); loader2.close; loader3.close;} catch (e:*) {}
         loader.unload(); loader2.unload(); loader3.unload();
    I have a question regarding suggestion you made to set Mouse Event to "null". What does this do setting the MouseEvent do exactly?  Also, since I've set the MouseEvent to null do I also have to set the loader to null? e.g.
    ---- Here is my updated code ----
    // variable for external loaders
    var loader:Loader;
    var loader1:Loader;
    var loader2:Loader;
    var loader3:Loader;
    // makes borders resize with browser size
    function resizeHandler(event:Event):void {
    // resizes portfolio page to center
         loader.x = (stage.stageWidth - loader.width) * .5;
         loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
    //adds gallery.swf to stage at begining of moviie
         Down();
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent = null):void {
    // re adds listener for contact.swf and about.swf
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
         var requester:URLRequest=new URLRequest("carouselLoader.swf");
         loader = new Loader();
         loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader.load(requester);
         } catch (error:SecurityError) {
         trace(error);
         this.addChild(loader);
         loader.x = (stage.stageWidth - 739) * .5;
         loader.y = (stage.stageHeight - 500) * .5;
    // sure this is not the best way to do this - but it is unload external swfs
         loader.unload();
         loader2.unload();
         loader3.unload();
    // remove eventlistner and prevents duplication of gallery.swf
         MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         function Down1(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         var requester:URLRequest=new URLRequest("contactLoader.swf");
         loader2 = null;
         loader2 = new Loader();
         loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);    
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader2.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader2);
         loader2.x = (stage.stageWidth - 658.65) * .5;
         loader2.y = (stage.stageHeight - 551.45) * .5;
    loader.unload();
    loader2.unload();
    loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         function Down3(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         var requester:URLRequest=new URLRequest("aboutLoader.swf");
         loader3 = null;
         loader3 = new Loader();
         loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader3.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader3);
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
         loader.unload();
         loader2.unload();
         loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
         stop();

  • How can I instantiate and load a new CachedRowSet object from a non-JDBC so

    How can I instantiate and load a new CachedRowSet object from a non-JDBC source?
    cheers

    webrowset reads whole data;
    I would rather need to get data line by line

  • Link in new tab opens blank and "javascript:subValue(1)" is seen in the address bar.

    On a specific website, when I left click a link it opens but when trying to open the link in a new tab, the new tab opens blank and "javascript:subValue(1)" is seen in the address bar. This website hosts many, many images which I hope to download using a bulk image save addon but those images must first be in separate tabs. Opening these links in new tabs is vital to the process.

    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!

  • I used to have tabs that reloaded every few minutes, but I downloaded the new Tab Mix Plus and now it doesn't work

    I used to have my tabs reload every 2 - 5 minutes. I downloaded the new Tab Mix Plus and now when I click on "Reload all tab: button I don't get the drop down box any longer.
    Steve

    Tab Mix Plus support is here. <br />
    http://tmp.garyr.net/forum/

  • When i use google earth or somebody sends me a message or just simply opening a new tab, it crashes and it takes about 30 seconds to start working again, its not my computer as it is new and it has high spec, any help? thanks

    When i use google earth or somebody sends me a message or just simply opening a new tab, it crashes and it takes about 30 seconds to start working again, its not my computer as it is new and it has high spec, any help? thanks

    I figured it out!
    I read a solution for something that sounded similar.
    Anyone in similar position:
    Open iTunes app on iPhone, and pick an option from bottom, such as music. Then scroll down to bottom of page and where your iTunes ID is, press on it, and pick sign out.
    Then return to home screen, and double press home button and press and hold on first icon showing, until a minus symbol appears in the top left of icons present. Press on each minus symbol on each app in turn, until all app icons have disappeared. Then Restart the phone by pressing and hold the home button and the on/off/standby button at top of phone, until the apple symbol appears in centre of blank screen.
    Swipe to turn phone fully on and open settings and scroll down to iTunes and apps option and tap that. Pick sign in and put in your apple ID, it will accept it and then return to home screen and open iTunes a you'll find it works fine
    Simple really, but some like me won't think f this themselves!
    Hope that helps

  • When I click on the tab with a + on it, located next to the active tab a new page does not open. If I click on "New Tab" in the File menu a new tab does not ope

    When I click on the tab with a + on it, located next to the active tab a new page does not open. If I click on "New Tab" in the File menu a new tab does not open.

    Hi jcatx2013, we don't really have enough information on your system to make specific suggestions...
    Could you test in Firefox's Safe Mode? That's a standard diagnostic tool to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode" (''not'' Reset)
    Any difference?

  • Can't open a new tab,no reaction by clicking the new tab button ( + ), why ?

    I can open a new window,but I can't open a new tab ,no reaction by clicking the new tab button ( + )

    Nooo, '''don't uninstall''', see : [https://support.mozilla.org/en-US/kb/troubleshoot-extensions-themes-to-fix-problems#w_disable-all-extensions Disable all extensions] and then one by one [https://support.mozilla.org/en-US/kb/troubleshoot-extensions-themes-to-fix-problems#w_test-for-faulty-extensions Test for faulty extensions]
    thanks

  • I am trying to open a New Tab by clicking on File then New Tab, however a new tab will not open?

    I am trying to open a New Tab by clicking on File then New Tab, however a new tab will not open?

    Try disabling the Ask Toolbar extension, and see how it is.

  • Links open in a new browser instead of a new tab. I do have "open new windows in a new tab instead" ticked

    Hi
    I am using Windows 7 on my desktop and today my Firefox browser opens links from emails in a new browser instead of a new tab.
    I do have "open new windows in a new tab instead" , under tools; options, Tabs ticked.
    I have tried unticking it and then re-ticking it but neither make any difference.
    Hope you can help!

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)

  • Downloaded new landscape in Lightroom and want to incorporate it into lightroom

    Downloaded new landscape in Lightroom and want to incorporate it into lightroom, HOW?

    713713713 wrote:
    Downloaded new landscape...
    landscape what? photo? profile? preset? custom crop aspect ratio?
    If you are talking about a photo or video, then here is one of many ways to get it into Lightroom:
    * drag it from Explorer/Finder and drop it into the Lightroom grid.
    * click 'Import' when "prompted" by the import dialog box.
    Rob

  • I can no longer get Twitter to work with FireFox. I use 3.6.21. It loads first thing but when I try to refresh to get new tweets it just spins and won't load. If I try a new tab it won't load at all.

    I guess the question explains it all. Twitter will not reload all the tab does is spin. It's been spinning since noon ET today with no luck. New tabs don't work either, just says waiting for Twitter. If I close the browser entirely it does work properly for a while but not for long. Can someone help me out?

    I'll try to make this clear. I USED to be able to left click on a hyper link and the hyper link would open in a NEW tab. Now for some unknown reason the hyper link by default opens in the same tab (window). I have to right click the hyper link in order for it to open in a NEW tab. (Yes, my 'tools'> 'options'> 'tabs' are set to "open new windows in a new tab." (Please no answers telling me to get rid of the Ask toolbar because I don't have one.) Thank you.

Maybe you are looking for

  • Not working Manage bean

    Dear experts, Im using JDeveloper 11.1.2.2.0 I created manage bean for cetain command button in my jsf page. This is the code of MB: package common.model.view; import javax.faces.event.ActionEvent; public class abc { public abc() { public void getSel

  • Never programmed with Java

    Hello I have never programmed with Java, and dont know, what i can do, I use PHP, but, i am only a novice at it. I was wondering, is it possable to get data from a page, and put it into an image? if there is no data from the page, it will ask for the

  • Inbound idoc status 51.

    hi,    i am using asn 856, inbound delivery,   in segment E1EDT13.    if the  qualifier is 007 , its working fyn.     if the qualifier is 006, it gives an error msg:        status code 51(please enter the delivery date or goods issue date). how shoul

  • UILoader issue-different sources, but the same content appears.Why?

    Hi, It is strange, I have tested a couple times in different ways but can't figure out why this happens. I will try to brake it down to be clear as I can: I have picked up a uiLoader component, and copy-pasted four times, so now I got five of them in

  • MultiProvider not reading data

    Hi all, I am using a Multiprovider to integrate the data from a DSO and an InfoCube. But is not not reading the data from the DSO. Here is the Structure: Infocube : SALESCUBE Dimensions: Transaction: TRNSCN_ID: Transaction id Customer: CUST_ID: Custo