0
votes

I want to make reporting page using SSRS rdlc in ReportViewer Control

here my ReportViewer code

<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="510px" Width="978px">
        </rsweb:ReportViewer>

    </div>
    </form>
</body>

Then here my control code

Imports Microsoft.Reporting.WebForms

Public Class ReporingForm
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ReportViewer1.ProcessingMode = ProcessingMode.Local
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("Reporting.rdlc")
        Dim entities As DepenseEntities = New DepenseEntities
        Dim datasource As ReportDataSource = New ReportDataSource("Dossiers", (From dossier In entities.Dossier.Take(10) Select dossier))
        ReportViewer1.LocalReport.DataSources.Clear()
        ReportViewer1.LocalReport.DataSources.Add(datasource)
    End Sub

End Class

I get no execution error, but my ReportViewer Keep Refreshing in infinite loop

here my result web page

enter image description here

Note that i'm using MVC Application in my project and WebForm for reportViewer

Could annyone have solution to this issue ? How could i convert the EF datasource to Datasource using DataSet

1

1 Answers

0
votes

This should work:

            Dim report = New LocalReport()
report.SetBasePermissionsForSandboxAppDomain(New PermissionSet(PermissionState.Unrestricted))
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.ReportPath = Server.MapPath("Reporting.rdlc")
Dim result = //get data from your entities into a list for example.
datasource = New ReportDataSource("DataSet1", result)
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(datasource)
ReportViewer1.LocalReport.Refresh()    

So, just filter your data from your entities into a list or so and it should work. I hope that this will help.