Wednesday, December 2, 2009
My First Published Patent Application
Scanning Apparatus and System for Tracking Computer Hardware. I wrote a lot of the content myself and did the diagrams.
This whole thing came about when my wife's laptop was stolen from her car one night and I developed a way to find it. I tried out my new idea and found the laptop in less than a half hour and put the guy in jail.
For the full PDF patent application that was published by the USPTO, please click the link below:
http://www.freepatentsonline.com/20090210935.pdf
Monday, June 8, 2009
David Groos and His Linux Classroom Project (and me) Make It Into The Minnesota Business Journal
Check it out!!: http://www.minnesotabusiness.com/0p349a2857/do-you-get-stem/
Sunday, March 8, 2009
getSTEM + Linux in the Classroom = Awesome!!!
I recently had the pleasure of helping David Groos with a Linux networking problem specifically with setting up LTSP (Linux Terminal Server Project) with multiple NIC cards and subnets. I heard about this through my wife who works with Inetium in Bloomington, MN. They are partnered with a group called getSTEM. getSTEM is dedicated to helping educators find help, guest speakers, or just about anything from ordinary individuals and companies. It's a great resource and is specifically dedicated to promoting the areas they call STEM (Science, Technology, Engineering, and Math).
David is currently trying to further his district by bringing Ubuntu Linux into his science classroom. I really admire this initiative, and I feel that open-source software could dramatically change how technology-based education works in school districts. Because the software is free and works on machines that are a bit older, this could easily save districts millions of dollars in computer hardware and software.
I encourage people to look at David's blog and see what he is doing to change the way technology-based education. If you are interested in hearing about my contribution, the specific link is (http://groosd.blogspot.com/2009/03/fixed-network-and-thus-printer.html)
Sunday, November 23, 2008
TortoiseSVN checkout problem, ok button is grayed out w/ resolution.
RESOLUTION:
I found that adding a slash "\" to the end of the checkout directory field after I chose the directory fixed the problem.
EXAMPLE: If you have a folder called c:\test and you browse to it because you want that to be your checkout directory the field is then filled with the value "c:\test". You will notice that the "ok" box remains grayed out. The program actually requires an extra slash at the end of the directory name that isn't put there by the browse control but can easily be added manually after the fact. So if you change the value to "c:\test\" the ok box will no longer be grayed out and you can continue your checkout operation.
NOTE: This problem was found on TortoiseSVN version 1.5.5, I have no experience with similar problems with other versions.
Thursday, October 16, 2008
Windows Live Login Problems, the Wheel Just Spins... [Resolved]
Monday, October 13, 2008
Get User Roles from User ID Using C# in Microsoft CRM 4.0
This methodology is based on a post by Jim Wang at http://jianwang.blogspot.com/2008/01/crm-40-check-current-users-security.html in client-side jscript ; there isn’t much good information out on the web on how to do this in C#, and it is a bit more difficult than a normal retrievemultiple call considering it is a many-to-many relationship, so… here it is!
On a side note, congratulations Jim on getting awarded with the honor of CRM MVP.
public BusinessEntityCollection GetUserRoles(Guid guidUserID, ICrmService serv)
{
try
{
QueryExpression qe = new QueryExpression();
qe.EntityName = "role";
qe.ColumnSet = new AllColumns();
LinkEntity le = new LinkEntity();
le.LinkFromEntityName = "role";
le.LinkFromAttributeName = "roleid";
le.LinkToEntityName = "systemuserroles";
le.LinkToAttributeName = "roleid";
ConditionExpression ce = new ConditionExpression();
ce.AttributeName = "systemuserid";
ce.Operator = ConditionOperator.Equal;
ce.Values = new object[] { guidUserID };
LinkEntity le2 = new LinkEntity();
le2.LinkFromEntityName = "systemuserroles";
le2.LinkFromAttributeName = "systemuserid";
le2.LinkToEntityName = "systemuser";
le2.LinkToAttributeName = "systemuserid";
le2.LinkCriteria = new FilterExpression();
le2.LinkCriteria.Conditions.Add(ce);
le.LinkEntities.Add(le2);
qe.LinkEntities.Add(le);
RetrieveMultipleRequest rmRequest = new RetrieveMultipleRequest();
rmRequest.ReturnDynamicEntities = true;
rmRequest.Query = qe;
RetrieveMultipleResponse response = (RetrieveMultipleResponse)serv.Execute(rmRequest);
if (response.BusinessEntityCollection.BusinessEntities.Count > 0)
{
return response.BusinessEntityCollection;
}
else
{
return null;
}
}
catch (Exception ex)
{
WriteToFile("error: " + ex.ToString());
return null;
}
}
This post is provided as-is and implies no warranty; Jamie Miley does not assume any responsibility for problems arising from the use of this information.
Monday, October 6, 2008
Programmatically rendering a SQL Server Reporting Services (SSRS) report from Microsoft CRM 4.0 and capturing output in a file.
Programmatically running a SQL Server Reporting Services report and capturing output in a file for use from CRM.
It is possible in CRM to use SQL Server Reporting Services in order to run a report and capture the output in a file. The first problem is that you only see GUIDs listed for CRM reports under the SSRS report manager. To actually be able to run the report on the report server from the CRM report name you must publish the report for external use.
1. Go to “Workplace” and then “Reports” in CRM and click on the report you want to edit and click “Edit Report”.
2. Now click “Actions” and then “Publish Report for External Use”
If you now go into Sql Report Manager at http://myreportserver.mydomain.com/reports and go to your specific org database name, you will see the report you published for external use and any sub reports that are utilized by it. This now allows you to use the web-service and call it by name.
Now, create a plug-in or other application you want to run the CRM report.
In Visual Studio, make a web service reference to the SQL Server Reporting Services web service(. And use something similar to the following snippet of code to render the file and save the output to a file.
If you are using a separate application you would probably want to hardcode credentials, but if you were doing this in a plug-in or custom workflow assembly you would want to use the default credentials.
I also left some commented out code in this example to show how to populate report parameters.
ReportExecutionService rs = new ReportExecutionService();
//rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rs.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
rs.Url = "http://MySqlServer.MyDomain.com/reportserver/ReportExecution2005.asmx";
// Render arguments
byte[] result = null;
// Make sure you use your correct org database name of the following line
string reportPath = "/jmiley_MSCRM/Account Overview";
string format = "PDF";
string historyID = null;
string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
// Prepare report parameter.
//ParameterValue[] parameters = new ParameterValue[3];
//parameters[0] = new ParameterValue();
//parameters[0].Name = "EmpID";
//parameters[0].Value = "288";
//parameters[1] = new ParameterValue();
//parameters[1].Name = "ReportMonth";
//parameters[1].Value = "6"; // June
//parameters[2] = new ParameterValue();
//parameters[2].Name = "ReportYear";
//parameters[2].Value = "2004";
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;
ExecutionInfo execInfo = new ExecutionInfo();
ExecutionHeader execHeader = new ExecutionHeader();
rs.ExecutionHeaderValue = execHeader;
execInfo = rs.LoadReport(reportPath, historyID);
//rs.SetExecutionParameters(parameters, "en-us");
String SessionId = rs.ExecutionHeaderValue.ExecutionID;
Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID);
try
{
result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
execInfo = rs.GetExecutionInfo();
Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime);
}
catch (SoapException err)
{
Console.WriteLine(err.Detail.OuterXml);
}
// Write the contents of the report to an PDF file.
try
{
FileStream stream = File.Create(@"c:\upload_report.pdf", result.Length);
Console.WriteLine("File created.");
stream.Write(result, 0, result.Length);
Console.WriteLine("Result written to the file.");
stream.Close();
}
catch (Exception error)
{
Console.WriteLine(error.Message);
}
You can view full documentation on the SSRS web service from MSDN at:
http://msdn.microsoft.com/en-us/library/ms152787(SQL.90).aspx
Instead of PDF files, you can also create other types of files by changing the format string:
- MHT web archive – “MHTML”
- XML – “XML”
- CSV – “CSV”
- IMAGE – “IMAGE”
- EXCEL – “EXCEL”
- HTML – “HTML4.0”, “HTML3.2”, “HTMLOWC”
There are a few things to consider:
1. The file copy operation above will use the app domain’s credentials for creating the output file.
If you are using a plug-in or workflow assembly this will be the CRM app pool security account.
If you want the file to be created on a different server, you may want to change the app pool security account to an Active Directory account instead of the default “network service”.
2. Default credentials should be used for the web-service for plug-ins and workflow assemblies as it uses CRM security and will not let people access data through the reports that they do not have read access to in CRM.
This post is provided as-is and implies no warranty; Jamie Miley does not assume any responsibility for problems arising from the use of this information.