Click here to Skip to main content
15,888,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually,
I have created one report in sap crystal report tool supporting vs10
Report is called with the help of stored procedure and it's working fine.And in the sameway, I am calling sub report in main report it's working when i am inserting initial parameters but I need to call it globally by my aspx page.
I need a code to call my sub report in below code?????

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CrystalDecisions.CrystalReports.Engine;
public partial class frmRptPurchaseOrder : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button2_Click1(object sender, EventArgs e)
    {
        GenRep();
    }


    private void GenRep()
    {
        ReportDocument reportdocument = new ReportDocument();
        try
        {
            reportdocument.Load(Server.MapPath("PurchaseOrder.rpt"));
            reportdocument.SetDatabaseLogon("", "", "", "");
            
            reportdocument.SetParameterValue("@p_fin_year_id", "8");
            reportdocument.SetParameterValue("@p_bracnh_id", "4");
            reportdocument.SetParameterValue("@p_po_id", "3792");
            
            CrystalReportViewer1.ReportSource = reportdocument;
        }
        catch
        {
        }
        finally
        {
            reportdocument = null;
        }

    }
    protected void CrystalReportViewer1_Navigate(object source, CrystalDecisions.Web.NavigateEventArgs e)
    {
        GenRep();
    }


}


Please anybody help me to over come dis issue.............
Posted
Updated 4-Mar-13 23:33pm
v2

By using a subreport link. It's working by putting a parameter in it. But need to call it on a aspx page for different values.For same value it's working nicely without putting any further code in it..
 
Share this answer
 
can u explain how u linked your sub report with main report ?
 
Share this answer
 

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