Can I edit the rpt file & change the datasource before loading the report?

We are an ISV and our application has a lot of reports.  Our reports use a SQL Server database as the data source and each SQL Server at our customer sites has a different name.
In our testing we have determined that ReportDocument.Load tries to connect to the SQL Server that is saved in the RPT.  If it can't fine the SQL Server saved in the RPT the load take about 60 seconds while it is waiting for the SQL Server Connection to time out.
We are using the Visual Studio 2008 version of Crystal Reports.  This did not seem to be a problem with VB6/CR8.5.
We would like to edit the RPT and change the data source to the appropriate SQL Server before we call ReportDocument.Load.
Is it possible to edit the rpt file and change the data source before loading the report?
Or is there some way to tell Crystal not to try connecting to the DB
during the report.load?
In our case we will NEVER use the data source that is saved in the RPT, we will always change the data source using ApplyLogOnInfo.
Thanks

HI Todd,
You Can Not edit the report document before ReportDocument.Load() because if you dont load the report then you dont have anything to Edit
But as far as changing the datasource is concerned you can change that at runtime.
For changing the datasource following code will help you if both databases have a same schema :
Code for changing the database
ConnectionInfo crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = "SERVER";
crConnectionInfo.DatabaseName = "DATABASE";
crConnectionInfo.UserID = "USERID";
crConnectionInfo.Password = "PASSWORD";
// Loop through the ReportObjects in a report and find all the subreports
foreach(ReportObject crReportObject in crReportDocument.ReportDefinition.ReportObjects)
     // Check the kind of the ReportObject, if it is a subreport
     // proceed. If not skip.
     if(crReportObject.Kind == ReportObjectKind.SubreportObject)
          // Get the SubReport in the form of a ReportDocument
          string sSubreportName = ((SubreportObject)crReportObject).SubreportName;
          ReportDocument crSubReportDocument = crReportDocument.OpenSubreport(sSubreportName);
          // Use a loop to go through all the tables in the main report
          foreach(Table crTable in crSubReportDocument.Database.Tables)
// Get the TableLogOnInfo from the Table and then set the new
// ConnectionInfo values.
TableLogOnInfo crLogOnInfo = crTable.LogOnInfo;
crLogOnInfo.ConnectionInfo = crConnectionInfo;
// Apply the TableLogOnInfo
crTable.ApplyLogOnInfo(crLogOnInfo);
// Set the location of the database. This value will vary from database to
// database.
crTable.Location = "DATABASE.OWNER.TABLENAME" or crTable.Locations;
The sample for doing this is available on support site.
Thanks,
Prasad

