Monday, June 22, 2015

Running RDLC reports on Azure

After configuring and uploading the web app and its db, the ASPNET MVC worked perfectly until I tested the reports.
Started to check for answers and found a solution.

Errors that you may face, as below:-

  1. Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
     
  2. Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. 
  3.  Could not find file 'D:\home\site\wwwroot\Views\Reports\ItemLabels.rdlc'. 
  4.  Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. 


 So the errors 1,2 & 4 were clearly missing references and 3 was missing the rdlc file.
check on google and from this link on stackoverflow. I started adding one reference at a time.
so the solution was first to add new reference to the MVC web project and find the dlls from the GAC folder in "C:\Windows\assembly\GAC_MSIL\", each assemply have its own folder having different verstions, as I was using version 12, I selected that version for the below assemblies:-

  • Microsoft.ReportViewer.Common.dll
  • Microsoft.ReportViewer.ProcessingObjectModel.dll
  • Microsoft.ReportViewer.WebForms.dll (was already added)
  • Microsoft.ReportViewer.DataVisualization.dll

Steps: after selecting add referece, click on browse, and enter the path "C:\Windows\assembly\GAC_MSIL\", select each of the above folder and select the correct dll version for your application


On my local machine I had version 10,11 &12, 

Inside the version 12 folder there was one dll only, so I selected it.


And it appeared in the references as any dll 




All the the above need to have there property copy to local set to true.

And beware that the size of the dlls may go up to 10mb.


upload the RDLC file as I was still debugging.

The RDLC reports worked fine




Sunday, June 14, 2015

Azure SEO

We got accepted in the BizSpark program and the first thing I had in my head was to compare the performance of our web site with a version on the cloud, even though our landing page is pure html, a bit of java and optimized images, this was the result I got from GT Metrix,


so you can see from the above, that I already optimized the site to 98% on the normal hosting that we had (http://CanadianInfoTech.com).
And when we moved the html files directly to the cloud and checked it, we got the below:-



so we have one point that is making a big issue and its "The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:-"

so before fixing it, I wanted to move the main css & js to a CDN, checked some torurials and appeared now its a peace of cake, by doing the following:-

open your azure portal,

  1. select CDN, click the plus, select quick create.
  2. Select Otigin Type: Web App
  3. Select Original URL your target web site.



Be aware that there are a lot of tutorial that will tell you go and create storage, a container blob, set security, add your files, etc, that was the old method and had a lot of headache when you needed to update you files. dont use it anymore. a great video about this can be found here.

One issue here, you can't test it directly, so if you want to go for lunch,play a game or take a break this will be a good time for it, as it will take a bit of time till the new CDN end point will start working.

So we are back, the next day, checked the end point and the site opened from it, but I did not yet update the resources to read from the end point.

So I changed all the file references to the endpoint, for example :-
 laptop
to
laptop

References: if you still have a problem, this blog post was really helpful to me, here

before doing so, I needed to make a new copy of my web site, so I have a special version for the cloud.

If my the landing page was MVC ASP.NET I prefare to make html helper or another way to let all the resources work with the cdn, but for my company main page it was simple html.

So I started to replace the paths for the images, css and the js, here VS replace tool was handy.

For the stander JQuery and other well known plugins, I preferred to leave them on there cdn domains, to utilize caching from other web sites.

Used the Azure publishing and starting testing again. I'm expecting a small enhancement as we did not fix the main issue yet. And as expected 93%, the same results, but the paths for all the resource are coming from the CDN end point, great.

This link was really helpful, added the following to the web config:-




  
    
  
   
      
         
         
         
      
   

and the performance returned to normal, In php hosting it did not start 98%, but I updated the .htaccess file, so in IIS, the web config can do the trick.

even though that the last step was the key to enhance the performance, moving to the CDN was important.


And if you check the details this is basic comparison:-
# Item PHP Hosting Azure Hosting
1 Page Load time 1.52s 1.32s
2 Page size 490Kb 490Kb
3 Number of request 28 28
4 Page Speed Grade 98%98%
5 Y Slow Grade 86% 96%




So we see a small gain of 0.20 sec. Moving that 98% higher will not be an easy task, and if I have time I will try my best to find the main issues causing them and the best fixes.

I wanted to note that on the google developer insights I did not find a real difference between the two.
it was 89% for the desktop and 71% for the Mobil, we need to tackle these number later too.




Thursday, June 11, 2015

Programming Mobile Services for Android Handheld Systems: Concurrency

Completed another online certificate, this one was much more interesting talking more about patterns and services and near the end of the 4th course (total of 6 courses)

Shared link:
https://www.coursera.org/account/accomplishments/certificate/5ZNYR8W4YR




Tuesday, March 24, 2015

Great Online Courses

As I'm referring these site a lot to friends and colleges,  I decided to add them to the blog and share it.

So Im listing them below with thier links and slogans, I have experience with all of them and I can say it made learning more easier &  more joyful.

Coursera
Take the world's best courses, online, for free.
https://www.coursera.org

Novoed
NovoEd delivers effective and engaging online courses with our social learning platform.

Rethink your world - experience the best courses wherever, whenever you want.


Update me if  you think I need to add more :)

