Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
--------------------------------aspx page code----------------------------------------

XML
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DisplayReport.aspx.vb" EnableEventValidation="false" Inherits="RawMaterialPriceIndex_Report" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"  Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html>
<!--[if IE 7 ]><html class="ie7" lang="en"><![endif]-->
<!--[if IE 8 ]><html class="ie8" lang="en"><![endif]-->
<!--[if IE 9 ]><html class="ie9" lang="en"><![endif]-->
<!--[if (gte IE 10)|!(IE)]><!--><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><!--<![endif]-->
<head runat="server">
    <title>IEEMA PVC | Report</title>
    <link type="text/css" href="CSS/style.css" />
</head>
<body>
    <form id="form1" runat="server">
    <input type="hidden" id="hidReportCode" runat="server" visible="false" />
    <div "row">
         <div id="divMessage" runat="server">
                            <div id="divSuccessMessage" runat="server" class="notification-box notification-box-success" visible="false">
                                <p><i class="icon-ok"></i><asp:Label ID="lblSuccessMessage" runat="server" Text=""></asp:Label></p>
                                <a href="#" class="notification-close notification-close-success"><i class="icon-remove"></i></a>
                            </div>
                            <div id="divErrorMessage" runat="server" class="notification-box notification-box-error" visible="false">
                                <p><i class="icon-remove-sign"></i><asp:Label ID="lblErrorMessage" runat="server" Text=""></asp:Label></p>
                                <a href="#" class="notification-close notification-close-error"><i class="icon-remove"></i></a>
                            </div>
                            <div id="divWarningMessage" runat="server" class="notification-box notification-box-warning" visible="false">
                                <p><i class="icon-warning-sign"></i><asp:Label ID="lblWarningMessage" runat="server" Text=""></asp:Label></p>
                                <a href="#" class="notification-close notification-close-warning"><i class="icon-remove"></i></a>
                            </div>
                            <div id="divInfoMessage" runat="server" class="notification-box notification-box-info" visible="false">
                                <p><i class="icon-info-sign"></i><asp:Label ID="lblInfoMessage" runat="server" Text=""></asp:Label></p>
                                <a href="#" class="notification-close notification-close-info"><i class="icon-remove"></i></a>
                            </div>
                       </div>
    </div>
    <div >


    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
        SelectMethod="GetData"
        TypeName="ds_RM_PriceIndex_Report_tbl_RM_PriceIndex">
    </asp:ObjectDataSource>


      <CR:CrystalReportViewer ID="rpt_CrystalReport" runat="server" Width="100%"
         AutoDataBind="true"  HasCrystalLogo="False"
         HasRefreshButton="True" HasToggleGroupTreeButton="False" BestFitPage="True" />
    </div>
    </form>
</body>
</html>


---------------------------------------vb.net code-----------------------------------

VB
try  
Dim ds As New System.Data.DataSet
Dim query As String = "exec proc_Report_GetMonthlyAttendance '','','2015-02-1 00:00:00.000','2015-03-31 00:00:00.000'"
           ds = New DAL.Aletheia.DBFunctions().getDataset(query)

           'ds.Tables(0).TableName = "dsTest"
           ds.Tables(0).TableName = "tbl_calendar"
           ds.Tables(1).TableName = "tbl_project_siteAttendance"
           ds.Tables(2).TableName = "tbl_SiteIN_OutTime"
           '' close the file stream
           Dim rep As ReportDocument = New ReportDocument()
           rep.FileName = Server.MapPath("Report/CrystalReport2.rpt")
<pre lang="vb">rpt_CrystalReport.Visible = True

           '' object of crystal report
           rep.SetDataSource(ds)
rpt_CrystalReport.ReportSource = rep
            rpt_CrystalReport.DataBind()
            rpt_CrystalReport.RefreshReport()
            rpt_CrystalReport.Visible = True
        Catch ex As Exception
            Throw ex
        End Try
Posted
Updated 19-Mar-15 18:00pm
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900