Selasa, 23 April 2013

Solving ReportViewer Rendering Issue on IIS7

Applies to:
  • Internet Information Services 7.o (IIS7)
  • Microsoft Report Viewer Redistributable 2005

Symptoms:

  • Unable to render ReportViewer on ASP.NET Web pages while running on IIS7.
  • You have no problem viewing your reports when running on debug mode with your Visual Studio 2005.
  • You are able to view your reports on Report Manager but not able to view them on IIS7.
  • You encounter JavaScript error when loading your report page with ReportViewer. Image buttons such as calendar appear as red 'X'.

Cause:

  • When the ReportViewer control is added to Web Form (.aspx), the
    Reserved.ReportViewerWebControl.axd httpHandler is added to System.Web section of the Web.Config file. In IIS7, it should be added under System.Webserver section.
  • IIS7 Handler Mappings does not contain Reserved.ReportViewerWebControl.axd httpHandler, and therefore unable to render the ReportViewer elements needed by the JavaSript.

Resolution:

  • Open Internet Information Services (IIS) Manager and select your Web application.
  • Under IIS area, double-click on Handler Mappings icon.
  • At the Action pane on your right, click on Add Managed Handler.
  • At the Add Managed Handler dialog, enter the following:
    Request path: Reserved.ReportViewerWebControl.axd
    Type: Microsoft.Reporting.WebForms.HttpHandler
    Name: Reserved-ReportViewerWebControl-axd
  • Click OK.

Jumat, 19 April 2013

How BackUp Database with JobSchedule on SQLSERVER 2008R2

How  backup database with JobsShedule on SQLSERVER 2008R2.

before we have database will backup .i will give screenshoot to describe Process.

Open Your SQLSERVER 2008R2.


Next Open SQL Server Agent  and New Job


Next we make Name NewJob with Name=TestScheduleJob and oke.



Content Comand we must make Intruction to Backup database and Make Locate to destination file.bak you can see screenshoot below.Next open panel steps => New=>Oke



Next Open panel Scchedule =>New and you must imput name to Name job schedule and you can allow symbol red.



you must imput content Name,Occurs ,Occurs once at, and clik button Oke .you can see screenshoot below.



for panel alert and Notification Not Process and you go Panel Target and klik Button Oke.you can see screenshoot below






----------Oke Thank You,Maybe that can be useful-------




Kamis, 18 April 2013

The attempt to connect to the report server failed .check your Connection information and report server is compatible version

Example :
we have report make with Repo rting service and want connection with Website make from asp.net.always error mesagge this screenshoot below



i have solution for this error.

Open path :D:\SQLSERVERNEW\MSRS10_50.MSSQLANDRI\Reporting Services\ReportServer.

you find fille: rsreportserver.config

open file that and you add


<MaxAppDomainUnloadTime>30</MaxAppDomainUnloadTime>
<MaxQueueThreads>0</MaxQueueThreads>
<UrlRoot>http://127.0.0.1/ReportServer_MSSQLANDRI</UrlRoot>


and you open path:D:\SQLSERVERNEW\MSRS10_50.MSSQLANDRI\Reporting Services\ReportManager

you find file RSWebApplication.config

open file and you add


<Configuration>
  <!--  This configuration file is obsolete. Its content has been merged into rsreportserver.config -->

  <ReportServerUrl>http://127.0.0.1/Reports_MSSQLANDRI</ReportServerUrl>
  <ReportServerVirtualDirectory></ReportServerVirtualDirectory>
  <ReportBuilderTrustLevel>FullTrust</ReportBuilderTrustLevel>
  <Extensions>
    <DeliveryUI>
      <Extension Name="Report Server Email" Type="Microsoft.ReportingServices.EmailDeliveryProvider.EmailDeliveryProviderControl,ReportingServicesEmailDeliveryProvider">
        <DefaultDeliveryExtension>True</DefaultDeliveryExtension>
        <Configuration>
          <RSEmailDPConfiguration>
            <DefaultRenderingExtension>MHTML</DefaultRenderingExtension>
          </RSEmailDPConfiguration>
        </Configuration>
      </Extension>
      <Extension Name="Report Server FileShare" Type="Microsoft.ReportingServices.FileShareDeliveryProvider.FileShareUIControl,ReportingServicesFileShareDeliveryProvider"/>
    </DeliveryUI>
  </Extensions>
  <Add Key="MaxActiveReqForOneUser" Value="20"/>
  <Add Key="DisplayErrorLink" Value="true"/>
</Configuration>



Finish.
----------Oke Thank You mybe can be useful-----------









Melakukan Configuration Ulang Reporting Service dimana sebelumnya Report sudah terbentuk di server

