• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1233
  • Last Modified:

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.
0
Ikramfies
Asked:
Ikramfies
  • 3
  • 2
1 Solution
 
mlmccCommented:
What code are you using?

On what event is the code?

mlmcc
0
 
IkramfiesAuthor Commented:
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

0
 
IkramfiesAuthor Commented:
the above function "showReport" iam clling on a button click
0
 
IkramfiesAuthor Commented:
I solve the above problem by putting the repost parameter siigning codes out side !ispostback
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now