Telerik Forums
Reporting Forum
2 answers
679 views
I am getting an object reference error when trying to display my report. I get this error only after I upgrading to the latest version Q3 2011 (5.3.11.1116).  

With no code changes at all I can down grade to version Q2 2011 SP1 (5.1.11.928) and the report works just fine.

Here is the stack I receive in the Output window while debugging...

*** RenderReport #0 STARTED ***
An error has occurred while rendering the report: System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Reporting.Processing.LayoutEngine.LayoutAnchoredItem(ILayoutItem item, RectangleU rect)
   at Telerik.Reporting.Processing.LayoutEngine.Layout(ILayoutContainer container)
   at Telerik.Reporting.Processing.ReportSectionBase.Measure(MeasureDirection dir, Graphics graphics)
   at Telerik.Reporting.Processing.PageSection.Measure(MeasureDirection dir, Graphics graphics)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics)
   at Telerik.Reporting.Processing.Report.MeasureElement(ProcessingElement elementToMeasure)
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.GetMaxPageSectionWidth()
   at Telerik.Reporting.Paging.PageCompositionBase.SetCurrentWidthCore()
   at Telerik.Reporting.Paging.PageCompositionBase.set_CurrentPageArea(PageArea value)
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.PrepareNewPage()
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.NextUsableArea()
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.NextVerticalPage()
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.PageOverride()
   at Telerik.Reporting.Paging.PagerBase.Page(IPageHandler handler, Report report)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingInfo, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:00.0302191 ***


WinViewer> An error has occurred while rendering a report:
The thread 'Rendering' (0x2ee0) has exited with code 0 (0x0).
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Reporting.Processing.LayoutEngine.LayoutAnchoredItem(ILayoutItem item, RectangleU rect)
   at Telerik.Reporting.Processing.LayoutEngine.Layout(ILayoutContainer container)
   at Telerik.Reporting.Processing.ReportSectionBase.Measure(MeasureDirection dir, Graphics graphics)
   at Telerik.Reporting.Processing.PageSection.Measure(MeasureDirection dir, Graphics graphics)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics)
   at Telerik.Reporting.Processing.Report.MeasureElement(ProcessingElement elementToMeasure)
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.GetMaxPageSectionWidth()
   at Telerik.Reporting.Paging.PageCompositionBase.SetCurrentWidthCore()
   at Telerik.Reporting.Paging.PageCompositionBase.set_CurrentPageArea(PageArea value)
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.PrepareNewPage()
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.NextUsableArea()
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.NextVerticalPage()
   at Telerik.Reporting.Paging.InteractiveLayout.PageComposition.PageOverride()
   at Telerik.Reporting.Paging.PagerBase.Page(IPageHandler handler, Report report)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingInfo, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
   at Telerik.ReportViewer.Common.ReportRenderer.Render(ReportRendererArgs args)

Shonda
Top achievements
Rank 1
 answered on 02 Dec 2011
5 answers
502 views
Hi,

I'm currently using a report viewer to show different report. The list of report that can be show is in a comboBox. When I clicked on the button "preview", the reportViewer will show the selected item in the comboBox. I notice that if I click many times on the button preview when the report selected is the same, a error appears. Don't know if it is something wrong I'm doing or what, but here is the error that I received :