dan misalkan anda ingin  akan melakukan instal report yang sama tetapi berbeda server.dan contoh di bawah ini Reporting service dari server .\MSSQL2008R2 yang di install di Server .\MSSQLANDRI


Yang pertama di lakukan adalah Backup terlebih dahulu dua database yang digunakan untuk Reporting service  misalkan dengan nama DB1REPORT dan DBREPORTTempDB .Seperti Gambar Contoh di bawah ini.


saya lakukan dengan melakukan backup dengan extensi.bak sehingga di dapatkan lah dengn nama DB1REPORT.bak dan DB1REPORTTempDB.bak.
Setelah itu buka SQLSERVER 2008R2 masuk sebagai server baru seperti tujuan awal untuk melakukan install reporting service di server yang berbeda. Di misalkan seperti gambar di bawah ini.


Setelah terbuka SQLSERVER dengan server seperti gambar diatas  maka selanjutnya buta new Database dengan nama seperti database yang sebelumnya kita backup dengan nama DB1REPORT dan DBREPORTTempDB dan kemudian lakukan restore dengan file.bak yang di backup sebelumnya.gambar dapat di lihat di bawah ini.



Selanjutnya apabila sudah melakukan Tahap tahap diatas dengan success maka kita mulai dengan configuration Reporting service nya.
Tahap selanjutya buka SQLSERVER 2008R2 lalu buka Configuration tools dan buka kembali Reporting service Configuration.seperi gambar di bawah ini.


Dan tampilan Reporting service Configuration seperti di bawah ini:


Setelah itu klik button Connect dan tampilan selanjutnya seperti di bawah ini.dan selanjunya buka panel Database.



Kemudian klik change Database



Klik Next



Klik Test Conection dan Next Lagi


Klik Next



Klik Next  dan Finish



Dan Seleah Finish maka  buka Panel Report Manager url seperti di bawah ini dan Klik.


setelah kita klik Link tersebut bisa kita lihat hasil nya succes  seperti gambar di bawah ini:

















Minggu, 14 April 2013

Make Report StarDate and EndDate with Reporting Service


How Make Report using Stardate and EndDate with Reporting Service.

Only Example.;

I have one Table with Name dbo.OutPengeluaran_detail with desain:

if we has make that table and have content data to show in reporting service.Example we see below:


Now start to open Reporting service in Sqlserver 2008 R2 and you open Report Builder.you can see below:

you must clik and show this below and choose blank report


and now we start desain report step by step :

we must connection database and table using report.



step two we make connection at dataset .you can see below:


step three we make add parameter name StarDate .screenshoot you see below:


Step Four we make add paramater again name EndDate.screenshoot you see below:



and result we make stardate nd Endate we see screenshoot below:

we make field stardate and field endate in Dataset:

StarDate in Dataset


EndDate in Dataset


and now we add field stardate and enddate in dataset


and we make setting to between stardate and enddate  in dataset and result you can see



and finaly to reporting you must right clik on insert table and you can drag field you need.
this below screenshoot report :



and if you run this screenshot report:




---------Oke Thank You mybe can be useful.---------



































Senin, 08 April 2013

How to Insert data with StoreProcedure sqlserver 2008 and code asp.net

To insert data in database with using storeprocedure and code c# we must instal sqlserver 2008.has we instal sqlserver 2008 we must make database,table and storeprocedure.you can see this below.



we must make table.example i make table name is TStoreProcedure with design below:

[idNama] [int] IDENTITY(1,1) NOT NULL,
[Nama] [nvarchar](50) NULL,
[Alamat] [nvarchar](50) NULL,
[Hobby] [nvarchar](50) NULL,

and now we open programmability=>storeprocedure and we make storeprocedure with names=storeproceduretest and content this below:


CREATE PROCEDURE [dbo].[storeproceduretest]
(

@Nama AS nvarchar(50),
@Alamat AS nvarchar(50),
@Hobby AS nvarchar(50)
)
AS
begin
Insert into [TStoreProcedure]
(Nama,Alamat,Hobby)values(@Nama,@Alamat,@Hobby)
end
go

and to coding in visual studio we must open visual studio 2008 =>new project=>asp.net webaplication
 you can see this below:


we coding in default.ascx this below

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="default.ascx.cs" Inherits="Module.StoreProcedure._default" %>
<asp:Panel ID="pnl1" runat="server">
    <table>
        <tr>
            <td>
                Nama
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtNAMA" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Alamat
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtalamat" runat="server" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Hobby
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txthoby" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btnsimpan" runat="server" OnClick="btnsimpan_click" Text="SIMPAN" />
            </td>
        </tr>
    </table>
    <asp:Label ID="lbltest" runat="server" Visible="false"></asp:Label>
