Telerik Forums
Reporting Forum
3 answers
469 views

I have a report where someone could pass in a parameter to show "Detail" for the record.  The "detail" is tied to a second  within the Telerik Report.  I am unsure of how to get it to fire and show as it should.  I have added the primary  and displays the records in the group header.  

Attached is an image of what my report looks like SQLDatasource1 is the primary  and uses parameters passed in to display.  If input parameter DetailFlag = true then I want to show the Detail Record which is tied to SQLDataSource2.  

Tried the following in the code-behind but not displaying.

Private Sub detail_ItemDataBound(sender As Object, e As EventArgs) Handles detail.ItemDataBound
    Dim section As Processing.ReportSection = TryCast(sender, Processing.ReportSection)
    If section.Report.Parameters("DetailFlag").Value = "True" Then
        Table1.Visible = True
    Else
        Table1.Visible = False
    End If
    section.Style.BackgroundColor = groupHeaderSection.Style.BackgroundColor
End Sub
Private Sub pageHeaderSection1_ItemDataBound(sender As Object, e As EventArgs) Handles pageHeaderSection1.ItemDataBound
    Dim section As Telerik.Reporting.Processing.PageSection = TryCast(sender, Processing.PageSection)
    Dim txtAsOf As Processing.TextBox = DirectCast(Processing.ElementTreeHelper.GetChildByName(section, "txtAsOf"), Processing.TextBox)
    Dim txtReportParam As Processing.TextBox = DirectCast(Processing.ElementTreeHelper.GetChildByName(section, "txtReportParam"), Processing.TextBox)
    txtAsOf.Value = "AS OF " & Today.ToString("MM/dd/yyyy")
    txtReportParam.Value = "FOR " & section.Report.Parameters("Area").Value.ToString & " - " & section.Report.Parameters("Status").Value.ToString
End Sub
Ivan Hristov
Telerik team
 answered on 11 Oct 2018
4 answers
411 views
Does Telerik Reporting for ASP.Net offer a built-in way to control access to reports based on either the user name or user role (using ASP.Net membership)? Is there a best practice for managing data access? I'm not sure that SQL Server security will be of much use, since the connection will typically be made with a service account for ASP.Net, rather than the individual user's account.
Silviya
Telerik team
 answered on 11 Oct 2018
1 answer
232 views

One of the reports on my company's product, which uses Telerik Reporting R3 2016, is intermittently generating an error about resolving the dsGiftCard object data source that it uses. Sometimes, the report viewer says that it is unable to create a report instance, while other times it says that it is unable to get the parameters. The error only occurs on our deployments and not on our local builds. Our local builds load the report much faster. Usually the report loads fine, but this error generates on such a random basis my team is having trouble tracking it and finding out the cause. We're hoping someone here at Telerik can help us resolve this issue.

exceptionMessage: "An error has occurred while resolving 'dsGiftCard' data source: An error occurred while invoking data retrieval method."
exceptionType: "Telerik.Reporting.Processing.Data.ObjectDataSourceException"
message: "An error has occurred."
stackTrace: " at Telerik.Reporting.Processing.Data.ObjectDataSourceInstanceResolver.TryResolveAsMethodInvocationOnTarget(Type type, Func`1 resolveTarget, String dataMember, ObjectDataSourceParameterCollection parameters, Object& result) ↵ at Telerik.Reporting.Processing.Data.ObjectDataSourceInstanceResolver.TryResolveAsMethodInvocation(Object dataSource, String dataMember, ObjectDataSourceParameterCollection parameters, Object& instance) ↵ at Telerik.Reporting.Processing.Data.ObjectDataSourceInstanceResolver.ResolveDataSource(Object dataSource, String dataMember, Boolean evaluateParametersValues) ↵ at Telerik.Reporting.Processing.Data.ObjectDataProviderBase`1.ResolveDataSource() ↵ at Telerik.Reporting.Processing.Data.ObjectDataEnumerable.ResolveEnumerable() ↵ at Telerik.Reporting.Processing.Data.ObjectDataEnumerableBase.GetEnumerator() ↵ at Telerik.Reporting.Processing.Data.SeedDataAdapter.GroupData(IEnumerable`1 rawData) ↵ at Telerik.Reporting.Processing.Data.SeedDataAdapter.Execute(IEnumerable`1 data) ↵ at Telerik.Reporting.Processing.Data.ResultSetAdapter.Execute(IEnumerable`1 data) ↵ at Telerik.Reporting.Processing.Data.MultidimentionalDataProvider.Execute(MultidimensionalQuery query) ↵ at Telerik.Reporting.Processing.ReportParametersManager`1.CalculateParameterProperties(P parameter, IReportParameter parameterDef, IDictionary`2 parameterValues) ↵ at Telerik.Reporting.Processing.ReportParametersManager`1.Calculate(P parameter, IDictionary`2 parameterValues) ↵ at Telerik.Reporting.Processing.ReportParametersManager`1.CalculateChildren(P parameter, IDictionary`2 parameterValues) ↵ at Telerik.Reporting.Processing.ReportParametersManager`1.CalculateParameters(IDictionary`2 parameterValues) ↵ at Telerik.Reporting.Processing.DocumentParametersManager`1.CalculateParameters(IDictionary`2 values, Boolean ensureCalculated) ↵ at Telerik.Reporting.Processing.DocumentParametersManager`1.GetMergedParameters(IDictionary`2 values) ↵ at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetParameters(String clientID, ClientReportSource reportSource) ↵ at lambda_method(Closure , Object , Object[] ) ↵ at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) ↵ at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) ↵--- End of stack trace from previous location where exception was thrown --- ↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ↵ at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() ↵--- End of stack trace from previous location where exception was thrown --- ↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ↵ at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() ↵--- End of stack trace from previous location where exception was thrown --- ↵ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) ↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ↵ at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"

 