Saturday, January 24, 2015

SQL Linked Server connation to Informix database


Setting up connection to Informix Database through SQL Management Studio was not so easy anyhow with a bit of work and research it could be accomplished.

Im using MS SQL 2014 stander edition, with Informix database. The system localz need to be set too as it depend on the Informix setting, in my case Informix was hosted on Linux (Red Hat 6 Server) with Arabic language.

First: Informix SDK and locals
First we need to install the Informix sdk on the machine that is running SQL Management Studio . In my case I downloaded the latest 64bit from IBM web site (clientsdk.4.10.FC4DE.WIN) and installed it.
And then as I need the correct locals (Arabic Language) I installed the “Informix International Language Supplement” in my case it was “Informix International Language Supplement 3.30.MC2_C511MML” and selected Arabic “ar_AE.1256”

Even though it did not find the Informix directory I only needed to provide the path (“C:\Program Files\IBM Informix Client SDK”) and everything went fine.

If you are here you can configure the odbc driver and test that all setting in your host are correctly buy testing the ODBC 64bit setting.

Secondly:
I run the following in command prompt

            regsvr32 ifxoledbc


And to to prepare the Informix server to work with OLEDB we need to run a script on the master database of the server itself.
The script file can be found in the directory for the Informix SDK that we installed in the first step, we need to copy it to the Linux server hosting the Informix database and run it by using the dbaccess command as below:
                      dbaccess sysmaster coledbp.sql

Finally: inked Server Setting on SQL Management Studio
Before starting the linked server you need to change a bit of the driver setting by expanding the provider node and right clicking on the ifxoledbc and selecting properties.

We need to check the Dynamic parameter (The first name) and allow inprocess as below:



Starting the linked server setting, I opened Microsoft SQL Management studio, when to Server objects and then linked servers and right clicked and selected new linked server.
Added the following setting
General Tab
Linked Server:                   AnyNameYouLike  (for me I used INFORMIX_DB)
Provider:                             IBM Informix OLEDB Provider
DProduct Name:              ifxoledbc
DataSource:                       DatabaseName@ServerNAme
Provider String:                                 DB_LOCALE=ar_AE.1256;CLIENT_LOCALE=ar_AE.1256


Security Tab:
Be Made using This Security context:
Remote login:                    your login to the Informix database
With password:                your password to the Informix database


Server Options Tab
Change the RPC and RPC OUT to true


Note: If you don’t have special language setting you can leave the provider string empty.

Thats it, you start writing your T-sql and if everthing whent write you will start seeing your data

SELECT * FROM [INFORMIX_DB].[databaseName].[informix].[TableName]

Reference:
I got a lot of help from these articles: