Telerik Forums
Reporting Forum
5 answers
137 views
Hi,

I'm getting this message error when I' try to export the report from my report viewer.



could somebody give me a hand with this please?

Regards.
Hinata
Top achievements
Rank 1
 answered on 19 Aug 2014
2 answers
147 views
I have a stand-alone HTML page based on the Report Viewer samples. This page calls the api/reports API. When my report is not parameterized, the Report Viewer works great and my report appears. I am now trying to add parameters to my report. 

Here is my Report Viewer script that passes the parameter:
$("#reportViewer1")
            .telerik_ReportViewer({
                serviceUrl: "http://localhost:36563/api/reports/",
                templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html',
                reportSource: {
                    report: "MembersTest.trdx",
                    parameters: {
                        LastName: 'McGuy'
                    }
                }
            });

Here is the parameter JSON being passed into '/api/reports/clients/085707-b6ce/parameters':
[{"name":"LastName","type":"System.String","text":"Last Name","multivalue":false,"allowNull":false,"allowBlank":true,"isVisible":false,"autoRefresh":false,"hasChildParameters":false,"childParameters":null,"availableValues":null,"value":"McGuy","id":"LastName","label":"McGuy"}]

So it appears to be passing the parameter. In fact, I added a text box that prints the LastName parameter, and when the report loads, it shows "McGuy", which is the value I am passing. But the report does not return any rows. Here is my report SQL:

SELECT
Last_Name, First_Name, Middle_Name, Birth_Date
FROM
Member
WHERE
(Last_Name = @LastName)

When I go through the "Configure SQL Data Source" dialogues in the stand alone Report Builder, it returns records based on my parameter, when I preview.

I am not sure what I am doing wrong. Any help would be great.









Shawn
Top achievements
Rank 2
 answered on 18 Aug 2014
2 answers
188 views
I'm designing a couple of reports in a class library. Suddenly I keep getting the following error, printed in the report itself, when I try to preview the report:

An error has occurred while processing Report '<report name>': COM object that has been separated from its underlying RCW cannot be used.

After I completely restart Visual Studio, I can generate the report again, without a problem. However, when I make a change, the error comes back.

This restarting is getting tedious. What is wrong? Is there a way to solve this? Or when this happens, is there a quicker way of making the report run again?

Thanks in advance,
   Herre
Boardy
Top achievements
Rank 1
Veteran
 answered on 18 Aug 2014
3 answers
402 views
We are working on a crosstab report where there is a row group (Category) and two column groups (Location and Gender),  and we are showing total hours as the value. What we'd like to do is to show the hours as a percentage of the total for that Category and Location. The attached screenshot shows what we want, and also what the report designer gives us.

Basically if we have Category 1 and Location 1, we'd like to show the percentage of females for that category and location only. We are using an expression like

= Sum(Fields.TotalHours)/ exec("Gender1",Sum(Fields.TotalHours))

However this EXEC statement returns the total for the whole Gender group. We've tried the other groups, with similar results.

Is there a way to sum only across the current range of values?
Nasko
Telerik team
 answered on 18 Aug 2014
6 answers
514 views
On occasion our report viewer will receive a "Report is unavailable or session has expired." when opened in a new window on an ASP.NET 2.0 application.  This started when pushed to our production environment which is load balanced using round robin.  Production is also HTTPS.  Also, the images on the report never show.  Everything worked great on our test server which is not load balanced and is not HTTPS.

Any help is greatly appreciated.

Thanks,

Warren
أشرف
Top achievements
Rank 1
 answered on 18 Aug 2014
4 answers
452 views
Hello All,

I wanted to post this so no one else has to go through what I went through trying to figure out how to dynamically change the connection string when using .trdx files as the urisource in the windows forms report viewer and having each customer with their own database being able to run the canned reports that we make for our software.

