Telerik Forums
Reporting Forum
0 answers
184 views

We have a WPF form with a grid full of records.  The user chooses the records they want to see on a report.  Once they select the items, how do i then send that collection to be the datasource behind a report so that the selected records display as a report within the Report Viewer control?

I have looked at tons of examples, and tried many different things with no luck.  Please help!!!

Note: I am using 2016 Q1 Reporting.

Chase

Cody
Top achievements
Rank 1
 asked on 15 Dec 2017
17 answers
1.0K+ views
I want to know how to bind a subreport from another subreport from a master report.I have a main report which is a main order which in its detail section there is a subreport of categories which in its detail section there is a fee subreport. This last one is that I'm trying to use as generic control. But I don't know how to bind this control.

Main Report
+ Header
 + Detail Section
   + Categories Sub Report
   + Header
   + Details Section
      + Fee Sub Report
      + Header
      + Detail section
      + Footer
   + Footer
+ Footer

e.g.

Master report
-------------
Category 1
Fee 1 $10
Fee 2 $5
Fee 3 $15
Category 2
Fee 2 $5
Fee 3 $15
Category 3
Fee 4 $50

In my main report (MasterReport) I have in the constructor a LoadData method, after InitializeComponents, that initializes the subreport like this

List<Categories> categories = GetCategories();
CategorySubReport subReport = new CategorySubReport(true);
InstanceReportSource source = new InstanceReportSource();
source.ReportDocument = subReport;
this.catSubReport.ReportSource = source;

Which works well because it lists my categories. But then in the ItemDataBound of the Category Sub Report, I tried to do the same thing for the fee sub report. But the only thing that I got, it's the first list of fees of the category 1 but linked to the last category and the previous categories from the list don't display the fee control.

e.g.

Master report
-------------
Category 1
Category 2
Category 3
Fee 1 $10
Fee 2 $5
Fee 3 $15

Category ItemDataBound from Detail Section

**details_ItemDataBound **

 Telerik.Reporting.Processing.DetailSection detailSection = (Telerik.Reporting.Processing.DetailSection)sender;
Category cat = detailSection.DataObject.RawData as Category;

Telerik.Reporting.SubReport feeSubReport = (Telerik.Reporting.SubReport)detailSection.ItemDefinition.Items.Find("FeeSubReport", false)[0];
Telerik.Reporting.InstanceReportSource source = new Telerik.Reporting.InstanceReportSource();
source.ReportDocument = new FeeSubReport(cat.Fees);
feeSubReport.ReportSource = source;


**FeeSubReport class**

public partial class FeeSubReport : Telerik.Reporting.Report
{
public FeeSubReport(List<Fee> fees)
{
InitializeComponent();
this.DataSource = fees;
}
}

I read that I need to use the NeedDataSource event of the FeeSubReport. So in my CategorySubReport where is placed the FeeSubReport I implemented the NeedDataSource event but it never gets called or triggered. (I don't have a datasource liked to the SubReport) and I don't what exactly to solve this.Before of using this approach, everything was excellent with the Telerik's table control which was bound with the fee collection but I realized that I was using fee tables in many reports duplicating code ...so that's why I decided to create a subreport of fee that I can initialize and reuse but this will be used in many subreport and not in a main report.
Praveen
Top achievements
Rank 1
 answered on 13 Dec 2017
2 answers
56 views

I have Report based on objectDataSource that I use in RadGridView too. We need something like this becouse in Report are more design possibillity as in RadPrintDocument used to print directly from GridView. 

Also tryed to use same list of objects - ok, I can print it perfect. 

Now client wants to use some sortings in GridView. Not bad, sorting from grid can be added to report  datasorce without big problems. Made!

Now client wants to have some filtering: well this can be complicated! I don't know why but filtering is not the same in radGridView and in Reporting (I really don't get it: why must be difference?): but I can make new list and use GridView.MasterTemplate.ChildRows, check if any of them have bound data and add to this new list. And after this in Report will be all showed (sortings I allready have :) )

Now Client wants some groups in grid... mmm...now it seems to be too complicated!

 

Question: How to make my client happy and print RadGridView in Report with all conditions? 

I have read that this is not as usuall but if this is possible, please tell me! I'm open to try any solution! So for now I use RadPrintDocument and make print directly from GridView , but there are some other problems :(

Krasimir
Top achievements
Rank 1
 answered on 12 Dec 2017
4 answers
176 views

We are on the latest version of Telerik Reporting Q3 2011, the version of the ReportViewer is 5.3.11.1116.

I have the following TextBox in the PageFooter of two separate reports.
  Page {PageNumber} of {PageCount}
 
The reports are being combined in a ReportBook, and then presented in a WinFormsReportViewer.
In the Viewer, the pages show the correct {PageNumber} and {PageCount} for all pages in the reports.

When I do an Export to PDF, the PageFooters all show a {PageCount} of 0 (zero).
1 of 0, 2 of 0, 3 of 0 (for as many pages that are in my reports).

What is wrong with the PDF Export?

