Telerik Forums
Reporting Forum
1 answer
129 views
I need to create a report that displays the details (including all children) for a single entity. I've got a method on my Object context that returns a single entity and I'm setting my entity datasource to that method. At runtime, I'd like to set the datasource in code to the current entity (which should already have all the navigation properties loaded, reducing the # of trips to the database). 

I have a few questions:

1. Is it okay that I'm setting the datasource at designtime to a method that requires a parameter, but at runtime I set it to the entity (hence, no parameters needed)?

2. How do I show the details for the child collections? I'm guessing I will need subreports, but I'm not sure how to pass the child collection over. Will I need to use the NeedDataSource event? and if so, how do I use that and will I still be able to design the report using the designer?

3. How do I show/hide data? For example, one of my fields is a boolean value. Based on true or false of this field, I would like to show/hide (collapse) a certain area that displays several other fields. I read on another thread about setting the height of the details, but my data is in a panel (which I couldn't find a height property for).
Peter
Telerik team
 answered on 12 Jul 2011
3 answers
97 views
Hello,

Parameters are not loading at first time or ReportViewer presents a "Report is unavailable or session has expired." error message. After pressing the "Refresh report" button report is always presented correctly.

It happens like once per several tries, but still and it is unacceptable in a business solution. 

Raport is generated dynamically, and all parameters are passed from ViewModel in this way:

 
private void RenderReportMethod(RenderBeginEventArgs rbea)<br>
        {
            if (rbea != null)
            {
                rbea.ParameterValues["Number"] = Invoice.Number;
               
                .....(other parameters).....
            }
        }


We've already changed the default HTTPBinding settings in the ReportViewer

ReportServiceClient IReportServiceClientFactory.Create(System.Uri remoteAddress)
        {
            var binding = new BasicHttpBinding()
            {
                MaxBufferSize = int.MaxValue,
                MaxReceivedMessageSize = int.MaxValue,
                ReceiveTimeout = new TimeSpan(0, 15, 0),
                SendTimeout = new TimeSpan(0, 15, 0)
            };

            var endpointAddress = new EndpointAddress(remoteAddress);

            return new ReportServiceClient(binding, endpointAddress);

        }


and in the webconfig where the ReportService is placed as well:

<bindings>
      <basicHttpBinding>
        <binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxStringContentLength="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      <services>
        <service
                name="Telerik.Reporting.Service.ReportService"
                behaviorConfiguration="ReportServiceBehavior">
          <endpoint
                 address=""
                 binding="basicHttpBinding"
                 contract="Telerik.Reporting.Service.IReportService">
            <identity>
              <dns value="localhost" />
            </identity>
          </endpoint>
          <endpoint
                  address="resources"
                  binding="webHttpBinding"
                  behaviorConfiguration="WebBehavior"
                  contract="Telerik.Reporting.Service.IResourceService"/>
          <endpoint
                  address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
        </service>
      </services>


however the problem still exists.

Any ideas?
Peter
Telerik team
 answered on 12 Jul 2011
3 answers
310 views
Hi
   I get a problem when i export report to excel. I have some records whose format is {0:p1},and them display correctly in report,but when i export it to excel, it displays in a wrong format. For example,in the report it shows as following:
    name        percentage
     lily              15%

But when i export to excel,it shows
    name        percentage
     lily              0.15

  How can i resolve this problem,thanks.
 
Steve
Telerik team
 answered on 12 Jul 2011
4 answers
554 views
How can I display headers in crosstab?
Andrew
Top achievements
Rank 1
 answered on 12 Jul 2011
1 answer
158 views
Hi,

I have created a reports class library and used report wizard to connect to DB and create the report. As a result, it created the connection string in app.config of the reports project and the dataset thus created uses the connection info from the settings file.
The issue is when I publish the application to the live server, the app.config from reports project doesn't obviously get published. I had to manually copy that. How can I work around that?

Environment: VS2008, Q3 2009, C#

Thanks,
BC.
BC
Top achievements
Rank 1
 answered on 11 Jul 2011
2 answers
134 views
I'm putting a bottom border on my list items (using a panel) to separate them, but don't want to show this border on the last item, because I have another border at the end of the list. Is there a way I can check if the record being processed is the last one, so that I can set the border to none?
Rayne
Top achievements
Rank 1
 answered on 11 Jul 2011
1 answer
56 views
Hi,

Ive created a silverlight report that based on a parameter dynamically adds some report fields in code. So in my NeedsData event on the report definition I check a parameter and create some extra fields and then set the datasource for the report.

This seems to work fine to generate and print the report but when I use the silverlight reportviewer to save as pdf (or any save as format) then it appears I get a new instance of the report on the server (I can set a breakpoint in the constructor) but never get a needsdata event call. I tried moving my code to the constructor but it seems that my parameter is not not initialized yet in the constructor.

Where would be the correct place to dynamically add some report textblocks, etc. in code so that it works for both report generation and save as?

thanks,
Adam
Peter
Telerik team
 answered on 11 Jul 2011
2 answers
177 views
Hello all, I'm using Telerik Report for the first time. Since we use other Telerik solutions, we opted to try it.

Here is my current problem. I created the Service in my server, where all my solution services are. I created a ClassLibrary with the report, and followed the tutorial to create the viewer in my Silverlight application. Now when I try to render/view the report I get an error: "Report is unavailable or session has expired."

I debugged my server, and both the report, and the data source (an object) are created. The report works fine in design preview. I checked asp.net session, and tried both StateServer and InProc sessions with the same error. 

As someone suggestion in this forum, I debugged with Fiddler and two calls are made, with the following response:

Fist call response:
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Fri, 08 Jul 2011 12:07:42 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 4.0.30319
Content-Length: 812
Set-Cookie: ASP.NET_SessionId=faopnca1hygazmjbd2yx4x5d; path=/; HttpOnly
Cache-Control: private
Content-Type: text/xml; charset=utf-8
 
 
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <
s:Body>
    <
RenderAndCacheResponse xmlns="Telerik.ReportService">
        <a:Error i:nil="true"/>
        <a:Actions/>
        <a:Bookmarks i:nil="true"/>
        <a:HasDocumentMap>false</a:HasDocumentMap>
        <a:InstanceID>226a967f-0ce1-4951-99a8-94449583823f</a:InstanceID>
        <
a:NavigateBackEnabled>false</a:NavigateBackEnabled>
        <
a:NavigateForwardEnabled>false</a:NavigateForwardEnabled>
        <a:PageCount>1</a:PageCount>
        <a:PageNumber>1</a:PageNumber>
        <a:Parameters/>
        <a:Report>MJDS.Relatorios.RelatorioTipoPermissao, MJDS.Relatorios, Culture=neutral, PublicKeyToken=null</a:Report>
      </RenderAndCacheResult>
    </RenderAndCacheResponse>
  </s:Body>
</s:Envelope>


Second call response:
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Fri, 08 Jul 2011 12:07:42 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 4.0.30319
Content-Length: 436
Cache-Control: private
Content-Type: text/xml; charset=utf-8
 
 
  <s:Body>
    <GetPageResponse xmlns="Telerik.ReportService">
        <a:Error>Report is unavailable or session has expired.</a:Error>
        <a:Buffer i:nil="true"/>
        <a:PageNumber>0</a:PageNumber>
      </GetPageResult>
    </GetPageResponse>
  </s:Body>
</s:Envelope>


But the above response did not help me solve the problem. What should I do, where should I look?
MJDS
Top achievements
Rank 1
 answered on 11 Jul 2011
9 answers
490 views
i am using RadControls Winforms Q1 2011 SP1 with Reporting Q1 2011 SP1,

in one of my reports in the page between 85-95 i get "A Generic GDI+ error occured"..
i tried a lot and the source of problem is a picturebox in my report that show the Student pictures.
Student objects loaded with Nhibernate

here is the stack trace from output window:

*** RENDER PAGES STARTED ***
*** RENDER PAGES DONE in 00:00:16.6764322 ***

An error has occurred while rendering the report: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
   at System.Drawing.Imaging.Metafile..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.DrawablePage..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.PageLayout.AddPage(Stream stream)
   at Telerik.ReportViewer.WinForms.WinViewer.OnStreamReady(Object sender, StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.OnStreamReady(StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.RenderStream.Telerik.Reporting.Processing.IRenderStream.Finish()
   at Telerik.Reporting.ImageRendering.CompositionGdi.SendPhysicalPages()
   at Telerik.Reporting.ImageRendering.CompositionBase.SendPhysicalPages(Boolean force)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(CompositionBase composition, RenderingElement renderingReport, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(Report report, CompositionBase composition, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderPages(Report report, CompositionBase composition)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderReport(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
*** RenderReport #0 DONE in 00:00:16.7004656 ***

*** ReportProcessor.Render DONE in 00:03:24.9680921 ***

WinViewer> An error has occurred while rendering a report:
System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
   at System.Drawing.Imaging.Metafile..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.DrawablePage..ctor(Stream stream)
   at Telerik.ReportViewer.WinForms.PageLayout.AddPage(Stream stream)
   at Telerik.ReportViewer.WinForms.WinViewer.OnStreamReady(Object sender, StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.OnStreamReady(StreamReadyEventArgs eventArgs)
   at Telerik.ReportViewer.WinForms.RenderFileManager.RenderStream.Telerik.Reporting.Processing.IRenderStream.Finish()
   at Telerik.Reporting.ImageRendering.CompositionGdi.SendPhysicalPages()
   at Telerik.Reporting.ImageRendering.CompositionBase.SendPhysicalPages(Boolean force)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(CompositionBase composition, RenderingElement renderingReport, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.ProcessPages(Report report, CompositionBase composition, Int32 startPage, Int32 endPage, Boolean render)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderPages(Report report, CompositionBase composition)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.RenderReport(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.ImageRendering.ImageRendererBase.Telerik.Reporting.Processing.IRenderingExtension.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
   at Telerik.ReportViewer.WinForms.RenderingThread.ThreadFunc(Object o)
The thread 0x1828 has exited with code 0 (0x0).
Michael Hilgers
Top achievements
Rank 1
 answered on 11 Jul 2011
1 answer
87 views
Hi

I am creating a report using Telerik Reports. I am also using DocumentMapText property for groups to display in the bookmarks section in pdf. But its not showing the hierarchy in the bookmarks according to the group. I have a top group with Region Name and I have ServiceTypes udner it. But Region and Service Types are being shown at the same level in the bookmarks and the same even in the reportviewer as well.

Please find the attached zip file containing the pdf and the report desginer and the code behind files and let me know where would be the mistake happened.

I have implemented by following the below url
https://demos.telerik.com/reporting/product-catalog/silverlight-demo.aspx

Thanks in advance
Ravindra
RAVINDRA
Top achievements
Rank 1
 answered on 11 Jul 2011
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?