Crystal Reports :: Pass GridView Row Columns As Parameter?
Mar 12, 2013
I have a crystal report which accepts a parameter and gets displayed on a webpage abc.aspx
On another webpage i have a grid displaying columns from a table loan_request.
When I click a row in gridview I want to get the report of that corresponding row.
I used rowcommand on gridview to get the value that uniquely identifies the row in a gridview, now I need to pass this value as parameter to the crystal report.
for this i think two possibilities
1. pass the value as querystring.
2. store it session and use it on the page that display the report.
I am using the following code to pass parameter from VB to crystal report but getting the error messgae "Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))" while it trying to add the first parameter. This chunk of coding works in another VB perfectly. The only diffferent is the working one takes the parameter to stored procedure where the failed one I added parameter during crystal report design time.
I defined a report with a parameter (ID_Aluno) in Crystal Reports to show it in an .aspx page. The page is called by another page passing it a query string with the value I need as a parameter in the report. In the code behind file I tryed three different approches without success. What happen is that the report is showed without data, but when I open the parameter panel I see that the parameter is there (If I don't set the parameter value actually it complains that the parameter is missing, giving an arror).
Here is the code I used to set the parameter:
[Code]....
The First try (code not commented) is the one I would like to use because it is the shorter and simpler one.
Here is the mark up for the report source and report viewer:
[Code]....
Have I to declare or define something special in Crystal Reports for the parameter to be received and applied?
I am developing we application using Csharp on Visual studio 2008.How can I pass values from Page or GridView to a Crystal Report? For example I want some details on a Default.aspx want to appear on the Crystal report when I click on it. How do I pass theses values from Page to crystal report at Runtime?
I has developed a crystal report, which display the records from a table and filters them based on a parameter( date range parameter). now I has integrated the report into a asp.net page using c#, but when I am running the asp page it is not promption for the date range values, it used to prompt for date range when I run the report in crystal report.
I am creating the crystal report without database data, just i am read the data from text file and fill into dataset then genrate the crystal report but problem is here if i am export the crystal report into different format so he wants the database logon parameter.so in this case i have no database crendential because i am creating the report without database.
I create an ASP.NET Crystal Report Web application using VS.NET 2010. In ASP.NET page, I stored two values in Session state and need to pass them as input parameters to Oracle stored procedure. In Crystal reports 2010 once you connect to a stored-procedure as data source, it automatically creates the parameter fields with Crytal Report Viewer. how I pass values to store procedure at runtime automatically.
2. I like to pass above values to the store procedure with IN parameters named P_CourseNo and P_StudentNo to print out the Crytal Report with Store Procedure as data source.
When i run the application locally it works fine but when i publish it n access from it it gives the error asEither the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.
I have basic understanding to cache webpages for duration. Now I have some complex requirements:
1. User e.g "Nauna" login in asp application 2. Visit on report page 3. Pass data range from 01-01-2013 to 30-12-2013 and extract the report which retreive data in 55 seconds on gridview 4. Now I want that when next time user "Nauna" login in the application and use the same report with same parameter 01-01-2013 to 30-12-2013 so that report should be come up from cache instead of run the complete life cycle.
I am trying to populate a report with parameters from session. Problem I am getting is that it is asking for parameter after I click the 2nd page of report. If I remove the Session.Remove it works good. Is there anyway to clear session after the first time the code executes? Here is my report viewer page code
I am using a sub report inside the main report but the issue is thatboth main and sub report take same argument i.e emp-idwhat i want is that either subreport copy parameter of main reportor in some way should be able to send paramet throug code-
"Session["username"]="muneeb"; ReportDocument report = new ReportDocument(); report.Load(Server.MapPath("~/UOGERP/GUI/Reports/CrystalReport.rpt"));
I am trying to pass date as parameter from my asp application to crystal reports.
If I pass 1 jan 2010 to 16 Jun 2010 it will not get me some of the records which are on dates like 11 april 2010. And If i select dates between 1 Jan 2010 and 30 Nov 2010 then system will get me the records. Here I understood that system is not understanding the date format the problem is in date format of "dd/mm/yyyy" and "mm/dd/yyyy".
I have 2 asp.net pages first page (PaySlipForm.aspx) contains ui elements for getting values from user, second page shows the report depending on the parameters passed from first page. The problem is first time the report shows correctly but when I go back on first page by clicking the back button of browser and changes the selection the report is shown empty only labels are shown.
First Page PaySlipForm.aspx <asp:DropDownList ID="ddlAllEmployees" runat="server" style="margin-left: 7px" Height="20px" Width="174px"> </asp:DropDownList> <br /> <asp:DropDownList ID="ddlMonth" runat="server" Height="23px"> </asp:DropDownList> <br /> <asp:DropDownList ID="ddlYear" runat="server" style="margin-left: 18px" Height="23px" Width="77px"> <asp:ListItem>2010</asp:ListItem> <asp:ListItem>2011</asp:ListItem> <asp:ListItem>2012</asp:ListItem> </asp:DropDownList> <br /> <asp:Button ID="btnShow" runat="server" Text="Show" PostBackUrl="~/Reports/PaySlipViewForm.aspx"/> Second page is PaySlipViewForm.aspx that has the code <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" EnableDatabaseLogonPrompt="False" Height="50px" ReportSourceID="CrystalReportSource1" Width="350px" /> <CR:CrystalReportSource ID="CrystalReportSource1" runat="server"> <Report FileName="../Reports/PaySlip.rpt"> </Report> </CR:CrystalReportSource> --------------------- if (!IsPostBack) { int employeeID = Convert.ToInt32((((DropDownList)Page.PreviousPage.FindControl("ddlAllEmployees")).SelectedValue)); int monthID = Convert.ToInt32((((DropDownList)Page.PreviousPage.FindControl("ddlMonth")).SelectedValue)); int year = Convert.ToInt32((((DropDownList)Page.PreviousPage.FindControl("ddlYear")).SelectedValue)); CrystalReportViewer1.SelectionFormula = "{Payroll.EmployeeID} = " + employeeID + " And {Payroll.Month} = " + monthID + " And {Payroll.Year} = " + year; }
protected void btn_showReport_Click(object sender, EventArgs e) { //ReportViewer1.Visible is set to false in design mode ReportViewer1.Visible = true;
[Code].....
Parameter 'Comp_Name' does not exist on this report
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Parameter 'Comp_Name' does not exist on this reportSource Error: