Ticket Q291793
Visible to All Users

OLAPConnectionString set in code after design version ok, but then no data!

created 14 years ago

Hi, have used the onscreen control designer to get SSAS data fine through the design OLAPConnectionString property, all good. However I need to deploy to client so must use a non hard-coded connection string, so use:
            pvtgrdGrid.OLAPConnectionString = ConfigurationManager.ConnectionStrings["SSAS_DW.Properties.Settings.connSSAS_DW"].ConnectionString.ToString();
            pvtgrdGrid.RetrieveFields();
However (after finding the RetrieveFields() in a forum posting which does at least load up the screen as it was completely blank before) this results in no data! Basically, I get the "Drop Data Items Here" holders - but I can see all the field assignments in the InitializeComponent() still in the .designer codefile where it previously loaded all the data. So if that code is still there, what do I need to do further to kick it into motion to load the data which it previously did fine until I switched the OLAPConnectionString ??
Thanks for any quick help, Phil.

Comments (3)
Anatol (DevExpress) 14 years ago

    Hello Phil,
    Unless I'm mistaken, you have created required fields at design time. In this case, you should not call the RetrieveFields method, since these fields will be removed from PivotGridControl. Most likely, you don't see any data because the connection string stored in the configuration file is incorrect. If you were able to set the working connection at design time, you can easily learn the correct connection string by reviewing the designer-generated code from the *.Designer.cs file. If it doesn't help, please provide the connection string stored in the configuration file.
    If I misunderstand you, and the problem is not with connecting the PivotGridControl to a cube, please describe the problem in greater detail.
    Thanks,
    Anatol

      Thanks for confirming Anatol and nicely identified. So I have removed that RetrieveFields() then and changed the connection string - instead of using the one serving the other SSAS connections (for direct ADOMD.NET) I've taken the one from the designer which had the form (which mirrors the design-time settings of course):
      connectionString="provider=MSOLAP;data source=SERVER001;initial catalog='SSAS DW';cube name='DW Cube'"
      That does indeed work fine (which makes sense, just couldn't be sure where the problem was), and it also sets up all the fields I configured in design time (from the .Designer.cs) - excellent… and phew! So now have best of both worlds - design time field config and code based external connection string etc for reconfig on client machines.
      Keep up the good work, your SSAS pivot is fantastic so far!
      Phil

      Anatol (DevExpress) 14 years ago

        You are always welcome.
        Thanks,
        Anatol

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.