Here is the C# method that the data source gets its data from:

public static DataTable RunReport(string sessionId, string paramsJson, int tableIndex, int? savedDataId, int reportId)
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();
            DataSet ds = null;
            DataSet dsCache = null;
 
            try
            {
                var appSettings = new AppSettings();
                var expires = appSettings.Get("Cache.ExpirationInSeconds", 2);
                var urn = UrnId.CreateWithParts(sessionId, reportId.ToString(), paramsJson.GetHashCode().ToString());
                dsCache = _memCache.Get<DataSet>(urn);
                if (dsCache != null)
                {
                    _memCache.Replace(urn, dsCache, TimeSpan.FromSeconds(expires));
                    Log.Debug("Data found in cache");
                    return dsCache.Tables[tableIndex];
                }
                  
 
 
                ICacheClient cacheClient = null;
                if (appSettings.Get("Cache.Provider", "memory").ToLower() == "memory")
                    cacheClient = new MemoryCacheClient();
                else
                    cacheClient = AwsDynamoDbLogic.GetGenericDynamoDbCacheClient(AwsDynamoDbLogic.ResolveAwsDynamoDbSettings(new AppSettings()));
                var cdp = ConnectionDataProviderFactory.TryResolve(sessionId, cacheClient, appSettings);
 
                var dialectProvider = new MeevoSqlServerOrmLiteDialectProvider(() => cdp);
                var fac = new ReportDbConnectionFactory(cdp, dialectProvider);
 
                var repo = new ReportRepository(fac);
                var logic = new ReportLogic(repo);
 
                ds = AsyncContext.Run(() => logic.RunReportAsync(reportId, CancellationToken.None, paramsJson)) as DataSet;
 
                //Remove by pattern will enumerate through entire dictionary and remove all entries that have expired or macth the regex
                //lINE 331
                _memCache.RemoveByPattern("{0}*".Fmt(UrnId.CreateWithParts(sessionId)));
 
 
 
                _memCache.Add(urn, ds, TimeSpan.FromSeconds(expires));
 
                Log.Debug("Count of data sets is: " + ds?.Tables?.Count);
 
                if (ds == null)
                    Log.Debug("Data set is null");
                      
                return ds.Tables[tableIndex];
            }
            catch (Exception ex)
            {
                Log.Error("Source:\n" + ex.Source
                    + "\n\nTarget Site:" + ex.TargetSite
                    + "\n\nStack trace:\n" + ex.StackTrace
                    + "\nReport ID: " + reportId.ToString()
                    + "\nJson parameters: " + paramsJson
                    + "\nTable index: " + tableIndex
                    + "\n\nTable count: " + ds?.Tables?.Count
                    + "\n\nCached table count: " + dsCache?.Tables?.Count);
                throw;
            }
            finally
            {
                sw.Stop();
                Log.Debug("Execution Time: " + sw.ElapsedMilliseconds.ToString());
            }
        }

 

 

Anil
Top achievements
Rank 1
 answered on 10 Oct 2018
1 answer
107 views

Hi,

 

One of our customer has an issue to selected item from report parameters dropdown.

 

When dropdown is opened first time, all items shows correctly. After item selection, the first item disappear!?

 

This happens only IE 11 (version 11.2244.14393.0), no problems with Firefox or Chrome

 

What could cause this behavior?

 

BR,

Auvo

 

 

 

 

Silviya
Telerik team
 answered on 09 Oct 2018
4 answers
1.1K+ views
Hello,

I am binding table one of columns with Panel that has textbox and picturebox. I am giving Picturebox1.value="{Fields.[RowIcon]}", where RowIcon is byte[] contains image byte. Text box value comes properly  as per its binging expr. but for picture box it says invalid image data while processing picutre box.

I also tried changing RowIcon type to Image. But got same error.

Please help.

Regards,
Manish
Michela
Top achievements
Rank 1
 answered on 08 Oct 2018
