Difficulty switching DB servers without manually tweeking report

I have an ASP project with a number of crystal reports. The database is SQL Server and IDE is VS 2010. The ASP pages do not have a problem talking to the database, but I cannot switch the report from one database server to another without manually adjusting the report to the current server (I do this by going into the report > Field Explorer > Database Fields > Set Database Location). Without this, I get a "database logon failed" page in spite of code that gives the correct logon info to the report. Manually switching the reports back and forth has the potential to create a lot of tedious busy work so it would be nice to do it all through code. I'm aware of the Push method and that it would probably avoid this issue, but set that aside for the sake of argument. Having stepped through the code, all the settings from the config file are correct and everything works correctly after the report change.
My question: is there a way to switch databases fully through code?
Here is the current logon code:
ReportDocument cryRpt = new ReportDocument();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
cryRpt.Load(AppDomain.CurrentDomain.BaseDirectory + ReportName);
crConnectionInfo.ServerName = ConfigurationManager.AppSettings\["ReportServerName"].ToString().Trim();
crConnectionInfo.DatabaseName = ConfigurationManager.AppSettings\["DatebaseName"].ToString().Trim();
crConnectionInfo.UserID = ConfigurationManager.AppSettings\["ReportUser"].ToString().Trim();
crConnectionInfo.Password = ConfigurationManager.AppSettings\["ReportPassword"].ToString().Trim();
crConnectionInfo.IntegratedSecurity = false;
crConnectionInfo.Type = ConnectionInfoType.SQL;
CrTables = cryRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
    crtableLogoninfo = CrTable.LogOnInfo;
    crtableLogoninfo.ConnectionInfo = crConnectionInfo;
    CrTable.ApplyLogOnInfo(crtableLogoninfo);
CRViewer.ReportSource = cryRpt;
CRViewer.RefreshReport();
I have also tried this with the same result:
cryRpt.SetDatabaseLogon(ConfigurationManager.AppSettings\["ReportUser"].ToString().Trim(), ConfigurationManager.AppSettings\["ReportPassword"].ToString().Trim(), ConfigurationManager.AppSettings\["ReportServerName"].ToString().Trim(), ConfigurationManager.AppSettings\["DatebaseName"].ToString().Trim());
Edited by: Aaronius Maximus on Mar 2, 2011 10:10 PM

See if [this|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333933323331%7D.do] KBase will help. Search this forum for possible other code samples.
Other samples to look at:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
(vbnet_win_dbengine.zip)
Also assuming you are using [CRVS2010|http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0.exe](?)
Finally, developer help files for CRVS2010:
http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip
http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip
- Ludek