First, when you design the report, give the SQL Datasource a Name and check the box to save it in the configuration file (I did this from the Telerik Standalone Report Designer. This will not expose your connection information to end users and allow them to create alternative reports for your canned reports without letting them see the connection password.

Second, add a line into your [appname].exe.config file for the connection string and leave the connection string value BLANK. It should look something like this (put this right under <configSections> and I think the casing matters on <connectionStrings>:

<connectionStrings>
    <add name="Marketplace" providerName="System.Data.SqlClient" connectionString="" />
  </connectionStrings>

Next, if you have a connection string either encrypted (we encrypt our connection password only and read it into memory on login to our application and assign it to a global variable called ADOnet), you will want to set the named connectionstring in memory and have it refresh. In VB.Net, this can be done by using the following code:

Dim config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Dim connectionStringsSection = DirectCast(config.GetSection("connectionStrings"), ConnectionStringsSection)
connectionStringsSection.ConnectionStrings("Marketplace").ConnectionString = ADONet
config.Save()
ConfigurationManager.RefreshSection("connectionStrings")

In order to get ConfigurationManager to show up under System.Configuration you need to add System.Configuration explictily to your references in your project (just imports or using will not give you configuration manager)

Anyway, this will update your settings for your named connection in your reports in memory while in runtime.

Hope this helps you to not spend the 5 hours of research and testing it took me to find this solution.

Philip Carter
http://emanageone.com
Philip
Top achievements
Rank 1
 answered on 16 Aug 2014
1 answer
127 views
Hello,
Are there any examples or tutorials of dynamically binding data to a report? We are hosting the reports on a Web API and accessing them via an MVC app. For security reasons we do not want to use the Javascript-based ReportViewer on the MVC side to directly call the report on the API. Instead we would like to get an instance of that report, serialize it, and then dynamically bind the data to the report. How would we achieve this? 
Stef
Telerik team
 answered on 15 Aug 2014
2 answers
345 views
Hello, 
I am experiencing a problem trying to view a Telerik Report. The report is hosted on a Web Api project and is being accessed by an MVC project using the Javascript version of the ReportViewer. The ReportViewer is able to find the correct report but before it can be displayed I'm getting an error. The error is on this call to the Web Api project: http://localhost:xxxxxx/api/v1/Reports/clients/102235-d59f/instances/102235-d67f/documents/102235-8013/info. The error is "Specified cast is not valid". Here is the full stack trace:

Telerik.Reporting.Services.Engine.DocumentRenderException: Specified cast is not valid.
   at Telerik.Reporting.Services.Engine.Document.GetDocumentInfo()
   at Telerik.Reporting.Services.Engine.ReportInstance.<GetDocumentInfo>b__c(Document d)
   at Telerik.Reporting.Services.Engine.ReportInstance.ExecuteOnDocument[T](String documentID, Func`2 function)
   at Telerik.Reporting.Services.Engine.ReportInstance.GetDocumentInfo(String documentID)
   at Telerik.Reporting.Services.Engine.Client.<>c__DisplayClass1b.<GetDocumentInfo>b__1a(ReportInstance i)
   at Telerik.Reporting.Services.Engine.Client.ExecuteOnReportInstance[T](String instanceID, Func`2 function)
   at Telerik.Reporting.Services.Engine.Client.GetDocumentInfo(String instanceID, String documentID)
   at Telerik.Reporting.Services.Engine.ReportEngine.<>c__DisplayClass15.<GetDocumentInfo>b__14(Client client)
   at Telerik.Reporting.Services.Engine.ReportEngine.WithClient[T](String clientID, Func`2 func)
   at Telerik.Reporting.Services.Engine.ReportEngine.GetDocumentInfo(String clientID, String instanceID, String documentID)
   at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetDocumentInfo(String clientID, String instanceID, String documentID)
   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.ActionExecutor.Execute(Object instance, Object[] arguments)
   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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   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.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()

Like I said, it is not an issue of it not being able to find the report. In fact, even though this error is occurring, I can use the export menu of the ReportViewer to export the report to PDF, Excel, etc and it works fine. Can you please advise on this issue? 
Nasko
Telerik team
 answered on 15 Aug 2014
1 answer
138 views
Hello,

Is it possible to attach the parameter value as column name in SQLDATASOURCE?

In Sql datasource i used the below Stored procedure

declare @day as varchar
declare @Sql as varchar(3000)
set @day=1
Set @sql='select Cid,[' + @day + ']As Day1 from tbl_Amount_Track1'
Exec @Sql

Now i need to pass @day value from front end. Is it possible to pass multivalue parameter to @day from front end?


OR ELSE

Is it possible to display values of multivalue parameter straight away in report during runtime without using Sql datasource?
If so How to pass multivalue parameter to report using vb.net?

Thank you
Jayanthi
KS
Top achievements
Rank 1
 answered on 15 Aug 2014
2 answers
188 views
I've been searching the forums for how to implement report viewing in a truly seperated mvvm pattern.

From what I've found it seems no one has implemented it?

What I am hoping for is a Viewmodel that passes a different report (and/or a parameter) to the viewer according to the user's selections from the view selectedItem
Stef
Telerik team
 answered on 15 Aug 2014
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?