Skip to content

Commit 8f1ee23

Browse files
committed
v1.1.1 - added telemetry with Excel version started throug COM Interop
1 parent 3727721 commit 8f1ee23

9 files changed

Lines changed: 26 additions & 15 deletions

File tree

AnalyzeInExcel/AnalyzeInExcel.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@
101101
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
102102
<Private>True</Private>
103103
</Reference>
104+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
105+
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
106+
</Reference>
104107
<Reference Include="System.Xml" />
105108
<Reference Include="Microsoft.CSharp" />
106109
<Reference Include="System.Core" />

AnalyzeInExcel/App.xaml.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using AutoUpdaterDotNET;
88
using System.Windows.Input;
99
using System.Threading.Tasks;
10+
using System.Collections;
1011

1112
namespace AnalyzeInExcel
1213
{
@@ -120,14 +121,14 @@ protected override void OnStartup(StartupEventArgs e)
120121
this.MainWindow = splashScreen;
121122
splashScreen.Show();
122123

123-
bool excelStarted = ExcelHelper.CreateInstanceWithPivotTable(serverName, databaseName, cubeName, (ex) => th.TrackException(ex));
124+
bool excelStarted = ExcelHelper.CreateInstanceWithPivotTable(serverName, databaseName, cubeName, out string excelVersion, (ex) => th.TrackException(ex));
124125
if (excelStarted)
125126
{
126-
th.TrackEvent(EV_RUNEXCEL, "RunType", "Interop");
127+
th.TrackEvent(EV_RUNEXCEL, new (string propertyName, string propertyValue)[] { ("RunType", "Interop"), ("ExcelVersion", excelVersion) });
127128
}
128129
else {
129130
RunExcelProcess(serverName, databaseName, cubeName);
130-
th.TrackEvent(EV_RUNEXCEL, "RunType", "ODC File");
131+
th.TrackEvent(EV_RUNEXCEL, new (string propertyName, string propertyValue)[] { ( "RunType", "ODC File" ) } );
131132
}
132133
}
133134
finally

AnalyzeInExcel/ExcelHelper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static bool IsExcelAvailable()
3131
/// <param name="cubeName"></param>
3232
/// <param name="exceptionAction">Action that processes any exception - the function will return false, this is a way to manage logging/telemetry</param>
3333
/// <returns>true if the operation completes without errors, otherwise false (any exception is removed and the function returns false)</returns>
34-
public static bool CreateInstanceWithPivotTable(string serverName, string databaseName, string cubeName, Action<Exception> exceptionAction )
34+
public static bool CreateInstanceWithPivotTable(string serverName, string databaseName, string cubeName, out string excelVersion, Action<Exception> exceptionAction )
3535
{
3636
var connectionString = ModelHelper.GetOleDbConnectionString(serverName, databaseName);
3737
var connectionName = $"AnalyzeInExcel [{ serverName }].[{ databaseName }].[{ cubeName }]";
@@ -41,6 +41,9 @@ public static bool CreateInstanceWithPivotTable(string serverName, string databa
4141
try
4242
{
4343
Excel.Application app = new Excel.Application();
44+
45+
// Return Excel Version for diagnostics
46+
excelVersion = app.Version;
4447

4548
// Create a new workbook
4649
var workbook = app.Workbooks.Add();
@@ -82,6 +85,7 @@ public static bool CreateInstanceWithPivotTable(string serverName, string databa
8285
{
8386
// In case of error simply fails the request and forward the exception
8487
exceptionAction?.Invoke(ex);
88+
excelVersion = "<unknown>";
8589
return false;
8690
}
8791
return true;

AnalyzeInExcel/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.1.0.0")]
55-
[assembly: AssemblyFileVersion("1.1.0.0")]
54+
[assembly: AssemblyVersion("1.1.1.0")]
55+
[assembly: AssemblyFileVersion("1.1.1.0")]

AnalyzeInExcel/SplashLoading.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public SplashLoading()
5252

5353
private static Point GetCursorPosition()
5454
{
55-
POINT cursorScreenPosition;
56-
GetCursorPos(out cursorScreenPosition);
55+
GetCursorPos(out POINT cursorScreenPosition);
5756

5857
double widthInDevicePixels = SplashLoading.GetSystemMetrics(SplashLoading.SM_CXSCREEN);
5958
double widthInDIP = SystemParameters.WorkArea.Right; // Device independent pixels.

AnalyzeInExcel/TelemetryHelper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ public void TrackEvent( string eventName )
3939
{
4040
TC.TrackEvent(CreateEvent(eventName));
4141
}
42-
public void TrackEvent(string eventName, string propertyName, string propertyValue)
42+
public void TrackEvent(string eventName, IEnumerable<(string propertyName, string propertyValue)> properties)
4343
{
4444
var ev = CreateEvent(eventName);
45-
ev.Properties[propertyName] = propertyValue;
45+
foreach (var (propertyName, propertyValue) in properties)
46+
{
47+
ev.Properties[propertyName] = propertyValue;
48+
}
4649
TC.TrackEvent(ev);
4750
}
4851

AnalyzeInExcel/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net45" />
1111
<package id="System.Memory" version="4.5.4" targetFramework="net45" />
1212
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net45" />
13+
<package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />
1314
</packages>

ExternalToolsInstaller/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.1.0.0")]
36-
[assembly: AssemblyFileVersion("1.1.0.0")]
35+
[assembly: AssemblyVersion("1.1.1.0")]
36+
[assembly: AssemblyFileVersion("1.1.1.0")]

SetupAnalyzeInExcel/SetupAnalyzeInExcel.vdproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3420,15 +3420,15 @@
34203420
{
34213421
"Name" = "8:Microsoft Visual Studio"
34223422
"ProductName" = "8:Analyze in Excel for Power BI Desktop"
3423-
"ProductCode" = "8:{74F9C867-CF8A-4950-8406-6697988E2C17}"
3424-
"PackageCode" = "8:{3069CC2A-89EA-49B7-8DE5-444F6035B395}"
3423+
"ProductCode" = "8:{0BD291BA-8877-4547-9880-E07D08132653}"
3424+
"PackageCode" = "8:{A6A390AF-E3F0-40B8-ADF5-4D994A58EB43}"
34253425
"UpgradeCode" = "8:{FC2F9C00-CAD5-455E-BD9D-B1C607F4ABDA}"
34263426
"AspNetVersion" = "8:4.0.30319.0"
34273427
"RestartWWWService" = "11:FALSE"
34283428
"RemovePreviousVersions" = "11:TRUE"
34293429
"DetectNewerInstalledVersion" = "11:TRUE"
34303430
"InstallAllUsers" = "11:TRUE"
3431-
"ProductVersion" = "8:1.1.0"
3431+
"ProductVersion" = "8:1.1.1"
34323432
"Manufacturer" = "8:Sqlbi"
34333433
"ARPHELPTELEPHONE" = "8:"
34343434
"ARPHELPLINK" = "8:"

0 commit comments

Comments
 (0)