Friday, May 30, 2014

IIS Fixes

Hi All,

    It would we be heaven for the developers as well as administrators, who deploy their web application on IIS in a newly installed OS and its runs without showing some errors due to some authentication, security and installation issues. I very often end with such kinds of issues, infact most of us would.So i would like to share some of my IIS fixes, so that it can be useful for someone new to IIS. You can also post the issues that you come across with.

1 . HTTP Error 500.19

When multiple versions of the .NET Framework are executing side-by-side on a single computer, the ASP.NET ISAPI version mapped to an ASP.NET application determines which version of the common language runtime (CLR) is used for the application. In some case the ASP.Net my not be correctly installed and mapped to IIS for that particular version.
It can be done by using the following,

Open Cmd in Administrator Mode and type the following command.

c:\Windows\Microsoft.NET\Framework\[framework in which your application runs]\aspnet_regiis.exe -i

Ex:
c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

Monday, March 3, 2014

Setting Up SIP2 Server in KOHA

Hi Folks,

    Few days ago, my friend asked me to help him with setting up of SIP2 server in Koha. I started digging about koha and SIP2. I found some useful information, that i would like to share with you and who are struggling with the same problem.

    Koha is a open source Integrated Library System (ILS), that runs on Linux OS. Koha was developed using pearl language and MySql as database. Anyone who is trying to implement a RFID or BarCode based library management system with koha cannot be able to directly modify source code, because its so risky to touch the code without any in-depth knowledge in it. In order to get data from koha without touching the code, 3M System created a protocol named SIP2 (Standard Interchange Protocol).  Follow the procedures to Enable SIP2 in koha,

Setting Up and Running Koha :

Step 1 : Install Koha Or Use in Live Mode

Step 2 : Installing gedit : Open terminal and type the following command

Sudo apt-get install gedit

Step 3 : Edit host file to use koha in lan

Sudo gedit /etc/hosts

When you open the file you may see 127.0.0.1 in the file. It’s loop mapped to localhost. Replace the ip

address with the ip address of machine in which koha is installed.

Step 4 : Koha Instance Setup – SIPconfig

We have to configure SIP server to access it from LAN, Use the following commands

Sudo gedit /etc/koha/SIPconfig.xml

When you open the file you will see 127.0.0.1, change the IP address with servers ip address. Don’t

change the port. Change the username and password in that xml with a staff credential.

Step 5 : Enable SIP

Sudo koha-enable-sip library (Here library is instance name)

Step 6 : Start SIP

Sudo koha-start-sip library

Monday, November 5, 2012

Horizontal ScrollBar in 3d Bar chart (MS Chart Control) C#


Hi,

     While implementing 3d MS Chart (Microsoft chart control) in my .net project, i’ve  found out that 3d bar chart does not comes with Horizontal scroll bar implementation. When you have more number of datapoints in the chart you will be in trouble. Though the chart control has the property for the HScrollbar, it is not working on 3d charts. After a small effort, I found a simple solution for the implementation of HScrollBar.

     Drag the Chart Control from the toolbox and add it to a panel, Drag HScrollBar control from toolbox and add it to the bottom of the panel.

      Here i have created  a method called LoadGrid() to load data to the chart control. I'm using Datatable to load the datas for chart control. Name, Amount are the columns in my datatable. Here Name will be in XAxis and Amount will be in YAxis. hscroll_chart is HScrollBar controls variable.

public void LoadGrid(DataTable myDataTable)
{
      foreach (DataRow row in myDataTable.Rows)
                    {
                        chart1.Series["Channel 1"].Points.AddXY(row["Name"], row["Amount"]);
                    }
          chart1.DataManipulator.GroupByAxisLabel(“Sum” "Channel 1");


          chart1.Series["Channel 1"].ChartType = SeriesChartType.Column;
          chart1.ChartAreas["Default"].Area3DStyle.Enable3D = true;

                   var chartArea = chart1.ChartAreas[0];
                   chartArea.AxisX.Minimum = 0;
                    chartArea.AxisX.Maximum = chart1.Series[0].Points.Count;

                   chartArea.AxisX.ScaleView.Zoomable = true;
                   chartArea.AxisX.ScaleView.SizeType = DateTimeIntervalType.Number;

                   int position = 0;
                   int size = 20;
                   chartArea.AxisX.ScaleView.Zoom(position, size);

                   chartArea.AxisX.Interval = 1;
                   chartArea.AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount;

                     hscroll_chart.Value = 0;
                     hscroll_chart.Minimum = 0;
                     int ScalePoints = chart1.Series[0].Points.Count / 20;
                     hscroll_chart.Maximum = ScalePoints;
}

Then add the following in the HScrollBar Scroll event,

private void hscroll_chart_Scroll(object sender, ScrollEventArgs e)
        {
            var chartArea = chart1.ChartAreas[0];
            int val = (hscroll_chart.Value * 20);
            if (((hscroll_chart.Value * 20) + 20) <= chart1.Series[0].Points.Count)
            {

                chartArea.AxisX.ScaleView.Zoom(val, val + 20);
            }
            else
            {
                int rem = ((hscroll_chart.Value * 20) + 20) - chart1.Series[0].Points.Count;
                chartArea.AxisX.ScaleView.Zoom(val, val + rem);
            }
        }


Now run the application, when the DataPoints are more than 20 you can use scroll bar control. You can also change the DataPoints limit.


Friday, September 28, 2012

Programatically Set Custom PaperSize in CrystalReport

Programatically Set Custom 
PaperSize 
in CrystalReport

Hi,
     For one of our clients we are using crystal report  developed using Visual Studio 2005. At the deployment phase we often come across the problem of Setting Custom PaperSize in report. Our client is using custom page size of 11in x 6in , whenever the report preview is shown the report viewer automatically sets the size to A4. So the user can't able to view or print the report. So i searched  a lot to set paper size programatically. At last i found the following solution ,

  i)  First i have created Custom PageSize using ServerProperties (ie.,11in x 6in)  and named it as 11x6.

  ii) Then added the following method to my code,

  public Int32 GetPaperSize(String sPrinterName, String sPaperSizeName)
        {
            PrintDocument docPrintDoc = new PrintDocument();
            docPrintDoc.PrinterSettings.PrinterName = sPrinterName;
            for (int i = 0; i < docPrintDoc .PrinterSettings.PaperSizes.Count; i++)
            {
                int raw = docPrintDoc.PrinterSettings.PaperSizes[i].RawKind;           
                if (docPrintDoc.PrinterSettings.PaperSizes[i].PaperName == sPaperSizeName)
                {
                    return raw;
                }
            }
            return 0;
        }

  iii) Then i called this method  for the current Crystal Report Document, In my case 
CrystalReport11 is the Report Document



                this.CrystalReport11.PrintOptions.PrinterName = "Wipro LQ 1050+DX
";

                this.CrystalReport11.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)GetPapersizeID("Wipro LQ 1050+DX
", "11x6";