Saturday, January 6, 2018

What is FromArgb(int32, int32, int32,int32) in creating color by code?

It is from System.Drawing namespace and used in SolidBrush Class.

Its usage syntax in .NET for Windows Universal is:
Windows.UI.Color.FromArgb(byte,byte,byte,byte)

In the above, the first argument is the alpha channel(transparency) that runs from 0 to 255; the next three are red, green and blue channels in that order each from 0 to 255.

For example:
Windows.UI.Color.FromArgb(75, 255, 0,0) produces Background color 'red' with a transparency of 75.

Thursday, January 4, 2018

What is Windows Template Studio?

Windows Template Studio grew out of the free program, Windows App Studio.

Windows Template Studio (WTS) provides you with a wizard driven UWP app creator by brining togehther everything you need in terms of projects, frameworks, and features together in one place.

The wizard walks user through the following steps neceesary to create UWP apps:

Project Type: You can seelect standard layouts and predefiend controls
Framework: You can select the structure of your app. You have access to both in-house as well as 3rd party frameworks
App Pages: Choose type most appropriate for your use
App Features: easily add features such as background tasks etc.

WTS has gone Open Source. You can go that way, if you prefer.

WTS has goen through couple of updates and the latest version is Windows Template Studio 1.5 (also 1.6 is almost there).

More details here:
https://github.com/Microsoft/WindowsTemplateStudio


Wednesday, January 3, 2018

How do I troubleshoot 'Report Server WMI Provider error' in SSRS 2017?

You have SQL Server Developer 2017 installed with a default instance and you have a SQL Server Reporting Services Configuration Manager. You try to configure the Reporting Services 2017 using the configuration manager and you encounter this error.


SSRS17ConfigManageError_0

You verified that WMI is working and you can get connected to the local computer using wmimgmt.msc command as shown.

SSRS17ConfigManageError_1

The first thing is to check if SQL Server is working and has started. This you can do in Control  | Panel Services. If it has not started, you can start it. You should also check if the Reporting Services for the particular instance has started, and start it if it has not.

If you do not find the SQL Server Reporting Services service in Control Panel|..|Services, the chances are you have not installed Reporting Services. The fact that you have a Reporting Services 2017 Configuration Manager does not guarantee that the Reporting Services is installed.

In this case trying to configure SSRS 2017 will result in the WMI error.

Another check you can make is to see if Reporting Services is in the WMI as shown. There are two Report Servers (one from SSRS 2012 and the other SSRS 2016) and there is no Report Server corresponding to a default instance.


SSRS17ConfigManageError_2

Prior to SQL Server 2017, Reporting Services was installed when you installed the Database engine if you chose to include.

In SQL Server 2017 you need to install Reporting Services before you can configure it. Once you install SQL Server Reporting Services, this error goes away and you can continue configuring the Report Server. In this case, you can verify in WMI  as shown here.


and in the Control panel as shown.






How do you write C# code to a BUTTON click event in Visual Studio 2017?

I assume you have followed me with this post here:

http://hodentekhelp.blogspot.com/2017/12/how-do-i-configure-button-in-xaml.html

After reading the above you will see that you start with an empty project whose code is shown here:


WinPhoneStep1

In the final step you will have achieved this:


WinPhoneStep11


This project when deployed will just show a button as in the above and nothing more:

WinPhoneStep13

Writing code for a click event of this button.

Let us first give a name for this button, like ClickMe. When you highlight the button in the design by clicking it, the Property pane opens where you can write the name you want as shown.

winPhoneStep20

In the XAML code the Button gets a qualifier x:Name="ClickMe" as shown here:


Now enter the Click event to the code by just enter "cl" after a space as shown and the intellisense kicks-in showing your options as shown.

winPhoneStep22.png

You pick Click and you will see the following:

winPhoneStep23.png

Inside of double quotes type in ClickMe_Click (i.e., the name of the event).

Where do you write code ?

Make a right click on 'Click' as shown in the next image and you will see a pop-up as shown.

winPhoneStep24

At the top click on View Code (or F7) and you will go the code page in C# (MainPage.XAML.cs) as shown.
-----------
namespace HelloWorld
{
    ///
    /// An empty page that can be used on its own or navigated to within a Frame.
    ///

    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

    
        private void ClickMe_Click(object sender, RoutedEventArgs e)
        {

         
        }

    }
}

---------------

This by itself set up the scene for you to write the code.

Now you have to decide what it is you want to do when the button is clicked.

Let us say you want the font size of 'Hello' to increase so that after clicking the size, say double from 25 to 50.

Then you have to change the button's font-size property (initially 25 in design) as shown. You should leave the rest as is.
---------
private void ClickMe_Click(object sender, RoutedEventArgs e)
        {

         
            ClickMe.FontSize = 50;
           
        }

---------------------

Now if you BUILD the project and run as described in the earlier post you would see the following:

winPhoneStep25

Now you can click the Run button (Green arrow-head) with the following setting:


winPhoneStep26


After some processing your application displays with the start up page the following:


winPhoneStep27


After the start this is the first page.


winPhoneStep28


and when you click the button changes to this:


winPhoneStep29

That is all there is to it!

Happy New Year

Sunday, December 31, 2017

What do you need to use a map on Universal Windows App?

The application you are writing must be authenticated before the MapControl and the services that needed, the map services in the Windows.Services.Maps.

You need a maps authentication key from the Bing Maps Developer Center in a similar way that you need a key for using Maps on Google applications.

First click on this link to go to the Bing Maps Developer Center.
https://www.bingmapsportal.com

You may need to authenticate yourself with one of the available services, I usually go with Microsoft account. Enter your credentials and sign in and choose to associate that account with Bing Maps Account.



Proceed to create a new key(if you do not have one) using the CreateKey form
Complete Create key




Under My account menu, click My Keys,

The key is user specific and has been masked in the above.




Saturday, December 30, 2017

Show me how to write R Code for Hello World web page?

 R language is open source with a huge number of developers. It has a great arsenal of great stuff already accomplished. It is a language that you should get exposed to yourself. You just install R Gui and you are ready.


Shiny is an enterprise-grade web application framework targeted for those who want to develop with R using the familiar HTML5, CSS and JavaScript. Using R you can turn terrific analytic solutions you have developed/developing into interactive web applications.

Go to this site (https://shiny.rstudio.com/) directly and learn more.

 
Rshiny-00

If you have R Studio you have Shiny because Shiny is a package that you can download.

In this first part we only talk about the very basics.

I assume you have read my previous hands-on R examples in my blogs.


Here I just show a very basic (aka Hello World) example of creating content for a web page using R GUI. More will come later in my blogs.

Launch R Gui as shown and provide reference to the shiny "library" as shown by typing in the three lines of code (The four lines of code in red).


 HelloWorld_00

When you hit Enter after the third line where you define the shiny app, a browser window will open as shown displaying the apps output as shown at a port of the local host.



HelloWorld_01

You also get a response (the last line) in the R GUI as shown.




HelloWorld_02
That is all there is to create a content.

The ui summarizes your user interface, the server is something like a web server and shinyApp is your web response. No fuss, very simple.

How do I configure a BUTTON in XAML?

XAML is a XML based language that Microsoft developed to create a applications the easy way. XAML is declarative that means that whatever you declare up front is what you get. There is no more secret to it.

Universal Windows Projects use this language to build applications.

In this slideshow I show a step-by-step procedure to create an application with XAML which has just a button that displays Hello. It has some color and size to it. Although you will be seeing 18 or more slides once you grasp the spirit, you would do it under a minute.

In order to work with XAML you need Visual Studio 2017 Community. The good news is it is free. What is more BLEND, its comprehensive designer is also installed at the same time. You may also need Windows SDK for Windows 10 which can be found on the Internet. There are various versions.

In developing on Windows Platform be sure to use the intellisense feature that takes out all the mystery and gives you a very practical and intelligent way to work with design.

In this slideshow I show a step-by-step procedure to create an application with XAML which has just a button that displays Hello. It has some color and size to it. Although you will be seeing 18 or more slides once you grasp the spirit, you would do it under a minute.

So let us get on with this slideshow.