Jolanta
Top achievements
Rank 1
Veteran
 answered on 12 Dec 2017
0 answers
93 views

Hi,

     I am trying to create a report with crosstab, please see attachment, the issue here is that, the cross tab has 2 groups, by year level and semester, and I am trying to put a sub total for units for each semester, but the problem, all sub totals for first semester are correct, but the subtotals for 2nd semester are wrong.

 

 

 

 

Levi
Top achievements
Rank 1
 asked on 11 Dec 2017
1 answer
217 views

Hello,

donut chart label position =outsideend is overlapping with legend . Is there any way to avoid the overlapping ?

 <telerik:RadHtmlChart runat="server" Height="300" ID="radcount">
                        <PlotArea>
                            <Series>
                                <telerik:DonutSeries  DataFieldY="YName" NameField="XName">
                                    <LabelsAppearance Position="OutsideEnd" DataFormatString="{0} %" />
                                    <TooltipsAppearance Color="White" DataFormatString="{0}%"></TooltipsAppearance>
                                </telerik:DonutSeries>
                            </Series>
                            <YAxis>
                            </YAxis>
                        </PlotArea>
                 </telerik:RadHtmlChart>

 

 

Silviya
Telerik team
 answered on 11 Dec 2017
1 answer
158 views

Using the Anguarcli viewer.

mvc application api I am trying to use the designer either to bind using Object data source. But when I open the telerik report designer and choose Object data source it is blank. I have the report in the project and I compile my class and I still see no business object in the list.

Another way I thought also is to bind the report to the telerik report mvc version from the viewer. 

 

<tr-viewer #viewer1
[containerStyle]="viewerContainerStyle"
[serviceUrl]="'http://localhost:/api/reports/'"
[reportSource]="{
report: 'Report1.trdp',
parameters: {}
}"
[viewMode]="'INTERACTIVE'"
[scaleMode]="'SPECIFIC'"
[scale]="1.0"
[ready]="ready"
[viewerToolTipOpening]="viewerToolTipOpening"
[enableAccessibility]="false">
</tr-viewer>

 

 

mvc razor version, can i do it the same way in angularcli viewer version.

@(Html.TelerikReporting().ReportViewer()                 // Each report viewer must have an id - it will be used by the initialization script                 // to find the element and initialize the report viewer.                 .Id("reportviewerTotal")         // The URL of the service which will serve reports.         // The URL corresponds to the name of the controller class (ReportsController).         // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.         //   .ServiceUrl(Url.Content("/api/reportapi/"))         .ServiceUrl(Url.Content("/api/reportapi/"))                           // The URL for the report viewer template. The template can be edited -                // new functionalities can be added and unneeded ones can be removed.                // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.                // Strongly typed ReportSource - TypeReportSource or UriReportSource.                .ReportSource(new Telerik.Reporting.TypeReportSource() { TypeName = typeof(application.ReportViewer.ReportCatalog.ReportCatalog).AssemblyQualifiedName })

Todor
Telerik team
 answered on 08 Dec 2017
2 answers
165 views

Hi,

We've just gotten started with Telerik Report. We're using Visual Studio 2017 and successfully created a Telerik Reporting Library Project. Within that Telerik Reporting Library Project, I created a Report (which is a .cs class), which works properly when I do a Preview and a HTML Preview. It displays the report with the proper data.

I added a Telerik Reporting REST project to my application and I believe that is also working because I get the following message when I hit the api/reports/formats URL: [{"name":"PDF","localizedName":"Acrobat (PDF) file"},{"name":"CSV","localizedName":"CSV (comma delimited)"},{"name":"XLS","localizedName":"Excel 97-2003"},{"name":"RTF","localizedName":"Rich Text Format"},{"name":"IMAGE","localizedName":"TIFF file"},{"name":"MHTML","localizedName":"Web Archive"},{"name":"XPS","localizedName":"XPS Document"}]

I also created a folder in my project named "Reports" which is the default reportsPath.

I then added the HTML 5 viewer Page to my web project and that also comes up, but it doesn't load my report and gives the following error:

Unable to get report parameters.
Report 'Telerik.Reporting.Examples.CSharp.ReportCatalog%2C%20CSharp.ReportLibrary' cannot be resolved. (I tried with the demo report)

This is the same error I got before I created the REST project in my application.

Is there any obvious step I'm missing? Thanks.

Silviya
Telerik team
 answered on 08 Dec 2017
0 answers
101 views

Hi, 

I Created a report, when i preview the report it works fine but  sometimes i get " InnerException" Error. I don't understand i am getting this error. Please can anyone help me. Please find the below attached image. 

Thanks,

Mans

SonuMani
Top achievements
Rank 1
 asked on 07 Dec 2017
3 answers
266 views

I have created a report with groups. In the designer, I have done the following

Group, Action = Toggle Visibility

Details, Visible = False

 

So when the user opens the report, it will show with collapsed groups, which is what I want. However I want to give the user the ability to expand all groups instead of clicking manually on the "+" icons one-by-one. 

Is that possible?

Silviya
Telerik team
 answered on 07 Dec 2017
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?