Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

GP Administrator's Dashboard

Posted on by 571

Since the time I became the accidental GP Admin at WOW Logistics, I've glommed onto the SQL scripts that show what's what in GP: users logged in, stuck batches, SQL sessions, etc.

But what the scripts lack is that immediacy of a dashboard. So I made one in Excel. All of the SQL views I've stolen -- from people like Béat Bucher, David Musgrave, Victoria Yudin, and Leslie Vail -- went into data connections in my refex (REFreshable EXcel workbook). There are 7 tabs with data from 10 views in Excel tables on those tabs.

What I'd like to do is to share my refex dashboard here and on GPUG.com. My concern, of course, is that it'll take some jiggering for others to get it to work right; i.e., having to make changes to all of the Data Connections to reset the SQL Server and Database parameters in the connection strings.

So, what I'm asking here is this: is the tactic I've employed to make the refex as generic as possible sufficient for the purpose of sharing it with others?

What have I done to make it "as generic as possible"?

  1. I created each Data Connection this way:
    1. Data >> From Other Sources >> From Microsoft Query
    2. I selected a Data Source Name pointing to our GP server/database to begin with... there doesn't seem to be a way to create a DSN-less connection directly (I welcome advice on this matter!)
    3. In the SQL Server Login dialog, I select "Trusted Connection"
    4. Close the "Add Tables" dialog
    5. Click the "SQL" button in the "Microsoft Query" dialog
    6. Paste the SQL code from the View; e.g.,
      1. SELECT 'DYNAMICS..SY00800' AS TableName, *
        FROM DYNAMICS..SY00800

        WHERE USERID NOT IN (SELECT USERID FROM DYNAMICS..ACTIVITY);
    7. Click OK at the "SQL Query can't be represented graphically. Continue anyway?" prompt
    8. Close the Microsoft Query window
    9. Choose a place for the "Import Data" dialog to plant the table on a tab of the refex and click OK
  2. I then modify the new Data Connection like this:
    1. Open the Data >> Connections dialog
    2. Select the new connection and click the "Properties" button
    3. Change the Connection name
    4. Select "Refresh every" and change 60 minutes to 2 minutes
    5. Select "Refresh data when opening the file" and "Remove data from the external data range before saving the workbook"
    6. Click on the "Definition" tab
    7. The "Connection Type" is already "Database Query", which is what I want; the "Connection file" prompt is empty; the "Command Type" is "SQL"; and the "Command text" contains the query.
    8. The "Connection string", however, shows my DSN; like this:
      1. DSN=DYNAMICS_GP2016;
        Description=DYNAMICS_GP2016;
        UID=sa;
        Trusted_Connection=Yes;
        APP=Microsoft Office 2013;
        WSID=XXXXXX;
        DATABASE=WOW;
        AutoTranslate=No;
        QuotedId=No;
        AnsiNPW=No;
    9. I don't want all that stuff. To make it more "DSN-less", I replace all that with the following:
      1. DRIVER=SQL Server Native Client 11.0;
        SERVER=MyServer;
        Trusted_Connection=Yes;
        DATABASE=WOW;

        ...and click OK
    10. Of course, when I check up on the Connection Definition again by clicking Properties >> Definition in the "Workbook Connections" dialog, I see that Excel has done its usual meddling and inserted some extra info into the nice, clean Connection String I gave it:
      1. UID=steveer;
        APP=Microsoft Office 2013;
        WSID=XXXXXX;

        ...have been inserted. I guess it's a case of "no harm, no foul"... but it's sort of maddening.


So now I've altered the Connection String to be more "DSN-less-like" for each of the Excel tables in my refex.

Is that enough? If I upload it here or at GPUG.com, I can give instructions describing how to edit the Connection Strings for each of the data connections... and that should allow the refex to work in your enviornment, yes? Unless, of course, you're not using version 11.0 of the SQL Server Native Client!

Am I spacing out and missing a much easier way to do this? Have any of you posted refexes? How did you overcome the server/database/DSN issues?

Regards,

*This post is locked for comments

  • KirkLivermont Profile Picture
    KirkLivermont 5,985 on at
    RE: GP Administrator's Dashboard

    Steve,

    The command text can but I am also unsure about the connection string. I can probably test it when I am back in the office tomorrow.

    If you want to send me a copy of the file my email address is (myfirstname)@(mylastname).net.

    Kirk

  • serbach Profile Picture
    serbach 571 on at
    RE: GP Administrator's Dashboard

    Kirk,

    Ah! I see! I don't know whether the Connection String can contain variables or not. That would be spiffy if it could!

    Sincerely,

    Steve Erbach

  • KirkLivermont Profile Picture
    KirkLivermont 5,985 on at
    RE: GP Administrator's Dashboard

    Steve,

    My thought regarding consolidation is to make the queries broader anywhere a relationship can be established between the tables. From there if statements and pivot tables can be used to separate the various conditions.

    I have only ever used parameters in excel to feed the where clause sections of my queries. I am not sure if they can be used for part of the server connection but this might be an option then the user could enter the server and database name in a clearly labeled excel field.

    Kirk

  • serbach Profile Picture
    serbach 571 on at
    RE: GP Administrator's Dashboard

    Kirk,

    I'm willing to consider anything... but I don't grok the "consolidating the connections" bit. Would you please expand on that a bit?

    I actually have wondered whether Excel were capable of establishing a connection to a database ONCE and then having any queries on that database "feed" off of that one connection... rather than having a connection for every query. Wishful thinking!

    You know, I might just post what I have with a note about changing the Server and Database in each connection... and treat it as an open source sort of thing. There's nothing particularly earth-shaking about this dashboard. It's just been convenient for me to have them auto-refresh every 2 minutes.

    Sincerely,

    Steve Erbach

  • KirkLivermont Profile Picture
    KirkLivermont 5,985 on at
    RE: GP Administrator's Dashboard

    Steve,

    This is probably a lot more work than renaming all ten connections and I think it may lead to worse overall performance as the processing would have to occur client side but have you considered consolidating the connections and then using excel to identify the error conditions?

    Regards,

    Kirk

    P.S. I am looking forward to seeing a copy of your tool. Thanks for your contributions to the community.

  • serbach Profile Picture
    serbach 571 on at
    RE: GP Administrator's Dashboard

    Leslie,

    The data connections in my refex have no ODC files associated with them... so I exported a couple of the connections to ODC files. I opened up a couple of them in Notepad++ and, as I suspected, each one contains the sql command. So I WOULD have to have a separate ODC file for each of the 10 queries in the refex.

    It's working as designed, I'm sure... but I don't see the advantage of the ODC file in distributing a refreshable workbook. You have to change the server AND the database to get the dashboard to work... so (I'm guessing here) Excel would throw up 10 error messages saying that it couldn't connect and prompt you for the server names and database names, correct?

    Not feeling too sparkly today! This data connection stuff has had me scratching my head for quite a while... ever since I made my first refex with more than one data connection.

    Sincerely,

    Steve Erbach

  • serbach Profile Picture
    serbach 571 on at
    RE: GP Administrator's Dashboard

    Leslie,

    But wouldn't I have to make an ODC file for EVERY query? There are 10 of them connected to this workbook.

    Regards,

    Steve

  • L Vail Profile Picture
    L Vail 65,271 on at
    RE: GP Administrator's Dashboard

    Hello Sparkley,

    Have you tried creating an .odc? You could use this file to easily make the connections. Regarding uploading your Refrex to the share your code area (or whatever) I think you should absolutely do it. So we might have to fine tune it a little, you'll probably get some advice from folks who download it. I say go for it!

    Kind regards,

    Leslie

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans