I'm working through the Telerik Reporting step-by-step tutorial located here:
http://www.telerik.com/documents/TelerikReporting-LearningGuide.pdf
I followed the steps precisely in the Lab: Subreports section (page 111-115). So this lab is to display a Master-Detail report. There is a Boolean Editor (User choose True or False) on the UI when the report is run. The way it is supposed to work is that, when the report is loaded, both the Master report and the Detail subreport are displayed. If the User selects False, the subreport is supposed to then be hidden.
I got the Master-Detail report to display properly. However, after I added the functionality for hiding the subreport, when I preview the report I get the following error message: "An error has occurred while processing SubReport 'subReport1': Specified cast is not valid". The issue lies in the following statement:
(sender as Telerik.Reporting.Processing.SubReport).Visible = (bool)this.ReportParameters["ShowEmployees"].Value;
Therefore, as far as I can tell, this tutorial is faulty. So the cast which I'm attempting on the right hand side of this assignment statement above is invalid. I tried the following unsuccessfully (still get an Exception), also:
(sender as Telerik.Reporting.Processing.SubReport).Visible = Convert.ToBoolean(this.ReportParameters["ShowEmployees"].Value;
I have been trying everything for a few days now to find an alternate solution to achieve my goal, which is to hide the subreport in case the User selects False in the Boolean Editor. Does anyone know either
how to resolve the cast issue in the assignment statement above, or
an alternate solution to hide the subreport in case the User selects False in the Boolean Editor?
That tutorial is around since v.3 of Telerik Reporting and I don't think it is updated since.
You can get reference to the main report and use the processing report parameter instead of the definition, try the following code to hide the subreport based on a report parameter (dummy code, not tested so u get an idea):
private void subReport1_ItemDataBound(object sender, System.EventArgs e)
{
Processing.SubReport subReport = (Processing.SubReport)sender;
Processing.Report mainRep = (Processing.Report)subReport.Parent;
subReport.Visible = (bool)mainRep.Parameters["ShowEmployees"].Value;
}
See here for more info: http://www.telerik.com/help/reporting/designing-reports-parameters-programmatic-control.html
Related
I am having a hard time with this one and I assume it is something I am missing as always.
I am using Visual Studio Web Express 2012. I have installed Report Builder and Report Viewer 11. I have created a generic report file in the report builder as I can not seem to view any designer view in Visual Studio. Not the issue. I am pulling data from my SQL database as usual and populate a dataset. All is fine from here. I can not seem to get the data to show in the report view but can not figure out what I am missing. I have looked everywhere on the web as well as Stack specifically. I have used some of the sample codes and have gotten the report to now show up but still no data. Any help would be great.
I create a generic report file in report builder. No fields, no title etc., just the generic report. This may be my issue but I can not seem to figure out what I am missing.
On my page load I populate the dataset as always with no problem as I can display the data in a label etc.
I add the report viewer to my page and add the following code to the page load after the dataset fill. I also noted that you must use if page.postback = false as Ajax seems to not like it otherwise and just seems to loop and continue loading forever.
I have tried many different code ideas but found I finally got the report to load (again no data) with the following.
rv1.Reset()
rv1.LocalReport.DataSources.Clear()
Dim rds As New ReportDataSource("DataSet1", tempDS.Tables(0))
rv1.LocalReport.ReportPath = Server.MapPath("\tests\test.rdl")
rv1.LocalReport.DataSources.Add(rds)
rv1.LocalReport.Refresh()
Again this is VB.Net webpage. What am I missing? Thanks in advance.
Did you bind the datasource? Sorry if i'm wrong, but in C# asp.net you need to bind the datasource after using an atribution.
I'm getting the following error when I try to run an ASP.Net page. It just popped up during development, and I don't know what the cause is.
"OverflowException Occurred. Value was either too large or too small for an Int32."
The line the debugger breaks on is of absolutely no help at all
Dim ApproxDate As TextBox = FormView1.FindControl("CurrentResultDateTextBox")
The error is occurring on this line because calling findControl on FormView1 causes it to databind (executes a SQL query to return the dataset). I assume the error lies somewhere in one of the object data sources or possibly one of the grid views on the page, but the debugger won't tell me where. Most of the page data sources are bound declaratively (specified in ASP tags in the source)
Pressing F11 to run past the exception displays the following:
"13712696100373320501120906 is not a valid value for Int32."
The value being shown here is the primary key for the main SQL table used by the page. There are about 10 data sources which use this field. Again, there's no indication of where exactly the error is occurring.
So how can I debug an error like this? Are there commands I can run? IIS error logs? 3rd party software to capture the error? I'll take anything I can get
Managed to find the problem. The trick is to first disable "just my code" in the IDE/Debug settings. Then you can see the system functions on the call stack, and while there is no source code, you can click on these functions to unwind the stack to one of the web controls (in this case the ListControl.PerformSelect function)
If you check the auto variables in the debug window, it will show the control involved in the error. From there I added a watch on the ID property to see which control it was, looked up the data source that feeds it, and found the error.
You can also unwind the stack to the ObjectDataSourceView, look at the dataTable property, and call GetErrors() to see the issues. This returns an array of data rows which are flagging errors; The property RowError will show the error message for any given row.
I did all the steps from this waltrought:
http://blogs.msdn.com/b/sqlforum/archive/2011/01/03/walkthrough-add-a-subreport-in-local-report-in-reportviewer.aspx
and when i run it i get the first father report and instead the sub
report i get:
Data retrieval failed for the subreport, 'Subreport5',
located at: C:...
i attach a print screen file
i am using VS2010 framework 3.5.
Can you run the subreport by itself, given the right parameters? If you can't, your problem is that.
If you can run it successfully by itself, double-check that you are passing the parameters correctly to your subreport. Make sure the parameter types match and that you are passing all of them.
Another problem might be that -- if I recall correctly -- when you have a subreport in a local report, you need to provide the data for the subreport programmatically, just as you do with the parent report. There's an event that's raised - SubreportProcessingEvent -- when the subreport is being processed. You write a handler for that event and supply data in the handler. Here's some more information about it: LocalReport.SubReportProcessingEvent. There's a good example on that page.
When we are trying to create a new page through a PageType in Tridion UI.It is throwing below error --
"The item tcm:280-29837-64 does not exist."
Is it the Id of the page which i want to create,as it is no more exists in the tridion?
Could any body help me out in this regard ?
Note :-we defined the pagetype to those pages which already exist and published.
Edit-1 When we click on the 'Create Page' button(see the attached screenshot), above mentioned error Pops up.
In the cd_core.log file below error and warning comes --
ERROR XMLConfigurationReader - Error while validating file 'cd_ambient_conf.xml' with schema 'schemas/cd_ambient_conf.xsd'. cvc-complex-type.2.4.a: Invalid content was found starting with element 'ClaimStoreProvider'. One of '{Cookies}' is expected.
WARN AmbientDataContext - There is no current ambient data context - the ambient data framework is not properly initialised
Edit-2 Now errors related to AmbientDataWork are resolved but we are still getting same issue. There are two options in UI (a) "New Page" (b) Create and insert Content. This error also comes when we go with the option "Create and Insert Content". On each click of "Create Page" or "Create and insert Content" it generate a new Id(XXX-59248 -64 then XXX-59249- 64 etc) for page and same way for component also and throws above mentioned error message.
Note:- We are using IIS 6.
Edit-3 - I am using VB script in my page templates.
If someone is using VB script page template,it is required to install UI_2012.0.0.81248 hotfixes to create new pages in UI 2012.
I was not aware about this so fact of using VB script is not mentioned anywhere in the question .So I am updating my question again to assist community member in right direction.
It "looks like" the creation of the page somehow fails on the CM side (but i'm doing an awful lot of interpretation here based on very limited data...).
Can you verify
1. that you can create pages in the content management explorer in the publication with ID 280
2. that your blueprint context settings for UI 2012 are correct (should the new page/component be created in the publication with ID 280?)
3. that you have no workflow or event system interfering with the creation of the page
I would also expect an event log entry in the Tridion/Tridion Content Manager event log which would contain a detailed stack trace...
I am writing a web application using ASP.NET 2.0 [Visual Studio 2005 Professional Edition].
I have a Crystal Report that is connected to a stored procedure residing in SQL Server. This stored procedure accepts a parameter and therefore I have a formula in my report's hyperlink section to pass the parameter via Query String.
Everything works fine except when I click the navigation buttons to move to the next page of the report, I either get an error or Crystal Reports shows an input box to enter the parameter values.
The error shown is: "Missing Parameter Values". Only this error is shown and nothing else. If I try to export the report by selecting Export option on the Crystal toolbar, it opens a page and asks for the parameter values.
I am not following why parameter values disappear when either I move from the first page to the other or try to export the report?
Most likely you are setting the parameters in the report viewer instead of the report object. If the parameters are set in the report object they should persist on navigation. If you still have issues create an event handler for the report viewer's 'Navigate' event and reset them.
Aditionally, if you call report.Refresh() or report.VerifyDatabase() after you set parameters it clears the values so be aware of that,
MD
When we click on report navigatin button, print button page is refeshed and we facing with 'missing parameter values error '
My probem is solved by using below line of code.
If Not Page.IsPostBack Then
CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.ReportSource = myReportDocument
CrystalReportViewer1.DataBind()
Else
CrystalReportViewer1.ReportSource = myReportDocument
CrystalReportViewer1.DataBind()
End If
where paramFields are runtime created ParmeterFields
Best Regards,
Vinay Shukla