Dynamically set Crystal Report still asks for db login

前端 未结 2 774
生来不讨喜
生来不讨喜 2021-01-26 03:46

I am trying to deploy Crystal Reports in my MVC application. To get full use of the Crystal Report Viewer, I have to use a webform, which

2条回答
  •  孤街浪徒
    2021-01-26 04:33

    You have to provide credentials for each datasouce in the report.

    Ideally, the report will have a single datasource. If this is not possible, you need to provide credentials for each, or data for each.

    Something like this works well if you want to provide the data:

    rd.Database.Tables[0].SetDataSource(testDt);
    rd.Database.Tables[1].SetDataSource(micssys);
    

    Otherwise, something like this will allow the report to access the db directly for each datasource:

    rd.SetDatabaseLogon("username","password}");
    

提交回复
热议问题