Telerik Forums
Reporting Forum
1 answer
299 views

We have implemented a custom report resolver that returns an InstanceReportSource based on the report class name. The InstanceReportSource.ReportDocument is instantiated from our IoC container (Simple Injector) and all objects are injected into the report via a constructor as expected. Within each report we subscribe to the NeedDataSource event and retrieve the data from a repository instance that has been injected. However, when we attempt to retrieve data from the repository, the repository instance has already been disposed. The injected objects are scoped to the webapi request. I read in the forums that the processing of the report happens in a separate context. Could that be causing my issue?

We've used this approach for years with the WCF report service and it has worked well. How can we configure this to work with the REST report service? We are now using the WPF report viewer.

 

 

Katia
Telerik team
 answered on 01 May 2018
0 answers
156 views

I have some dynamic variable in my ASP.NET web-form application in session, that will stored when user login. In session variable I have some user information and some connection string of some database which will be created dynamically at run-time. 

How can I pass these variable data to report to bind some control to display user information and show some data from SqlDataSource which connection string also passed form ASP page to report.

SURYA
Top achievements
Rank 2
 asked on 01 May 2018
5 answers
412 views

Hi Guys,

 

As per the title is that funciton thread save? When I'm calling this in a multi threaded app I get an exception on the rendering although all variables are declared locally. So my guess would be that it is not?

Stack Trace JIC:

------------------------------------------------------------------------------------------------------------

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Telerik.Reporting.Processing.Common.FontContainer.GetFontDef(String fontName, FontStyle fontStyle)
   at Telerik.Reporting.Processing.Common.FontContainer.FillBuffer(Font gdiFont, Byte[]& buffer)
   at Telerik.Reporting.Pdf.Fonts.TrueType.FontReader.GetFontData(Font font, Boolean& isTTC)
   at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeDescriptor..ctor(Font gdiFont)
Object reference not set to an instance of an object.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Telerik.Reporting.Processing.Common.FontContainer.GetFontDef(String fontName, FontStyle fontStyle)
   at Telerik.Reporting.Processing.Common.FontContainer.FillBuffer(Font gdiFont, Byte[]& buffer)
   at Telerik.Reporting.Pdf.Fonts.TrueType.FontReader.GetFontData(Font font, Boolean& isTTC)
   at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeDescriptor..ctor(Font gdiFont)
