Link to home
Start Free TrialLog in
Avatar of Ikramfies
Ikramfies

asked on

Crystal report viewer asking parameters again when clicking on the tool bar

Dear all
I am working on an asp .net application in which I am using crystal report for showing reports. In my application everything works fine including the reports.
The real problem comes when I start clicking on the crystal report toolbar. If I click on any button on the crystal report tool bar like (Export, next page etc) it is asking parameters again.
Is there any way so that that the crystal repot viewer does not ask the parameter that I have already given .
I have also given true for the property reuseparametervaluesonrefresh.
Avatar of Mike McCracken
Mike McCracken

What code are you using?

On what event is the code?

mlmcc
Avatar of Ikramfies

ASKER

Im my application i am using push mechanism to show report,
iam assigning the output of an sp to a dataset and then giving the dataset as report source .
I had created an xml file and designed the report ,the xml file is having the same schema as the dataset


    private void showReport(string ReportPath, string ReportId)
    {
        Master.BusinessLayer ObjBL_Master = new Master.BusinessLayer();
        DataTable CompanyDetails = new DataTable();
        DataTable dt = new DataTable();
        DataSet Ds = new DataSet();
        CrystalDecisions.CrystalReports.Engine.ReportDocument Crpt = new ReportDocument();
        Crpt.Load(Server.MapPath(".") + ReportPath);
        DataTable dtheader = new DataTable();
        dtheader = ObjBL_Master.GetCompanyDetails(CompanyId);
        dtheader.TableName = "CompmayDetails";
        switch (ReportId)
        {
            #region SUPPLY
            case "27":
                dt = ObjBL_Master.GetEmployeMaster(CompanyId);
                Crpt.SetDataSource(dt);
                Crpt.OpenSubreport("HeaderDefault.rpt").SetDataSource(dtheader);
                Crpt.SetParameterValue("EmpName", "Employee Name");
                Crpt.SetParameterValue("Language", CurrCulture);
                Crpt.SetParameterValue("RecordCardNo", "Record Card No");
                Crpt.SetParameterValue("ServiceNo", "Service No");
                Crpt.SetParameterValue("ReportName", "Employee List");
                Crpt.SetParameterValue("User", UserName); 
                break;
            case "1":// Supply Purchase Order
                dt = BissLayer.RptSupplyPO(FinancialYear, CompanyId, Convert.ToInt16(cboComboOne.SelectedValue));
                Crpt.SetDataSource(dt);
                Crpt.SetParameterValue("User", UserName);
                Crpt.SetParameterValue("Supplier", GetLocalResourceObject("Supplier").ToString());
                Crpt.SetParameterValue("Address", GetLocalResourceObject("Address").ToString());
                Crpt.SetParameterValue("PONo", GetLocalResourceObject("SupplyPo_PONo").ToString());
                Crpt.SetParameterValue("Date", GetLocalResourceObject("Date").ToString());
                Crpt.SetParameterValue("QuotNo", GetLocalResourceObject("SupplyPo_QuotationNo").ToString());
                Crpt.SetParameterValue("POReqNo", GetLocalResourceObject("SupplyPo_POReqNo").ToString());
                Crpt.SetParameterValue("CostOp", GetLocalResourceObject("SupplyPo_CostOp").ToString());
                Crpt.SetParameterValue("FIns", GetLocalResourceObject("SupplyPo_FInsu").ToString());
                Crpt.SetParameterValue("Total", GetLocalResourceObject("SupplyPo_Total").ToString());
                Crpt.SetParameterValue("Code", GetLocalResourceObject("SupplyPo_Code").ToString());
                Crpt.SetParameterValue("Desc", GetLocalResourceObject("SupplyPo_Desc").ToString());
                Crpt.SetParameterValue("Qty", GetLocalResourceObject("SupplyPo_Qty").ToString());
                Crpt.SetParameterValue("Rate", GetLocalResourceObject("SupplyPo_Rate").ToString());
                Crpt.SetParameterValue("Amnt", GetLocalResourceObject("SupplyPo_Amnt").ToString());
                break;
}
        CrystalReportViewer1.ReportSource = Crpt;
CrystalReportViewer1.DataBind();
        WebPanelReport.Expanded = false;
}

Open in new window

the above function "showReport" iam clling on a button click
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I solve the above problem by putting the repost parameter siigning codes out side !ispostback