Jump to content
We've recently updated our Privacy Statement, available here ×
  • Change default value for data chooser adhoc report (domains)


    okyrychenko
    • Features: Data Sources, Domains Version: v5.1 Product: JasperReports® Server

    Issue Description:

    I want to put domains as a default value when i create an adhoc report and choose its data source, but presently a topic has this default value.


    Resolution:

    modify <js-install>/scripts/adhoc.start.js

    In the initialize section of adhocStart(), there is a switch statement that specifies the default  behavior:

        /**
         * This is for the initialization of ad Hoc's start page
         */
        initialize : function(){
            dialogs.popup.show($("sourceDialog"), true);
            //get the topic path
            var options;
            var UNSPECIFIED_TOPIC ="unspecifiedTopic";
            if(!defaultTopic){
                this.DefaultTopicsPath = defaultTopicDir + UNSPECIFIED_TOPIC;
            }else{
                this.DefaultTopicsPath = defaultTopicDir + defaultTopic;
            }
    
            if(!isNotNullORUndefined(this.TopicsTreeContainerId)){
                return;
            }
    
            switch (window.launchType) {
                case this.DOMAIN_LAUNCH_TYPE:
                    this.hideRealmTree(this.DOMAIN);
                    this.getDomains();
                break;
                case this.OLAP_CONNECTION_LAUNCH_TYPE:
                    this.hideRealmTree(this.OLAP_CONNECTION);
                    this.getOlapConnections();
                break;
                default:
                    // Fall back to Adhoc Topic
                    this.getTopics();
            }
            this.initializeHandlers();
        },
    
    

    Modify the switch statement to look like this:

            switch (window.launchType) {
                case this.DOMAIN_LAUNCH_TYPE:
                    this.hideRealmTree(this.DOMAIN);
                    this.getDomains();
                break;
                case this.OLAP_CONNECTION_LAUNCH_TYPE:
                    this.hideRealmTree(this.OLAP_CONNECTION);
                    this.getOlapConnections();
                break;
                default:
                    // Fall back to Adhoc Topic
                    // this.getTopics();
                    this.hideRealmTree(this.DOMAIN);
                    this.getDomains();
            }
    

    Restart JasperReports Server

     


    Ref. Case #00032221


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...