Similar Messages

  • How to draw custom line in crystal report without manually entering value?

    Hi,
    I have a bubble chart and want to represent custom lines one in x-axis and one in y-axis at the value arrived based upon an internal calculation.There is an option to manually enter value for custom line.
    But i want to generate custom line at runtime without manually entering it.
    Can somebody help out?
    Regards,
    Felix

    Not sure what this has to do with Database Connectivity?
    Moved it to the Report Designer forum. If you are using code then specify what Report engine and version you are using and we can move it again.

  • How can I switch from Automatic to Manual update without losing songs?

    I have on my ipod songs from another computer, however I'm afraid to plug it into my computer because my computer is set to automatic update for my ipod. Is there a way for me to switch my ipod to manual update without losing songs on my ipod when plugging it in? thanks.

    Here is what you do:
    Open iTunes.
    Plug in your ipod.
    hold control and shift at the same time. this stops your ipod from updating automatically. Hold this until your ipod is finished docking.
    Then go to edit>preferences>ipod
    then change the setting from update automatically to update manually.

  • Switching essbase servers

    Does anyone know the steps to switch the essbase server that planning uses? I'm on 9.2.0.3. Steps I tried:
    1. install the essbase server and register
    2. change the connections in Planning desktop to point to this new server
    3. tried creating dbs from desktop on the new server.
    4. Had to manual create the planning applicatiion in essbase and then i was able to use "create" in desktop and it created the planning dbs, although there were some errors in generating some member formuals.
    5. confirmed the dbs (plan types) were created
    6. regenerated the hspjshome.properties file
    7. restarted planning etc.
    problem is i can log into planning (web) at all. I'm not sure these steps are correct and I'm not sure that its even possible to switch essbase servers. Any one have insight. I tried to "Setup" a new application from desktop on my new essbase server, but it won't let me use the relational datasources because they still seem tied to the old essbase apps. The old essbase server is still out there with the old apps. Shuold I have deleted the apps through desktop and used the Setup page to recreate the apps on the new server, since manually creating the apps on the new essbase server and then using planning desktop to create the dbs doesnt seem to work correctly.

    Hi,
    The problem may be around shared services, you have provisioned a planning app against one essbase server and now you are trying to use another.
    I would try and just do this as a typical migratation if you are having such problems, I take it only the essbase server has changed and nothing else,
    back up your relational database and any essbase components,
    unregister the application from HSS,
    remove the app,
    make sure all UDL is looking at the new essbase server.
    create the app again.
    stop planning,
    restore the backed up relational db,
    start planning,
    make sure you can log in with no problems ( as the shared services server has not changed the admin native sid should be the same so in theory you shouldnt have to update the users table)
    run a desktop planning create
    restore any other essbase components such as data, scripts etc
    Cheers
    John

  • XML Publisher Report in EBS without Standard Oracle Report

    Hi folks ,
    i have some questions.
    Can I create a XML Publisher Report for the EBS without a Standard Oracle Report in EBS.
    So that I can build up the files with the Desktop Publisher, create Data Definition / Template with Upload / Create the executable und concurrent and than only start the new program in EBS ?
    I have the situation that I can start my program with the template in the background but ít is searching for the report on the file system.
    Thanks in advance for the feedback.
    regards
    Kay

    Hi Ravi ,
    can i do it only with the xml Publisher , because when i tried it in the past and get all the staff like Template / DD / CP up and running and started the CR i get an error from the system that he is missing a report directly in the file system... so he searched for the report himself on system like a standard 6i Report. But the template and the dd is stored in the db. So my question again, can I use the XML Puplisher without a Standard Report or can i use a dummy file only for checking and after that he use my template / dd.
    regards
    Kay

  • Print data without creating a report

    Hello,
    I am using Oracle and Forms 10g. I have a table in tabular view with 10 records. I want to print those 10 records without creating a report. I have used the print button on the smartbar but it prints the entire form.
    Is there a way I can print only the data in the datablock without creating a report?

    Thank you very. A report is the solution to my problem. I was looking for something easier to implement but I see that there is not such a solution. I was hopping for example that you can press the print button, and get the data that are displayed in the data block. Your solutions work fine but are not easier to implement compared to the report solution.
    Thanx very much for your trouble.

  • How do I switch Itunes Libraries without losing my music?

    The majority of my music is on my old, slow computer and this is where I initially synced my Iphone 5s, but my primary computer (laptop) has some music and I would like to download music from this computer in the future. I can't get the music from my laptop to my Iphone without Itunes prompting a message that says that my music from the other computer will be deleted. I know that I can transfer the music to the other computer via usb external storage devices and this is what I plan to do now, but it is a pain and in the future I would like to be able to get music from my laptop. Is there any way to switch Itunes libraries without deleting my music? Any information would be appreciated.

    ugghh thats so obnoxious I dont know why Apple made it like this it used to be so easy to transfer music.. so does this mean that I'm going to have to delete al of my music from my old computer and then redownload it?

  • How do I select all instances of a clip in the timeline at once without manually shift clicking each instance?

    Title says it all!
    How do I select all instances of a clip in the timeline at once without manually shift+clicking each instance?
    The reason I want to do this is because I have a music video with MANY quick cuts. So clips are cut up and splattered all over the place. I am colour-correcting now and so I want to be able to select one clip everywhere it exists in the timeline so I can drag the effect onto all them at once, without having to find each instance of the clip in the timeline. This "batch select" would make it so I don't miss any instances of the clip and also saves a ton of time going through the timeline and shift clicking each time the clip turns up.
    I hope PP is smart enough to do this
    Thanks in advance!
    -- Tim

    Pick one instance of the clip, maybe even the first bit ... and use the new Master Clip feature ... here's first a written explanation and then a video tutorial on doing this ... it's a great feature.
    Adobe Premiere Pro Help | Master Clip Effects
    How to apply effects to all instances of a clip | Adobe Premiere Pro CC tutorials
    Neil

  • How do i switch from automatic to manual download of songs to my iPad from my iTunes library

    how do i switch from automatic to manual download of my songs to my ipad in my itunes library

    You can still manually add songs to the iPad even if the option is not set. Just drag them to iPad same way as when the option is set.
    Select the iPad, click the Summary tab and tick Manually manage music and videos.

  • Altering the report's format without destroying the report layout....{solv}

    Hi,
    I have developed a tabular report and the layout (lines, rectangles... etc as customer wants) ....
    Now , i want to alter only the report style.... that is to change it to group left....
    Is it possible... to select the group fields and the fields displayed in the report without redeveloping the report UI (lines , rectangles... e.t.c).
    I have tried the report wizard... but the layout destroyed... and have to do the UI from the beginning.....
    NOTE : I use Dev10g
    Thanks ,
    Sim

    Hi Sim,
    Group Left or Group Above means that you are grouping for 1 or more fields.
    In the Data model, you will have to create a new group and drag the group fields to this new group.
    In the Layout, you will need to add a new repeating frame below all the other repeating frame, frames, etc. ie. create a repeating frame over existing objects. You may need to move all existing objects down and to the right so that there is enough room to create a new repeating frame over these objects. With the repeating frame selected, from the Arrange Menu, select Send to back (F6) or Move Backwards (F8) several times so that the new repeating frame is below all the objects from the tabular layout.
    Also, fix up the source property for the repeating frame. Create a new field(s) inside this new repeating frame for your group left field(s).
    Good luck.
    John

  • SAP Portal changes not reflect in all the  servers without  reboot?

    Dear  SDN Members
    We have  one sap ep 7.0 eh1  main instance   and  4 other portal instances.every time  we tranport any  portal develpment work  such as epa packages, we need to restart all the instances to reflect the new changes.can you please suggest me
    a solution if  exists to avoid  bouncing of all instances when a portal development work is  transported.
    Why does the changes not reflect in all the servers without the reboot??
    Thanks
    Chandra

    Thanks for the quick response kenny, i wonder if we can configure any parameters in UME
    to avoid bouncing of all the instances. please let me know if you have any other suggestions.
    actually we have  a central portal instance and 4 other  portal servers connected  through a
    load balancer.Any tranport we move to central instance should refelect the changes in all
    other portal instances.But we need to restart all the instances to see the new changes.
    We are trying to find a solution if availbel which prevents server-restarts after each transport.
    Thanks
    Sekhar

  • Windows 2008 R2 smtp server Relay only selected servers without authentication

    Hello,
    Need help in configuring Windows SMTP server.
    Windows 2008 R2 Server. SMTP service is installed and configured.
    Access TAB -- Authentication TAB -- Anonymous Access is selected..
    Relay TAB -- Only the list below is selected and specfic scanners and application servers IPs are mentioned.
    Issue: Even though we have specified list of IPs to relay from this server, Anybody can send mails using this server ( open Relay )
    -- My requirement is to relay specific IPs of scanners and App servers without any authentication, can anybody help me configure windows smtp server to achieve my requirements.
    Any help will be highly appreciated.
    Regards,
    Ghouse

    Hi,
    I recommend you refer to the following article to configure the smtp server:
    Setup and Configure SMTP Server on Windows Server 2008 R2
    In addition, you should ask this in Windows server forum as this is not an exchange problem:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=windowsserver2008r2webtechnologies
    Thanks.
    Niko Cheng
    TechNet Community Support

  • How to have list of dates automatically updated on website, without manually changing in Muse

    Hey, I'm designing a site for a band I play drums in and was wondering how I could update the list of gigs we have, without manually editing in Muse then uploading again. Is there a way of past gigs being taken off without me manually doing it?

    I believe you are referring to events with calender on page where you can update the calender showing the dates, In case you are using third party event system then Muse will not control this but if you have created that in Muse itself then you will have to manually update it from Muse.
    If site is hosted on BC then you can use events module to render the dates and details , from site end you can plan out the events and the one expired will be removed from calender.
    Thanks,
    Sanjit

  • Firefox crashes every night without a crash report (Since last 3-6 months) Currently using version 23.0.1, Fresh Install, Fresh Profile, No Addons

    Every night Firefox crashes without any crash report.
    All I get is the Windows dialog that says "Firefox has stopped working" "A problem caused the program to stop working correctly. Please close the program." "Close the program". (If I can upload the screenshot I will).
    The websites I was on are intranet only sites, require NO Flash or Java. Two tabs only. The same sites were not crashing in much older versions, appx 6+ months ago.
    The only criteria for crashes seems to be the uptime of Firefox. The longer I leave it, the greater the chances of this crash. I have never seen it crash in front of my eyes, always (90%) would have crashed when I unlock the PC in the morning. I leave it running and locked the whole night.
    Just a couple of days ago I decided to do a complete clean install of Firefox, i.e.:
    Uninstall, Delete Program Files, Delete Profile folder. Reinstall, import bookmarks. That's it.
    Hardware Acceleration has been disabled.
    Provide Telemetry has been enabled.
    Crash Reporter is enabled, but doesn't kick in. about:crashes is empty. (Even before re-install there were no recent crashes recorded there).

    HP Compaq 6005 Pro Small Form Factor PC
    AMD Athlon II X2 Processor B24
    Chipset AMD 785G
    Integrated ATI Radeon HD 4200
    Integrated Broadcom NetXtreme Gigabit Ethernet BCM 5761
    Integrated High Definition audio with Realtek ALC261 codec, internal PC speaker
    For further info : http://h10010.www1.hp.com/wwpc/ca/en/sm/WF06a/12454-12454-64287-3328896-3328896-4024556.html?dnr=1
    Thanks for looking into this.

  • DGMGRL switchover automatically without manual intervention

    Hi,
    I did the setup of dataguard and setup DGMGLRL. But when primary fails i used to connect to DGMGRL manually and used to do switchover.
    My question is whether there is any way to do the switchover automatically from DGMGRL without manual intervention whenever the primary fails. If yes, please provide me the details.
    Thanks in advance,
    Mahi

    Mahi wrote:
    Will FAST_START FAILOVER works only in Maximum Performance protection mode?
    My database is in Maximum Availability mode, will it work for that?
    Mahi,
    I don't see you ever mentioned your database version.
    Anyway, if your database version is 10g R2, Fast-Start Failover (FSFO) requires your protection mode to be set to Maximum Availability
    See the prerequisites for FSFO on 10g R2 http://download.oracle.com/docs/cd/B19306_01/server.102/b14230/sofo.htm#BCGFFFBG
    In 11g, FSFO can be configured with Maximum Availability or Maximum Performance.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28295/sofo.htm#BCGFFFBG
    Cheers,
    Mihajlo

Maybe you are looking for