Similar Messages

  • Can we Edit the report At runtime in JSP?

    <p>Hi,</p><p> </p><p>Im Using Crystal Report XI server..</p><p> </p><p>I want to edit the report data at runtime  through JSP.</p><p>Is there any API available to implement this?</p><p>Please tell me How to Implement this?</p><p> </p><p>-Venkat. </p>

    <p>Hi Venkat</p><p>I&#39;m assuming that you have Business Objects Enterprise.  If this is true you can use the Report Application Server (RAS) SDK to modify reports at runtime.</p><p>You can find the online documentation for the RAS at:</p><p>http://devlibrary.businessobjects.com/</p><p>Select XI or XI R2 </p><p>You will see it listed as one of the books on the left hand side.  This will contain the Java documentation for RAS.</p><p>Also, I just posted some samples that may be useful to you.</p><p>http://diamond.businessobjects.com/node/900</p><p>If you are looking help for Crystal Reports for Eclipse runtime support, you may want to post to that forum. </p><p>Rob Horne<br /><a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/blog/10</a></p>

  • Found Audacity for my background noise. Can I edit my audio files in the FCPX event folder in Finder?

    I think I found the solution to my background noise problem using Audacity.
    But can I edit my audio files that are in FCPX Event folder in Finder? Or do I actually have to edit my project all over again to put in new audio (edited by Audacity)?

    No, copying the whole Project and Event is just too much of a waste of time.
    Do this, in the Browser, select the audio file you need to take to Audacity.  Export it as a Master File, and in the Settings section of the Share window, set Format to Audio Only.  Set Audio File Format to AIFF.  Set Open With to "Other" and select Audacity.  Then pick your Desktop as the location to save the file.
    In Audacity, do whatever it is you want and save it.
    Back in FCP X, import the new "fixed" file, be sure to check the box to copy it to your Event folder.
    Finally, if necessary, do a Replace edit with the new version to the old one if it has already be edited into a Timeline.

  • I can´t edit the text files with SAP BODS 3.2

    Hello
    I can not edit some text files 9-20 megabytes to replace two words in each file, the source is a text file and the same destination but with different name, because with the same name have been unable . My idea is to remove the original and stay with the new performing edition but that if he does , let me file this way:
    SALES_ORDERS_FULL_20140223_150051_006.xml ( ORIGINAL )
    should leave it with me so : SALES_ORDERS_FULL_20140223_150051_006.xml _OLD (AMENDED )
    but strangely leaves me so :
    MICROSOFT_SQL_SERVER_KCC-BI_REPO_KHSA_XI_REPO_KHSA_XI_1543_5434_2_3_Long_INVOICES_INCREMENTAL_20140225_034004_001_xml_dat.txt  (not deseased)
    The type of data you use is long since varchar not allow me because it cuts my data file , use varchar (50000000) but takes the information and short .
    I am using long data type , modify the file and I pass the name of the text files of sap bods for global variables. They are a series of files that are called by a while loop
    Thanks for your answers
    regards

    HIr
    Yes, first I convert long_to_varchar for edit, and convert varchar_to_long.
    I edit before before and later
    Thanks

  • Can I edit the system file Manifest.XML in Word for Windows? (there's a reason for doing this)

    I renamed a file directory containing several PDFs. Consequently, Adobe Digital Editions says these files are missing when I try to open them and look at notes I made. There seems to be an obvious solution, but I'm unfamiliar with XML and don't want to screw things up. The file locations and a lot of other information for Digital Editions is in an XML file called Manifest. If I can edit the XML file to show the correct directory, I expect I'd be able to see these files and recover my notes. I'm unsure what Word for Windows may do (e.g., add or delete characters) when I edit and save the new Manifest.  That might corrupt the Manifest and be extremely counterproductive.
    Is editing the file locations in Word for Windows safe, so long as Digital Editions isn't open when I do my editing? 

    I can confirm that Notepad++ can happily edit manifest.xml files, but as Jim_Lester says, make a backup (especially if you are not used to XML).
    You may well find that if you Open the .epub files from their new location explicitly from ADE (ctrl-O) that you will both be able to read documents and see the notes.
    I can't vouch for that; but if it works I'd recommend it over editing the manifest file.

  • How can I edit the file name of the home page?

    How can I edit the file name of the home page?
    Gr Ammani

    I have a similar issue with regards to the filename...
    When I navigate to my website, it doesnt work unless I actually type the filename at the end of it. Example: type in "www.whitelion.com" (this is my real domain name) and it doesnt work. When I type in "www.whitelion.com/index.html" then it works.
    This is obviously inconvenient because my clients will never know to add the filename to the end of the site.
    Is there any setting or way to get the page to appear by just typing the original domain name without adding the extension?
    Thanks,
    Emelia

  • I am using CS3 and want to save a file as a pdf where someone can then edit the text. How can I do this please? Thank you :)

    I am using CS3 and want to save a file as a pdf where someone can then edit the text. How can I do this please? Thank you

    You might be able to use the newest adobe reader program/application for that.
    You would have to save your pdf out of photoshop cs3 without any text and then add the text to the pdf in adobe reader.
    The text added in adobe reader can't be edited in photoshop, so the other people would have to adobe reader or acrobat to edit the text.
    https://helpx.adobe.com/reader.html

  • How can I edit the password entries?

    How can I edit the values in password manager? Right now for at least one site has the username instead of the password.

    Note that your System Details List shows that you have a user.js file in the profile folder to initialize some prefs on each start of Firefox with a possible feed.snapdo.com infection.
    The user.js file is only present if you or other software has created it, so normally it wouldn't be there.
    You should check its content with a plain text editor if you didn't create this file yourself.
    The user.js file is read each time you start Firefox and initializes preferences to the value specified in this file, so preferences set via user.js can only be changed temporarily for the current session.
    *http://kb.mozillazine.org/Preferences_not_saved

  • How can I edit the default settings for the Email button?

    I saw this question posted for February and as yet still unanswered. So I am now asking it again.
    I do not want to use my .mac account email address in my website. I want it linked to my domain. I have found no specific instructions for changing the default. Also my drag down "Link to" menu in the Inspector does not work.
    Thanks........
    eMac   Mac OS X (10.3.9)  
    eMac   Mac OS X (10.3.9)  

    While you can't edit the default email address in iWeb, there is a workaround which may suit.
    In Safari, locate a web page which has iWeb's email button on it (if you've already published a site, one of your own web pages is ideal). Control-click on the button and select 'Add Image to iPhoto Library'. Drag this image from the Media Browser to your iWeb page, select the image, and use the Link inspector to enable it as a hyperlink linking to 'An Email Message'. Enter whatever email address you like in the To box and a Subject for the message if you wish.
    To make things easier, create an iWeb library in iPhoto and add the email button to it for handy access.
    [ Visit here for iWeb Tips, Tricks and Hacks ]

  • Can I edit the data already displayed in tree control?

    I'm using a tree control to display some data in front panel. But after running the program, can I edit the data already displayed in tree control by using input control and let it change and display dynamically? In invoke nodes I can only find add or delete items in tree but can't find edit...

    There is no direct editing option available, same can be achieved in two steps by using
    --> Add Item Invoke Node
    --> Delete Item Invoke Node
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • How can we edit the workbook

    hi
    how can we edit the workbook means i am having a workbook with some queries, i want to change the name of the workbook how we do this?
    Can any one provide me the solution
    Thanks in Advance.

    Hi,
    In our case, even though i change the name of the workbook using 'Change title' that is not reflected in the workbook if it is in a role. so, in that case, goto pfcg - enter the name of the role -> menu tab -> change the workbook name for the workbook of your choice.
    Thanks

  • I have a new Nikon D750 sitting on my desk and can't edit the photos with any adobe product?  We are in full wedding season and am a little frustrated.  Photo mechanics opens them right up to download them.   I am using the Nikon software to convert them

    I have a new Nikon D750 sitting on my desk and can't edit the photos with any adobe product?  We are in full wedding season and am a little frustrated.  Photo mechanics opens them right up to download them.   I am using the Nikon software to convert them into tiffs.  when is the camera raw update coming out.  I am not the only photographer with this issue check out all the chatter about it.

    This happens every single time a new camera comes out from one of the two big camera makers. Nikon and Canon do not send preproduction units to Adobe, so Adobe has to go out and buy a D750 or whatever from the store to test and profile it before they can update Lightroom. They can't get one earlier than you and I can. The profiling is quite an extensive operation. Other camera makers do send preproduction units, use dng, or do the profiling in-house and there you often get support right from release. If camera makers would finally embrace an open raw format such as dng, this whole problem would be gone but both Canon and Nikon seem to think they live in an upside-down world where their clients only use their software.
    Usually the dead period only lasts a few weeks but it is frustrating nevertheless. My only advice is to not buy a new camera at the day of release and expect to have third parties to support it. You definitely should not be buying these cameras right away if your business depends on it. Aperture, Capture One, etc. have the exact same problem. No third party (read non-Nikon in this case) will support the camera from the release date. Some are quicker than other adding support. Adobe is somewhere in the middle of the pack in this respect. Nobody outside of Adobe knows when an update comes out. Could be tomorrow, could be a few more weeks or a month. They might jump straight to Lightroom 6 and never add direct support to LR 5. Sometimes they will first bring out a beta version of dng converter that will convert the new camera's nef files to dng, which will work fine in the current Lightroom before updating Lightroom itself.

  • Itunes song will not delete and I can't edit the info

    I added some songs to itunes 9 and now i want to delete one of them. I tried using delete, right-click delete, and edit delete. The window that asks if i'm sure I want to delete the song from the library doesn't even pop up. It's like the song isn't even there. It still played when I clicked on it but I can't edit the info either. I'm unable to click on the info boxes and the tabs for lyrics and artwork are grey. Then I realized I should just delete the actual file from the folder. That deleted from the trash but now the song says it can't locate the file and I have an exclamation mark next to the song name and it still won't delete. I have over 5,000 other songs and have never encountered this problem. I've deleted other songs since using itunes 9 and it has been fine. Is there something wrong with the song file? Please help!

    I'm having this problem too. It does not seem to be a permissions issue. I have found so far that restarting iTunes will allow me to edit a song I have previously been unable to edit.
    This is happening with iTunes 9.0.1 (9) I can't say for sure that it wasn't happening under 9.0 - but I didn't notice it then.
    I find that songs are uneditable after they have been downloaded to iTunes. Not all songs, just some, on an unpredictable basis. I don't know if there are other older songs with the same problem, or whether it's just new downloads that are being affected.
    I've also noticed that it's impossible to delete one of these songs from a playlist.
    So - in summary : Download an album ... 2 or 3 songs on the album will be impossible to edit (song info) and impossible to delete from a playlist ... restarting iTunes allows them to be edited ...
    It's a really odd one.

  • I can not edit the form that I am filling in

    I can not edit the form that I am filling out. I saved it to Desktop and was allowed to fill it in. But I can not erase some words that I want to change.

    Are the words you want to change in form fields that you previously typed in?

  • I can't edit the song's names neither singer/musician's names on my CDs

    This is just to correct my previous question that wasn't clear enough; sorry for that. It's the first time that I am using the "Apple Support Communities".
    When I burning the songs to my CDs, I can't edit the song's names, neither the singer/musician's names on my CDs.
    After burning, I put the CD to play in my desktop, and in the window that open with all songs that I burned, appears only "Track 01", "Track 02" and so on, and none names for song or singer/musician.
    I have tried something that I know to solve this problem, but I didn't have success.
    If I burning CD using "Windows Media Player" for song from other source, I can edit the names for singer, for musician, or orchestra, but with "iTunes" I can't do that.
    So, please, if anyone know what I can to solve this problem, let me know. I will appreciate any help to my trouble.
    Thanks a lot.
    Cheers,
    Kyoto2014

    When this problem occurs, it is usually because the song files are set to read-only. If the read-only setting is the cause of your problem, you can solve it by going to Windows Explorer, selecting all of the affected songs, and unchecking read-only.