</asp:Panel>


and coding default.ascx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;
using System.Data.SqlClient;
using System.Data;

namespace Module.StoreProcedure
{
    public partial class _default : PortalModuleBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnsimpan_click(object sender, EventArgs e)
        {
            try
            {
                string strsql = "storeproceduretest";
                SqlConnection mycon = new SqlConnection(@"Data Source=MSI\MSSQL2008R2;Initial Catalog=DB;User ID=RDO3;Password=1234567");
                SqlCommand mycomand = new SqlCommand(strsql, mycon);
                mycomand.CommandType = CommandType.StoredProcedure;
                mycomand.Parameters.Add("@Nama",SqlDbType.NVarChar,50).Value = txtNAMA.Text.ToString();
                mycomand.Parameters.Add("@Alamat",SqlDbType.NVarChar,50).Value= txtalamat.Text.ToString();
                mycomand.Parameters.Add("@Hobby",SqlDbType.NVarChar,50).Value= txthoby.Text.ToString();
                mycon.Open();
                int response = -1;
                response = mycomand.ExecuteNonQuery();
                if (response >= 1)
                {
                    lbltest.Text = "data berhasil disimpan";


                }
                else
                {
                    lbltest.Text = "data gagal";


                }


            }
            catch (Exception ex)
            {
            }

        }
    }
}


finaly result programing above you see this screenshoot below:






---oke Thank you ,I hope can be usefull---









Minggu, 07 April 2013

Make Module for Comentar with LinqQ.in DotNetNuke

I want give example to make module comentar di Dotnetnuke wuth using c sharp.

Oke we Start.
 I Make three Textbox and one button.you can see thiss below.!

 code on default.ascx.


<style type="text/css">
    .tablecoment
    {
        width: 390px;
        font-size: 14px;
        font-family: inherit;
        background-color: darkcyan;
        color: antiquewhite;
    }
    .tablerepeate
    {
        background-color: darkGray;
        font-size: 19px;
        color: aliceBlue;
        font-family: -webkit-pictograph;
    }
</style>
<table>
    <tr>
        <td>
            EnterName:
        </td>
        <td>
            <asp:TextBox ID="txtName" runat="server" Width="200px" Height="20px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Subject:
        </td>
        <td>
            <asp:TextBox ID="txtsubject" runat="server" Width="200px" Height="20px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            EnterComment:
        </td>
        <td>
            <asp:TextBox ID="Txtcomment" runat="server" TextMode="MultiLine" Width="300px" Height="100px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
        </td>
        <td>
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
        </td>
    </tr>
</table>
<asp:Repeater ID="rptcomentar" runat="server">
    <HeaderTemplate>
        <table class="tablecoment">
            <tr>
                <td colspan="2" class="tablerepeate">
                    <b>Comments</b>
                </td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            Subject:
                            <asp:Label ID="lblsubject" runat="server" Text='<%#Eval("Subject") %>'></asp:Label>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblcomment" runat="server" Text='<%#Eval("Comment") %>'></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            Post By:
                            <asp:Label ID="lbluser" runat="server" Text='<%#Eval("Username") %>'></asp:Label>
                        </td>
                        <td>
                            Created Date:
                            <asp:Label ID="lblDate" runat="server" Text='<%#Eval("PostedDate") %>'></asp:Label>
                        </td>
                    </tr>
                </table>
                <hr />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
            </td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>


code on default.ascx.cs.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;

namespace Module.Comentar
{
    public partial class _default : PortalModuleBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
               
                baindcomentar();
            }

        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                FormRegisterSolution.Entitas.Comentar objcomentar = new FormRegisterSolution.Entitas.Comentar();
                objcomentar.Username = txtName.Text;
                objcomentar.Subject = txtsubject.Text;
                objcomentar.Comment = Txtcomment.Text;
                objcomentar.PostedDate = DateTime.Now;


                FormRegisterSolution.Controler.ControlCommentar objcontrol = new FormRegisterSolution.Controler.ControlCommentar();
                objcontrol.addcomentar(objcomentar);

            }
            catch (Exception ex)
            {
            }


        }
        private void baindcomentar()
        {
            List<FormRegisterSolution.Entitas.Comentar> objcomentarlist = new List<FormRegisterSolution.Entitas.Comentar>();
            objcomentarlist = new FormRegisterSolution.Controler.ControlCommentar().comentarlist.OrderByDescending(s => s.Userid).Take(3).ToList();
            rptcomentar.DataSource = objcomentarlist;
            rptcomentar.DataBind();
        }
    }
}

and you can see image finaly this below.


---Ok Thank you ,I hope can be useful-----