Server Error in '/' Application


Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.Generic.List`1.get_Item(Int32 index) +12732076
   Telerik.ReportViewer.WebForms.StreamManager.GetPageStream(Int32 index) +89
   Telerik.ReportViewer.WebForms.ReportPageOperation.WriteHtmlPage(StreamManager streamManager, Int32 pageIndex) +94
   Telerik.ReportViewer.WebForms.ReportPageOperation.WriteHtmlPage(Int32 pageIndex) +79
   Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperationOverride() +103
   Telerik.ReportViewer.WebForms.HandlerOperation.PerformOperation(HttpContext context, ICacheManager cacheManager) +115
   Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) +415
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

Anyone know what it mean ? 
Thank you

David
Fandy Backers
Top achievements
Rank 2
 answered on 02 Dec 2011
1 answer
72 views
Having trouble figuring this out. What I want is fairly simple, I have a report where all of the data is in metric units. I need to give the user the ability to switch to SI units as sometimes they need to export the data in metric, and other times they need to export the data in SI units.
Elian
Telerik team
 answered on 01 Dec 2011
2 answers
161 views
Hello,

I'm trying to load my first chart using Telerik Reporting. I have this issue:

I want to create a line chart with two series. the data retrieved from sqldatasource is this:

Euribor1Mes    1Y    2.1153391880
Euribor1Mes    2Y    1.5951715250
Euribor1Mes    3Y    1.7828868410
Euribor1Mes    4Y    2.0519780200
...
Euribor1Mes    47Y    3.2136528810
Euribor 1Mes    48Y    3.2181399930
Euribor1Mes    49Y    3.2224216550
Euribor1Mes    50Y    3.2269428250
Libor1Mes    1Y    2.1153391880
Libor1Mes    2Y    1.5951715250
Libor1Mes    3Y    1.7828868410
Libor1Mes    4Y    2.0519780200
...
Libor1Mes    47Y    3.2136528810
Libor1Mes    48Y    3.2181399930
Libor1Mes    49Y    3.2224216550
Libor1Mes    50Y    3.2269428250

The first field is the name of each serie (there are two different), the second field is the X axis data and the third one is the Y axis data.

Can I load two chart series using this data?

Thank you very much.
Elian
Telerik team
 answered on 01 Dec 2011
1 answer
209 views
Hi Telerik Team,

    Is it possible to pass login session (credentials/values) from an asp page to a table datasource in telerik report? if yes, then how do I do it?
    I am using Q1 version. I followed some samples/examples to connect datasource programatically from telerik website but that doesn't produce the results. It causes error message " ExecuteReader: Commandtext property is not initialized for table 1".
    I have login session information in  .aspx page containing reportviewer and one .cs report which is attached to reportviewer.
Would you please reply to dhara.savani@Xerox.com?

Thanks,
Dhara
Peter
Telerik team
 answered on 01 Dec 2011
1 answer
68 views
Hi,

I'm creating my first report, to display an "offer", this offer has an id that I receive as a parameter of my data source.

I created an EntityDataSource, connected it to my data.

I've also added a parameter on the datasource to have only the row with the id in parameter.

Now, I'm a little lost, I've created some textBox, but if I go in the expression editor, in "Fields" I've a "No Data Source", why?

How can I bind the data of my selected row??

Image of my situation
Peter
Telerik team
 answered on 01 Dec 2011
8 answers
2.3K+ views
Hello All,

the report columns I want are not specific so that I am generating them dynamically.
I have a query how to bind image column dynamically, i am trying to bind similar to text-box object. but images not shown.

Please provide way to add image column dynamically.

Thank you in advance.

Michael
Top achievements
Rank 1
 answered on 30 Nov 2011
2 answers
140 views
I have a few issues with using charts (a stacked bar chart in this case) and telerik reporting.  Note that we have the Q3 2011 version of the telerik reporting tools.


The first issue is getting the chart to use the correct "labels" for the x-axis.
I have some data which is similar to the following:

Store    Department    Category   PercentA    PercentB
APN        A                    Start            2                    3
APN        A                    End             5                    6
APN        B                    Start            3                    5
APN        B                    End             6                    9
HWT       B                    Start            4                    8
HWT       B                    End             4                    7
HWT       C                    Start            2                    3
HWT       C                    End             8                    8

I then use this data to generate a stacked bar chart.  I use the Category department as the series, so each bar would be split into two (my actual chart has more than 2 categories, but that works fine).  It would then plot PercentA and PercentB on the Y-axes - again no problems.

What I want to do is to use the Store + Department as the x-axis groups.  I am able to use the Store + Department as a group for the tabular display of data, but not on the chart.  The chart currently only creates 1 bar for each Store.  Is there a way for me to tell the chart to use Store + Department for each bar? 


For the second thing, the labels on the x-axis (store) is intersecting the x-axis itself - please see attached screenshot for what I meant.  Is there a way to tell the chart to keep all x-axis labels under the x-axis line?
Elian
Telerik team
 answered on 30 Nov 2011
1 answer
387 views
I have a XAML drawing brush.  I want it to show in the PictureBox on a report.  But the report only takes an image from System.Drawing and not System.Windows.Media.  Any ideas anyone?

// Grab the XAML DrawingBrush
DrawingBrush db = (DrawingBrush)App.Current.Resources["BugIcon"];
// Create an image (wrong kind of Image though)
Image i = new Image()
{
   Source = new DrawingImage(db.Drawing),
   Height = 300,
   Width = 300
};
// Need to convert Image to System.Drawing.Image.
RenderTargetBitmap renderBmp = new RenderTargetBitmap(300, 300, 96, 96, PixelFormats.Pbgra32);
renderBmp.Render(i);

PngBitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(renderBmp));

using (MemoryStream stream = new MemoryStream())
{
   encoder.Save(stream);
   System.Drawing.Image i2 = System.Drawing.Image.FromStream(stream);
// This is the Telerik report, and the pb1/pb2 are PictureBox controls
   ((Telerik.Reporting.PictureBox)sr.Items["header"].Items["pb1"]).Value = i2;
   ((Telerik.Reporting.PictureBox)sr.Items["header"].Items["pb2"]).Value = i2;
}
Paul
Top achievements
Rank 1
 answered on 29 Nov 2011
1 answer
112 views
Hey All,


I`ve got a report with predefined groupings, however, I now have to add a new group programmatically. I've figured out how to do it, except that I want to add it at the beginning of the Grouping collection, and when i try Report.Groups.Add(newGroup), it adds it at the end...


Right now i have two levels of grouping.

I want to add a third, but i need this new one to be the topmost grouping level.

How can I do this, if at all possible?

Thanks!
Elian
Telerik team
 answered on 29 Nov 2011
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?