Maybe you are looking for

  • ERROR Command File filename Not Found.

    Hi all, I am trying to automate the import of interface tables into Planning Dimension library. I am getting the below error. I have tried lot of methods in the way I call the Import.txt from epma-batch-client.bat but nothing seem to work. Your help

  • Opening a PDF from flash button

    Hi guys, I have not done this for a while and the old source files I got do not seem to work anymore in flash pro cs5. In the past I used ZINC and flash and these code lines: the link to the PDF is loaded from an XML:  " ... url="data\\presentations\

  • Error After deploying FusionOrderDemo_R1 application in Oracle SOA suite11g

    Hi All, I am getting the below error after deploying FusionOrderDemo_R1 application in Oracle SOA suite 11g. After deploying the StorefrontModule i should be able to Access the storefront from the following URL: http://hostname:port/StoreFrontModule/

  • Why cannot photo pixlr connect to itunes ??

    i recently downloaded this app photo pixlr, its an amazing app to edit photos. i have been using the presets to to edit till now, i tried downloading the other packages but it says it cannot connet to itunes. what should i do ?

  • Dont know what this effect is called, help?? how would i do it in FCE?

    hi, I need to get two me's in the same shot. E.g. i need a video feed of me talking to myself, but in the same shot. I could do this with super imposing but am not impressed with the results. Is there any other way i could do it, e.g. some way i coul