473,387 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

get parameter from one page to next into ObjectDataSource

and another problem which just wont work as I planned..

I created an aspx site (report) as follows:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Report.aspx.cs" Inherits="Report_Report" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>Report</title>
  8. </head>
  9. <body>
  10.     <div style="text-align:center;">
  11.         <form id="dateInput" name="dateInput" action="showReport.aspx" method="post">
  12.         Please enter start date of report&nbsp; &nbsp;
  13.         <input id="startDate" name="start" type="text" style="width: 165px" /><br />
  14.         Please enter end date of report&nbsp;&nbsp; &nbsp;
  15.         <input id="endDate" name="end" type="text" style="width: 165px" /><br />
  16.         <br />
  17.         <br />
  18.         <input id="Submit1" type="submit" value="submit" /></form>
  19.         &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
  20.         <input id="Reset1" type="reset" value="reset" />
  21.         </div>
  22. </body>
  23. </html>
the form is posted to showReport that looks like this:


Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#"%>
  2. <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
  3.     Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
  4.  
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6.  
  7.  
  8.  
  9.  
  10. <html xmlns="http://www.w3.org/1999/xhtml" >
  11. <head runat="server">
  12.     <title>Report</title>
  13.  
  14. </head>
  15. <body>
  16.     <form id="form1" runat="server">
  17.     <table align="center" style="width:950px; height:650px;" id="Table_top">
  18.         <tr>
  19.             <td align="center" class="Banner" id="headlogo" style="width: 941px; height: 119px;">
  20.                 <div id="banner-top">
  21.                     <div class="block block-block" id="block-block-2">
  22.                         <div class="blockinner">
  23.                             <div class="content">
  24.                                 <p>
  25.                                     <a href="http://?????">
  26.                                         <img alt="???" src="../images/xxx.jpg"
  27.                                             width="902" id="IMG1" onclick="return IMG1_onclick()" /></><br />
  28.                                     </a></p>
  29.                             </div>
  30.                         </div>
  31.                     </div>
  32.                 </div>
  33.             </td>
  34.         </tr>
  35.         <tr>
  36.         <td>
  37.             <div style="text-align:center;">
  38.         &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
  39.         </div>
  40.         </td>
  41.         </tr>
  42.         <tr>
  43.         <td style="background-color:#FFFFFF; text-align:center;">
  44.         <div>
  45.             &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br />
  46.                                     <rsweb:ReportViewer ID="ReportViewer1" ShowPrintButton="true" SizeToReportContent="true" runat="server" Font-Names="Verdana" Font-Size="8pt"
  47.                                         Height="900px" Width="800px">
  48.                                         <LocalReport ReportPath="Report\Report.rdlc">
  49.                                             <DataSources>
  50.                                                 <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1_guest" />
  51.                                             </DataSources>
  52.                                         </LocalReport>
  53.                                     </rsweb:ReportViewer>
  54.                                     <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="DataSet1TableAdapters.guestTableAdapter" SelectMethod="GetDataByArrival">
  55.                                        <SelectParameters>
  56.                                         <asp:Parameter Name="startDay" />
  57.                                         <asp:Parameter Name="endDay" />
  58.                                         </SelectParameters>
  59.                                         </asp:ObjectDataSource>
  60.                                     &nbsp;
  61.             &nbsp;<br />
  62.     </div>
  63.     </td>
  64.     </tr>
  65.     </table>
  66.     </form>
  67.     &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
  68. </body>
  69. </html>
the Method 'GetDataByArrival' has two parameters: startDay and endDay I tried to use selectparameter but I just cannot get the form values into the selectparameter my report just does not fill with the required information. If I use the 'GetData' method my report is shown no problem and if I specify some default values for the 'SelectParameters' the report is shown as well ...

Thanks in advance for any help.

Kat
Nov 14 '07 #1
0 1316

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: | last post by:
Hi, I've defined an ObjectDataSource and a parameterized DataSet. I would like it if I could pass the parameter value that describes the query that creates the DataSet as part of a user control...
2
by: Damon | last post by:
Help! Need this fixed ASAP. I have a GridView/DetailsView master/details form set up, with both bound to separate ObjectDataSource objects. Both the GridView and the DetailsView have a...
1
by: misiek | last post by:
Hi all. I have a problem with setting value of some parameter in select command in ObjectDataSource. This is what I did: 1. I created DataSet in designer using some stored procedure, which...
3
by: Jeff | last post by:
Hey ASP.NET 2.0 This the ObjectDataSource in my UserControl, <asp:ObjectDataSource ID="odsMessage" runat="server" SelectMethod="ExecuteMessage" TypeName="AH.MyNetwork.BLL.Network.Message">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.