An error has occurred while rendering the report: System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Telerik.Reporting.Processing.Common.FontContainer.GetFontDef(String fontName, FontStyle fontStyle)
   at Telerik.Reporting.Processing.Common.FontContainer.FillBuffer(Font gdiFont, Byte[]& buffer)
   at Telerik.Reporting.Pdf.Fonts.TrueType.FontReader.GetFontData(Font font, Boolean& isTTC)
   at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeDescriptor..ctor(Font gdiFont)
   at Telerik.Reporting.Pdf.PdfFontTable.GetDescriptor(PdfFont font)
   at Telerik.Reporting.Pdf.PdfFontDictionary..ctor(PdfDocument document, PdfFont drawingFont)
   at Telerik.Reporting.Pdf.PdfFontType0Dictionary..ctor(PdfDocument document, PdfFont font)
   at Telerik.Reporting.Pdf.PdfFontTable.GetFont(PdfFont font)
   at Telerik.Reporting.Pdf.PdfPageDictionary.GetFontName(PdfFont font, PdfFontDictionary& fontDictionary)
   at Telerik.Reporting.Pdf.Rendering.PdfRendererGraphicsState.Update(PdfFont font, Brush brush, Int32 renderMode)
   at Telerik.Reporting.Pdf.Rendering.PdfRenderer.Update(PdfFont pdfFont, Brush brush, Int32 renderMode)
   at Telerik.Reporting.Pdf.Rendering.PdfRenderer.DrawString(String text, PdfFont pdfFont, Brush brush, RectangleF rect, Boolean rightToLeft)
   at Telerik.Reporting.ImageRendering.CanvasPdf.DrawRegularChunk(String text, Font font, Brush brush, RectangleF rect, TextFormat textFormat)
   at Telerik.Reporting.ImageRendering.CanvasBase.DrawStringMultiline(String s, Font font, Brush brush, RectangleF rect, TextFormat format, Boolean isFinalTextChunk)
   at Telerik.Reporting.ImageRendering.DocumentBase.WriteText(String text, RectangleF bounds, IFont font, Color foreground, TextFormat format, Matrix transform, Boolean isFinalTextChunk)
   at Telerik.Reporting.Writing.TextBoxWriter.WriteContent(DocumentWriter writer, TextBox textBox, ElementPageInfo pageInfo)
   at Telerik.Reporting.Writing.ProcessingContentElementWriter`1.WriteContent(T element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.ProcessingElementWriter`1.Write(T element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.ElementWriter`1.Telerik.Reporting.Writing.IElementWriter.StartWrite(LayoutElement element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.WriteStartOperationsDispatcher.Write(IElementWriter writer, LayoutElement element, ElementPageInfo pageInfo, DocumentWriter documentWriter)
   at Telerik.Reporting.Writing.WriteOperationsDispatcher.Visit(TextBox textBox)
   at Telerik.Reporting.Processing.TextBox.Accept(ProcessingElementVisitor visitor)
   at Telerik.Reporting.Processing.ProcessingElementVisitor.Visit(LayoutElement element)
   at Telerik.Reporting.Writing.DocumentWriter.Telerik.Reporting.BaseRendering.IWriter.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo)
   at Telerik.Reporting.BaseRendering.PageHandler.Telerik.Reporting.Paging.IPageHandler.StartElement(LayoutElement element, ElementPageInfo info)
   at Telerik.Reporting.Paging.PageStartElement.AddToPage(IPageHandler handler)
   at Telerik.Reporting.Paging.PageElementLayer.AddToPage(IPageHandler handler)
   at Telerik.Reporting.Paging.PageElementManager.AddToPage(IPageHandler handler)
   at Telerik.Reporting.Paging.PageCompositionBase.AddElementsToPage()
   at Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
   at Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
   at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
   at Telerik.Reporting.Paging.PagerBase.Telerik.Reporting.Paging.IPager.CreatePages(IPageHandler handler, LayoutElement root)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(LayoutElement root, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback, PageSettings pageSettings)
Exception thrown: 'System.NullReferenceException' in Telerik.Reporting.dll

------------------------------------------------------------------------------------------------------------

 

Cheers

Nils

Peter
Telerik team
 answered on 01 May 2018
3 answers
165 views
I have a main report that lists cities, and I have a subreport for each city that lists buildings of them. I mean, subreport presents the detail of buildings of each city od the main report.

I want to pass a parameter to each sub report, this parameter is a value of a textbox in the main report. I'm passing this parameter in the "detail_ItemDataBound" event (main report), and then I intend to read it in the subreport, in the "NeedDataSource" event. The problem is that the parameter that corresponds to the first row appers in the second row, and the parameter that is part of the second row appers in the third one.

What am I doing wrong? or Does it have any mistake those telerik events?

I apreciate your help.

(I'm using Telerik Reporting R1 2018)
Lucio
Top achievements
Rank 1
 answered on 26 Apr 2018
6 answers
234 views

Hi,
Is there a way to remove empty reports from a ReportBook ?

Thank you

 

Before R1 of telerik reporting, I was doing something like this :

 

If Not TryCast(myRptBook.Reports(4), ReportLibrary1.Report1) Is Nothing Then : If Not DirectCast(myRptBook.Reports(4), ReportLibrary1.Report1).haveData Then myRptBook.Reports.Remove(myRptBook.Reports(4))
End If

With 

Private Sub detail_ItemDataBound(sender As Object, e As EventArgs) Handles detail.ItemDataBound
    Me.haveData = True
End Sub
perico
Top achievements
Rank 1
Iron
 answered on 26 Apr 2018
0 answers
71 views

EmployeeName     Size     ManuCode

Name1                      1          ABC
                                  2          DEF

Name2                       3         GHI

I have grouped the above table with using EmployeeName.
How can I get the below output. I want to act the EmplyeeName as table header.

Name1

Size     ManuCode
1          ABC
2          DEF

 

Name2

Size     ManuCode
3         GHI

 


Harsha
Top achievements
Rank 1
 asked on 26 Apr 2018
1 answer
1.0K+ views

Hi,

When I hit the "print" button on reportviewer I need to call a procedure which writes the date of printig into the database.

I cant seem to find an event of sorts that does it. Anyone have any solution for this?

 

Thanks in advance.

Todor
Telerik team
 answered on 24 Apr 2018
0 answers
168 views
RDLC Reports Loading too slow even to fetch a single row from Mssql
rajasekar
Top achievements
Rank 1
 asked on 24 Apr 2018
1 answer
128 views
I have created a telerik report which uses Norwegian characters in the report as well as in the csv data sources. But in the Report designer when I go to the preview tab I can see that some special characters that are from the csv data source are missing. Characters in question is 'ØÆÅ'. All the special characters in the report (hard coded) are shown correctly, only the characters from the csv file that is not shown. Hence I went through the Configure CSV data Source and I found out that when parsing the CSV , there also these characters are missing (Shown in the attachment). How can this be fixed or does special characters are not supported for CSV files?
Todor
Telerik team
 answered on 23 Apr 2018
2 answers
649 views

I have 4 textboxes that correspond to a multi-select dropdown parameter.  The space for the textboxes is a set width on my report.  Depending on which options you choose from the parameter dropdown, the other textboxes visibility will toggle on and off.  I have also set the width of the text boxes to change depending on how many are selected (if 2 options are selected, each is 1/2 of the given space.  If 3 are selected, each will be 1/3 of the space.

My problem now is I need to set the location of the textboxes depending on what is chosen.  If the first and third text box are shown and the second and fourth are hidden, the first and third will each be half of the space.  BUT I would need the third box to scoot over against the first.  Now, it stays at its original location and creates whitespace, causing the 3rd box to go onto a second page.

box1 box2 box3 box4

box1_____box3____

Is there a way to make box 3 move to the left up against box1 if box 2 is hidden?

 

Thanks,

Phillip

Katia
Telerik team
 answered on 23 Apr 2018
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?