Dynamic Query from combo

Posted by: ozmagic on 3 August 2017, 4:01 pm EST

  • Posted 3 August 2017, 4:01 pm EST

    <span id="result_box" class=""><span class="hps">The</span> <span class="hps">web</span> <span class="hps">project</span> <span class="hps">has a</span> <span class="hps">combo</span> <span class="hps">with</span> <span class="hps">several tables</span> <span class="hps">where</span> <span class="hps">the customer selects</span> <span class="hps">one plus a</span> <span class="hps">date range</span> <span class="hps">selection</span> <span class="hps">with</span><span class="">.</span> <span class="hps">How do I make</span> <span class="hps">the connection</span> <span class="hps">dynamically</span><span class="">?<br><br></span></span>Best Regards.<br>
  • Replied 3 August 2017, 4:01 pm EST

    Abhishek,<br><br><span id="result_box" class=""><span class="hps">The example</span> <span class="hps">is fine, but</span> <span class="hps">the client wants to</span> <span class="hps">apologize</span> <span class="hps">select tables</span> <span class="hps">from a</span> <span class="hps">grid</span><span>-down</span> <span class="hps">then</span> <span class="hps">select</span> <span class="hps">radio</span> <span class="hps">button</span> <span class="hps">day</span> <span class="hps">or month</span> <span class="hps">and finally</span> <span class="hps">a period</span> <span class="hps">with two</span> <span class="hps">combolist</span> <span class="hps">then just</span> <span class="hps">connect.</span> <span class="hps">The whole system</span> <span class="hps">is</span> <span class="hps">in</span> <span class="hps">sqlserver</span><span>.</span> <span class="hps">Grateful if you</span> <span class="hps">could</span> <span class="hps">explain</span><span class="">.</span></span><br><br>Best Regards,<br>ozmagic<br><br><span id="result_box" class="short_text"><span class="hps">PD</span><span class="">.</span> <span class="hps">Sorry</span><span class="">,</span> <span class="hps">do not speak English</span><span class="">.</span></span><br>
  • Replied 3 August 2017, 4:01 pm EST

    ozmagic,<br><br>Can you please add some additional description to your use case scenario like which type of datasource are you using example Relation DataSource,XML ,MDX or an Unbound datasource? <br><br>I would suggest you to go through this link which provides information regarding "<span id="pagetitle">Connect to Data Sources in Web Projects"<br><br>http://helpcentral.componentone.com/nethelp/ActiveAnalysis2WebHelp/ConnectToDataSourcesOnTheWeb.html<br><br>Best Regards,<br>Abhishek<br></span>
  • Replied 3 August 2017, 4:01 pm EST

    <span id="result_box" class=""><span class="hps"><span id="result_box" class=""><span class="hps">It connects</span> <span class="hps">to a</span> <span class="hps">sql</span> <span class="hps">related</span> <span class="hps">by a</span> <span class="hps">datasource</span><span>.</span><br><span class="hps">The database</span> <span class="hps">is enormous</span> <span class="hps">over</span> <span class="hps">85gb</span><span>.</span><br><span class="hps">1 -</span> <span class="hps">Show</span> <span class="hps">all tables</span><br><span class="hps">2 -</span> <span class="hps">Select</span> <span class="hps">a table</span> <span class="hps">over</span> <span class="hps">a date range</span><br><span class="hps">3 - Connect</span> <span class="hps">the</span> <span class="hps">pivot</span> <span class="hps">with</span> <span class="hps">a button</span></span></span><span class="hps"><br><br>Best Regards,<br>ozmagic<br></span></span>
  • Replied 3 August 2017, 4:01 pm EST

    ozmagic,<br><br>I have created a sample application on the same lines , please go through the sample application and let me know if this helps.<br><br>Best Regards,<br>Abhishek<br>
    2012/10/GCAAWebApp.zip
  • Replied 3 August 2017, 4:01 pm EST

    <span id="result_box" class="short_text"><span class="hps">Sorry</span><span class="">,</span> <span class="hps">forgot to tell you</span> <span class="hps">is</span> <span class="hps">in</span> <span class="hps">the</span> <span class="hps">webform</span> <span class="hps">vb</span></span>
  • Replied 3 August 2017, 4:01 pm EST

    ozmagic,<br><br>I am not sure I understand what you mean by selecting tables from grid-down and then select a radio button for day or month and then finally a period. Do you have a database that you can share and explain with an example how you would want this to be accomplished.<br><br>Best Regards,<br>Abhishek<br>
  • Replied 3 August 2017, 4:01 pm EST

    <span id="result_box" class=""><span class="hps">Although</span> <span class="hps">not running</span> <span class="hps">the</span> <span class="hps">database</span> <span class="hps">to</span> <span class="hps">assemble</span> <span class="hps">the</span> <span class="hps">example</span><span>.</span><br><span class="hps">I can</span> <span class="hps">attach a</span> <span class="hps">basic design</span> <span class="hps">would be like.</span><br><span class="hps">Basically</span> <span class="hps">it's arm</span><span>:</span> <span class="hps atn">"</span><span>Select * From</span> <span class="hps">table</span> <span class="hps">where</span> <span class="hps">dates</span><span>"</span> <span class="hps">but</span> <span class="hps">everything</span> <span class="hps">executable code</span> <span class="hps">dynamically</span> <span class="hps">as the</span> <span class="hps">customer</span> <span class="hps">table as</span> <span class="hps">the</span> <span class="hps">selected</span> <span class="hps">dates</span> <span class="hps">prior to</span> <span class="hps">connection</span> <span class="hps">to the</span> <span class="hps">pivot.</span><br><span class="hps">Summarizing the</span> <span class="hps">sql</span> <span class="hps">query</span> <span class="hps">needs to be dynamic</span><span class="">.<br><br>Demo.zip<br><br></span></span><span id="result_box" class=""><span class="hps">Best Regards,<br>ozmagic</span></span><br>
  • Replied 3 August 2017, 4:01 pm EST

    ozmagic,<br><br><br>I understand your design now , you would like the query string to be on the user selected values from the Drop Down box for Tables and Dates. The sample that I have shared with you earlier also can accomplish the same. You will just need to build your query string now from both values i.e Table Dropdown and Date DropDown. I have attached a snippet of code to get you started.<br><br>Best Regards,<br>Abhishek<br><br><div>      <br></div>
    2012/10/Code.txt
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels