Dynamically set Crystal Report still asks for db login

前端 未结 2 773
生来不讨喜
生来不讨喜 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:26

    Have a look at my Blog post here on this.

    There are a couple of actions required, but the main one is to create a new TableLogOnInfo instance, and then apply is using ApplyLogOnInfo.

    0 讨论(0)
  • 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}");
    
    0 讨论(0)
提交回复
热议问题