Jes Sie

Jes Sie

  • 744
  • 1.2k
  • 281k

Reports in VS2015

May 30 2017 1:08 AM
I created a report in VS2015, please see below
 
 
This report was not deployed in a report server. It only resides in the project application. I was able to view it without any parameter. But When I added a parameter, I don't know how to call the report in the backend of my DailySalesReport_ECI. I tried this code but gives me an error.
  1. protected void btnSearch_Click(object sender, EventArgs e)  
  2.         {  
  3.             ReportViewer1.Width = 900;  
  4.             ReportViewer1.Height = 600;  
  5.             ReportViewer1.ProcessingMode = ProcessingMode.Remote;  
  6.   
  7.             ReportViewer1.ServerReport.ReportPath = "~/DhipayaAgents/Reports/DailySalesReport_ECI.aspx";  
  8.             ReportViewer1.ServerReport.Refresh();  
  9.         }  
 Below is my aspx code:
  1. <body>  
  2.     <form id="form1" runat="server">  
  3.     <div>  
  4.         <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>  
  5.         <div>  
  6.             <table>  
  7.                 <tr>  
  8.                     <td>  
  9.                         Start date:  
  10.                     </td>  
  11.                     <td>  
  12.                         <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>  
  13.                     </td>  
  14.                 </tr>  
  15.                  <tr>  
  16.                     <td>  
  17.                         End date:  
  18.                     </td>  
  19.                     <td>  
  20.                         <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>  
  21.                     </td>  
  22.                 </tr>  
  23.                 <tr>  
  24.                     <td colspan="2" style="text-align:center;">  
  25.                         <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />  
  26.                     </td>  
  27.                 </tr>  
  28.             </table>  
  29.   
  30.         </div>  
  31.         <br />  
  32.         <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="1008px">  
  33.             <LocalReport ReportPath="DhipayaAgents\Reports\DailySalesReport_eCI.rdlc">  
  34.                 <DataSources>  
  35.                     <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet_eCI_DailyReport" />  
  36.                 </DataSources>  
  37.             </LocalReport>  
  38.         </rsweb:ReportViewer>  
  39.   
  40.         <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="DhipayaEci.DhipayaAgents.Reports.DSShortTermTableAdapters.DTeciTableAdapter">  
  41.             <SelectParameters>  
  42.                 <asp:ControlParameter ControlID="txtStartDate" Name="StartDate" PropertyName="Text" Type="DateTime" />  
  43.                 <asp:ControlParameter ControlID="txtEndDate" Name="EndDate" PropertyName="Text" Type="DateTime" />  
  44.             </SelectParameters>  
  45.         </asp:ObjectDataSource>  
  46.           
  47.     </div>  
  48.     </form>  
  49. </body>  
Hope someone can guide me. Thanks 
 

Answers (2)