How to transfer this code from ASP.NET to ASP.NET MVC to print crystal reports

后端 未结 1 756
梦谈多话
梦谈多话 2020-12-20 09:56

I have ASP.NET application and some crystal reports and I need to transfer the following code from ASP.NET and use same functionality in MVC , I am using entity framework.

相关标签:
1条回答
  • 2020-12-20 10:15

    As I see you completed everything and you need to pass parameters from View to crystal reports try this solution :

    <a href="/RPT/WebForm1.aspx/?order_number=@Model.labCashView.FirstOrDefault().order_number&deptid=@Model.labCashView.FirstOrDefault().DEPTID&testid=@Model.labCashView.FirstOrDefault().Test_Id&Culture=@Model.labCashView.FirstOrDefault().Culture">Print Result</a>
    

    Then in webform.aspx.cs write the following code and use the value passed from the link :

    TXTORDERID.Text = Request.QueryString["order_number"].ToString();
                TXTDEPTID.Text = Request.QueryString["deptid"].ToString();
                TXTTESTID.Text = Request.QueryString["testid"].ToString();
                TXTCULTURE.Text = Request.QueryString["Culture"].ToString(); 
    

    Hope this will help you and print crystal reports in your MVC view.

    0 讨论(0)
提交回复
热议问题