We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Replacing MS ReportViewer

Thread ID:

Created:

Updated:

Platform:

Replies:

120000 Aug 21,2015 02:31 PM UTC Aug 25,2015 05:00 AM UTC ASP.NET Web Forms 4
loading
Tags: ReportViewer
Edson
Asked On August 21, 2015 02:31 PM UTC

I am a new user and trying to replace MS ReportViewer.
I have a webforms solution using VS2013.
I followed the online documentation "Create your first ReportViewer in ASP.NET"
I use rdlc reports localmode, but the reportviewer is not showing up.

Do I have to do something else?

WebForm CodeBehind 
            var prodlist = new Reports();
            List<ReportDataSource> rptDatasources = new List<ReportDataSource>();
            ReportDataSource rptDatasource = new ReportDataSource();
            rptDatasource.Name = "DataSet1";
            rptDatasource.Value = prodlist.GetRptAlunosLinq(2015);
            rptDatasources.Add(rptDatasource);
            ReportViewer2.DataSources = rptDatasources;


ReportApiController

    public class ReportApiController : ApiController, IReportController
    {

        //Post action for processing the rdl/rdlc report

        public object PostReportAction(Dictionary<string, object> jsonResult)
        {
            return ReportHelper.ProcessReport(jsonResult, this);
        }

 
        //Get action for getting resources from the report
        [System.Web.Http.ActionName("GetResource")]
        [AcceptVerbs("GET")]
        public object GetResource(string key, string resourcetype, bool isPrint)
        {
            return ReportHelper.GetResource(key, resourcetype, isPrint);
        }

 
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            //You can update report options here
        }
        

        //Method will be called when reported is loaded
        public void OnReportLoaded(ReportViewerOptions reportOption)
        {
            //You can update report options here
        }


    }


Global.asax
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            AreaRegistration.RegisterAllAreas();    
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            System.Web.Http.GlobalConfiguration.Configuration.Routes.MapHttpRoute(
                    name: "DefaultApi",
                    routeTemplate: "api/{controller}/{action}/{id}",
                    defaults: new { id = RouteParameter.Optional });
        }
    }


Soundara Rajan S [Syncfusion]
Replied On August 24, 2015 05:17 AM UTC

Hi Edson,

Thanks for using Syncfusion products.

We are unable to reproduce the reportviewer page rendering issue. We suspect that the issue might be occurred due to missed to specify theProcessingModeorReportServiceUrlproperty in asp design page in your application. However, we have prepared sample based on your requirement and it can downloaded from the below location.
Sample: http://www.syncfusion.com/downloads/support/forum/120000/ReportViewerASPCollectionDemo327401985.zip

Please find our below UG documentation for more details,
UG Link: http://help.syncfusion.com/ug/aspnet/Documents/gettingstarted39.htm

Please let us know, if you need further assistance.

Regards,
Soundara Rajan S.

Edson
Replied On August 24, 2015 03:13 PM UTC

Thanks for helping. The sample is working fine but report viewer is not working and not showing up in my solution.
I added all the scripts from the sample and checked all the references.
The only difference is that I am using newer versions of WebApi and Newtonsoft.Json installed from nuget.
The dataset has records. Any suggestions?

Edson
Replied On August 24, 2015 03:29 PM UTC

Thanks for helping. The sample is working fine but report viewer is not working and not showing up in my solution.
I added all the scripts from the sample and checked all the references.
The only difference is that I am using newer versions of WebApi and Newtonsoft.Json installed from nuget.
The dataset has records. Any suggestions?

I put a break point in ReportApiController.cs and found that code is not reaching the controller method PostReportAction.
Any ideas?

Soundara Rajan S [Syncfusion]
Replied On August 25, 2015 05:00 AM UTC

Hi Edson,

Sorry about the inconvenience caused.

We are unable to reproduce the mentioned issue (WebAPI actions are not invoke) at our end. We suspect that the error might be occurred due to missed to refer the WebAPI dependent assemblies in your application. So we request you to ensure the following dependent assemblies are properly referred in your application.


· System.Web.Routing
· System.Web.Http
· System. Web.Http.WebHost
· System.Net.Http
· System.Net.Http.WebRequest
· System.Net.Http.Formatting

If you still face any issue on this, then could you please share the reproducible sample with WebAPI dependent assemblies with us? It would be helpful for us to analyze this issue and provide the solution at the earliest.

Please let us know if you need further assistance.

Regards,
Soundara Rajan S.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;