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.

Login Failed for user "qa"

Thread ID:

Created:

Updated:

Platform:

Replies:

130662 May 24,2017 04:49 AM Jun 20,2017 08:52 AM ASP.NET Web Forms 9
loading
Tags: ReportViewer
Parth Gandhi
Asked On May 24, 2017 04:49 AM

Hello,

I have added reportviwer of syncfusion in my application.
I am trying to migrate my existing SSRS reports to this application using syncfusion reportviewer.

Following is my Default.aspx :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %>

<%@ Register Assembly="Syncfusion.EJ.Web, Version=15.2460.0.40, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Web" TagPrefix="ej" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
     <link rel='nofollow' href="scripts/ej.web.all.min.css" rel="stylesheet" />
        <script src="scripts/jquery-1.10.2.min.js"></script>
        <script src="scripts/jquery.easing.min.js"></script>
        <script src="scripts/globalize.js"></script>
        <script src="scripts/ej.web.all.min.js"></script>
     <title>
    </title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ej:reportviewer ID="rpt" runat="server" ReportPath="/SSRSService/Airport List" ReportServerUrl="http://19.168.11.21/reportserver1" ReportServiceUrl="/api/ReportApi" ProcessingMode="Remote"></ej:reportviewer>        
    </div>
    </form>
</body>
</html>

ReportApiController Code:
using Syncfusion.EJ.ReportViewer;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Net;
using System.Security.Principal;
using System.Web.Http;

namespace WebApplication1.Api
{
    public class ReportApiController : ApiController,IReportController
    {
        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)
        {
            //Add SSRS Server credentials here      

            string username = ConfigurationManager.AppSettings["ReportServerUserName"];
            string pw = ConfigurationManager.AppSettings["ReportServerPWD"];
            string domain = ConfigurationManager.AppSettings["ReportServerDomain"];
            string reportServerUrl = ConfigurationManager.AppSettings["ReportServerURL"];
            reportOption.ReportModel = new ReportViewerModel();
            reportOption.ReportModel.ReportServerCredential = new NetworkCredential(username, pw, domain);            
            reportOption.ReportModel.ReportServerFormsCredential = new Syncfusion.Reports.EJ.ReportServerFormsCredential(username, pw);
            reportOption.ReportModel.ReportServerPreAuthentication = true;
            reportOption.ReportModel.DataSourceCredentials.Add(new Syncfusion.Reports.EJ.DataSourceCredentials("NG", "qa", "!pw", "Data Source=DEVGXSQL01;Initial Catalog=Dev_Test", false));
            reportOption.ReportModel.ReportServerUrl = reportServerUrl;
            reportOption.ReportModel.ReportPath = "/SSRSService/Airport List";            
        }
        //Method will be called when reported is loaded
        public void OnReportLoaded(ReportViewerOptions reportOption)
        {
            //You can update report options here                
        }
    }

}

 and Web. Config is:
<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.6" />
      </system.Web>
  -->
  <appSettings>    
    <add key="ReportServerURL" value="http://19.168.11.21/reportserver1" />
    <add key="ReportServerUserName" value="samyak" />
    <add key="ReportServerPWD" value="samyak" />
    <add key="ReportServerDomain" value="netcour.com" />
    <add key="LoadEJResourcesFromAssembly" value="true" />
    <add key="EJResources" value="jsrender:true;themes:true;" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.6" />
    <httpRuntime targetFramework="4.6" />
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>      
  <identity impersonate="true" />
   
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <remove name="ApplicationInsightsWebTracking" />
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
    </modules>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

While run application i got below error:
"An error occured while processing the reportitem 'txtAirportId' and Object Reference not set to an instance of an object. 
StackTrace : at Syncfusion.RDL.Data.ReportModelContentCollection.Evaluate() 
at Syncfusion.RDL.Data.ReportModel.Evaluate()
Login failed for user "qa""

also i got i is undefined from ej.web.all.min.js file.

Please help me to resolve above errors.

Thanks,
Parth Gandhi


Yuvaraj Devarajan [Syncfusion]
Replied On May 25, 2017 02:24 AM

Hi Parth,  
  
Thanks for contacting Syncfusion support.  
  
We suspect the mentioned issue occurs when you have specified the “Do not use credential” option in datasource property for SSRS hosted repot file. So if we specify the “Do not use credential” option in datasource property then we should specify the UserName and password in connection string itself as shown in below code example,  
  
  public void OnInitReportOptions(ReportViewerOptions reportOption)  
        {                         
  
            reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("username","password");  
            reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("NG ", "qa","password", "Data Source=DEVGXSQL01;Initial Catalog=Dev_Test;User Id=ssrs1;password=password; Encrypt=True;", false));  
        }  
  
Or else, you can set the datasource username and password in “Use this User name and password” option in datasource property for the repot file as shown in shared screenshot, then you specify the UserName and password in Datasource credential as shown in below code example,  
  
            reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("username ","password");  
            reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("NG ", "qa", "password", "Data Source=DEVGXSQL01;Initial Catalog=Dev_Test;", false)); 
  
    
  
Please refer to the below MSDN documentation for more detail,  
  
Regards,  
Yuvaraj D.  


