Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modifying scheduled report's/event's attributes

Status
Not open for further replies.

crystalvictim

Programmer
Dec 4, 2002
92
0
0
DE
Hi,

using CE8.5 is it possible to change a scheduled report's attributes? To be more precise, we are in need to replace the unmanaged disk's path specification in a bunch of more than hundred reports. As this attribute seems to be 'hidden' within the CE-database's BLOB-field, we're looking for some sort of custom code (a csp-page) that provides us with a solution. E.g. looping over all scheduled reports and replacing the destination '\\bruderep1\...' with '\\bruderep2\...'.

Furthermore - as we're scheduling the reports based on file events (there's about one event for each report) - we also need to change the event's file-attribute (i.e. the path/file the event is waiting for). Basically it' the same thing here: Looping over all existing (file-)events and replacing '\\bruderep1\...' with '\\bruderep2\...'

It would be great to know if such a custom coding would still work when using CE10 or what modifications we would have to apply in this case.

Thanks in advance for your help!
 
I'm not familiar with the 8.5 SDK but if you can change it in CMC then you can change it in SDK.

Don't know if this will be much help (it's Java and XI) but the concept is the same - I've stripped it down for clarity.
Code:
<%
      IInfoStore iStore = null;
      IEnterpriseSession es = null;
      IInfoObjects oInfoObjects=null;

      //get the Enterprise session from the HTTP session
      es=(IEnterpriseSession)session.getAttribute("es") ;

      String filename=null;
      String oldPattern="Foo";
      String newPattern="Bar";

    	//Obtain the InfoStore and query it for the File Events
        iStore = (IInfoStore) es.getService("", "InfoStore");
        oInfoObjects = iStore.query("SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Event' AND SI_TYPE=1");

        for(int i=0;i < oInfoObjects.size();i++){

            IEvent event = (IEvent) oInfoObjects.get(i);
        
            IFileEvent fileEvent = (IFileEvent)event.getEventInterface();
            //Get the filename and replace the text
            filename = fileEvent.getFileName().replaceAll(oldPattern,newPattern);
            fileEvent.setFileName(filename);
	        
            //Commit the changes back to the CMS
            iStore.commit(oInfoObjects);
        }
    out.println("Event(s) Updated Successfully!");
%>

Kingfisher [CECP]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top