1 answer
544 views
I have a Web Application using Telerik.Reporting.Services.WebApi with Html5 ReportViewer with a custom controller, where depending on the report type it uses a custom resolver.
There are 3 different report types and each one uses a HostAppId with a custom resolver. The storage is a Telerik.Reporting.Cache.File.FileStorage pointing to the same path for all 3 report types.

But after starting the application and generating the first report type, the other 2 types generates information in the storage path, but the report does not display any information, always being '0 pages loaded so far ...'.
It opens infinite requests - one after another - to an url like this "~/clients/085352-e708/instances/083615-c3d7/documents/085412-2b2a085412-5cbd/info" giving the same json response for them all:
{
"documentReady":false,
"pageCount":0,
"documentMapAvailable":false,
"bookmarkNodes":null,
"documentMapNodes":null
}

I believe that somehow by changing HostAppId, the cache is lost. How I fix this?

ReportBaseController

public class ReportBaseController<TReportResolver> : ReportsControllerBase
   where TReportResolver : IReportResolver, new()
{
   protected virtual string HostAppId { get; }

   protected string ReportCachePath => HttpContext.Current.Server.MapPath($"~/App_Data/reportcache");

   public ReportBaseController()
   {
       if (!Directory.Exists(ReportCachePath))
           Directory.CreateDirectory(ReportCachePath);

       this.ReportServiceConfiguration = new ReportServiceConfiguration
       {
           HostAppId = this.HostAppId,
           ReportResolver = new TReportResolver(),
           Storage = new Telerik.Reporting.Cache.File.FileStorage(ReportCachePath)
       };
   }
}


Controllers of the 3 different report types:

public class ReportSystemController : ReportBaseController<SystemReportResolver>
{
   protected override string HostAppId => "ReportSystem";
}

public class ReportClientController : ReportBaseController<ClientReportResolver>
{
   protected override string HostAppId => "ReportClient";
}

public class ReportListController : ReportBaseController<ListReportResolver>
{
   protected override string HostAppId => "ReportList";
}
Nasko
Telerik team
 answered on 05 Oct 2018
5 answers
1.7K+ views
Why are the two versions of Telerik.Reporting.OpenXmlRendering not included in the telerik nuget feed? This makes deployment especially difficult. Is there some way around this other than having to add the dll to my own source control?
Karl
Top achievements
Rank 1
 answered on 05 Oct 2018
2 answers
80 views

Hi admins, is it necessary to have the Report Server installed to display reports from asp .net web sites? In the marketing gumph this did not appear to be the case.

If not can you point me at the doco for displaying without the Report Server please.

Silviya
Telerik team
 answered on 05 Oct 2018
3 answers
244 views

Hi,

i'm try to pass two parameter to my report, in WPF/MVVM scenario, but the report can't see(Missing or invalid parameter value.). To be sure that report have the right parameters, i've put a texbox(into report) and set his value to the parameter's value. When i refresh report, "Missing or invalid parameter value" disappare, the textbox value have the correct ID but report no fetch record from Datasource.

This is my code:

XAML:

                <tr:ReportViewer telerik:StyleManager.Theme="Material" IsEnabled="{Binding ReportEnabled}"
                                 ReportSource="{Binding FormInternalReport_Source, Mode=TwoWay}" 
                                 HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.ColumnSpan="2" />

 

ViewModel:

       private ReportSource _FormInternalReport_Source;
        public ReportSource FormInternalReport_Source
        {
            get { return _FormInternalReport_Source; }
            set
            {
                Set<ReportSource>(() => this.FormInternalReport_Source, ref _FormInternalReport_Source, value);
            }
        }

        private void ExecuteInsert(object parameter)
        {

            //Report are enable only when Insert Button is clicked
            ReportEnabled = true;

            FormInternalReport_Source = new InstanceReportSource { ReportDocument = new Form_Internal(Report_ID) };
            FormInternalReport_Source.Parameters.Add(new Telerik.Reporting.Parameter(new Telerik.Reporting.Parameter("ID", Report_ID) ));                        
            FormInternalReport_Source.Parameters.Add(new Telerik.Reporting.Parameter(new Telerik.Reporting.Parameter("LanguageID", 1) ));


            try
            {
                RaisePropertyChanged("FormInternalReport_Source");
            }
            catch(Exception ex)
            { }


        }
Can someone help me?

Thanks.

SteSa
Top achievements
Rank 1
 answered on 04 Oct 2018
1 answer
223 views

Hi, 

We are getting the below error when trying to view any telerik report on our hosted webpages. 
Error registering the viewer with the service.


An error has occurred.
The process cannot access the file '\\sfs-iisfile\IIS Content\sfs.portal.webapp\reports-cache\509e4f1d\11.2.17.913\LCT\value.dat' because it is being used by another process.

We have a load Balanced environment and this error seems to happen sporadically, it happened a few months ago and seemed to correct itself but has now happened again.

Has anyone else experienced this issue and could help with possible fixes or suggestions?

Thanks in Advance,
Adam

Silviya
Telerik team
 answered on 04 Oct 2018
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?