Parth Gandhi
Replied On May 25, 2017 06:02 AM

Hello Yuvaraj,

I have checked in my datasource property and its set the datasource username and password in "Use this User name and password" option in datasource property of report file.

so i have put below changes in my code
 reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("username ","password");  
            reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("NG ""qa""password""Data Source=DEVGXSQL01;Initial Catalog=Dev_Test;"false)); 
but its still getting same error of Login failed for user.

I think there is some misunderstanding,
can you please clear below points?
1)  If i remove below line from Init method, error is still getting same.
//reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("NG ""qa""password""Data Source=DEVGXSQL01;Initial Catalog=Dev_Test;"false)); 

2) I have seen in other blogs, we can pass DataSourceCredentials in List also. 
     public DataSourceCredentials(string name, string userId, string passWord, string connectionString, bool integratedSecurity);
     In above method and its arguments, what should be pass in "name" argument?
     its a datasource name(which is from shared datasource) or a dataset name(which is used in report to fetch values) or anything else?

3) "I is undefined" error will fire in console more than one times from ej.web.all.min.js 

Please help me for remove error of "Login Failed for user" and report will load successfully.

Thanks,
Parth Gandhi

Yuvaraj Devarajan [Syncfusion]
Replied On May 26, 2017 09:15 AM

Hi Parth, 
 
I have checked in my datasource property and its set the datasource username and password in "Use this User name and password" option in datasource property of report file. 
 
so i have put below changes in my code 
 reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("username ","password");   
            reportOption.ReportModel.DataSourceCredentials.Add(new  
DataSourceCredentials("NG ", "qa", "password", "Data Source=DEVGXSQL01;Initial Catalog=Dev_Test;", false));  
but its still getting same error of Login failed for user. 
 
I think there is some misunderstanding, 
can you please clear below points? 
1)  If i remove below line from Init method, error is still getting same. 
//reportOption.ReportModel.DataSourceCredentials.Add( 
new DataSourceCredentials("NG ", "qa", "password", "Data Source=DEVGXSQL01;Initial Catalog=Dev_Test;", false));  
 
We suspect the mentioned problem occurs when the incorrect credential detail (username and password) passed for the “NG” datasource in WebAPI controller. So we request you to set the correct Credential (username and password) detail for datasource value in webAPI to avoid the mentioned problem at your end.  
 
We have prepared a ReportViewer sample to load SSRS report and it can be downloaded from below location, 
 
If the problem still, persist then revert the shared sample with issue reproducible procedure to validate the mentioned problem at our end.  
2) I have seen in other blogs, we can pass DataSourceCredentials in List also.  
     public DataSourceCredentials(string name, string userId, string passWord, string connectionString, bool integratedSecurity); 
     In above method and its arguments, what should be pass in "name" argument? 
     its a datasource name(which is from shared datasource) or a dataset name(which is used in report to fetch values) or anything else? 
 
The string name argument present in DatasourceCredentail method is used to pass a data source name of the Report as shown in below screenshot and code example, 
 
        public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
            reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("ssrs", "RDLReport1"); 
            reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("AdventureWorks", "ssrs1", "RDLReport1")); 
        } 
 
 
 
 
3) "I is undefined" error will fire in console more than one times from ej.web.all.min.js  
 
The mentioned problem occurred in “ej.web.all.min.js” script file when initialziting the ReportViewer control. We have tested the current “ej.web.all.min.js” script file and it’s working properly at our end. So can you please share the “ej.web.all.min.js” script file referred in your application to validate the mentioned issue at our end.    
 
 
Regards, 
Yuvaraj D. 


Parth Gandhi
Replied On June 7, 2017 09:57 AM

Hello Yuvaraj,


Thanks for giving detailed information about credentials that works for me.


I have further queries related to use of "syncfusion" reportviewer. 

SSRS has facility to give  reference of assembly and classes using dll and we are using this functionality in our reports.

We have create one project for Report Custom Styles and give its dll reference in SSRS Reports as below




and using this we are giving custom styles in our reports.

Now the problem is right now the reports which are not using this custom styles are open in my demo application.

Can you please provide some information for how to open reports which are use this custom style from assembly reference?

Thanks,
Parth Gandhi



Yuvaraj Devarajan [Syncfusion]
Replied On June 8, 2017 05:42 AM

Hi Parth, 

We suspect the mentioned problem might be occurred when the assembly used in RDLC report is not referred properly in your application. Hence the custom style report is not working at your end, so we request you to refer the assembly file in your application to avoid the mentioned problem at your end. 

For your reference, we have prepared a sample and it can be downloaded from below location, 

If the problem still persists, then share your issue reproducible report with the assembly file to validate the mentioned issue at our end.  

Regards, 
Yuvaraj D. 


Parth Gandhi
Replied On June 9, 2017 03:35 AM

Hello Yuvraj,

Your sample is not working.

As per your reply i have put dll reference in my application but its not working.

Below is detailed description of our existing SSRS reports.

Please find attachment for custom report style which we have made for use while SSRS report creation.

If attached project not build than copy its dll to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\" folder .

and give its dll reference while make SSRS report like below


and it is used as below for different styles while create report.


Now the problem is when i open this type of report from my application then below error was display