Telerik Forums
Reporting Forum
1 answer
285 views

I was working on a report that had a sub report that displayed in multiple columns. From what I understand Telerik Reports do not currently support multiple columns in sub reports so I came up with this hack.

1)      Create master report

2)      Create a sub report for as many columns you need

3)      For the sub reports you will need to return a rownumber value. From that you can use the modulus function to filter what is displayed. For example:

 Report1 filter would be

Me.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("= Fields.RowNumber Mod 2", Telerik.Reporting.Data.FilterOperator.Equal, "0")})

        Report2 filter would be

Me.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("= Fields.RowNumber Mod 2", Telerik.Reporting.Data.FilterOperator.NotEqual, "0")})

This splits the sub report columns to odds and even based on row count.

I wanted to make the solution a little more robust and move some processing to the server so I ended up using the stored procedure below. You pass in the total number of columns and which column the call is being made from. For example for a two columns-

subreport1 would pass @NumberofColumns=2, @ColumnNumber=1, @MultiColumn=True
subreport2 would pass @NumberofColumns=2, @ColumnNumber=2, @MultiColumn=True

I hope this helps and if anyone has ideas on improving this please post them.

CREATE PROCEDURE [dbo].[NET_sp_PullBuildingSubDept2]

(

      @BuildingIdnt int=0,

      @NumberofColumns int=0,

      @ColumnNumber int=0,

      @MultiColumn bit =0

)

AS

BEGIN

      SET NOCOUNT ON;

If (@MultiColumn =0)

BEGIN

      SELECT    REPLACE(REPLACE(EntityName,'(COM)',''),'(RES)','') as EName, EntityName as EntityName, DepartmentType, PoliticalSubdivision, ApprovalDate, BuildingIdnt,Row_Number() OVER (ORDER BY EntityName) as RowNumber

      from dbo.NET_vw_Building

      where PrimaryBuildingIDnt=@BuildingIdnt

      order by entityname

END

ELSE

BEGIN

      If (@ColumnNumber =@NumberofColumns)

      BEGIN

            Set @ColumnNumber =0

      END

      ;With MyCTE as

      (

      SELECT    REPLACE(REPLACE(EntityName,'(COM)',''),'(RES)','') as EName, EntityName as EntityName, DepartmentType

      , PoliticalSubdivision, ApprovalDate, BuildingIdnt

      ,Row_Number() OVER (ORDER BY EntityName) as RowNumber

      from dbo.NET_vw_Building

      where PrimaryBuildingIDnt=@BuildingIdnt

      )

      SELECT EName, EntityName, PoliticalSubdivision, ApprovalDate, BuildingIdnt, RowNumber

      FROM MyCTE

      WHERE RowNumber %  @NumberofColumns = @ColumnNumber

      order by entityname

END

END

GO

David A.
Top achievements
Rank 1
 answered on 20 Feb 2012
2 answers
268 views
Hi there. 
I try to access the ReportProcessor and receive the following three Exceptions:
BindingFailure wurde erkannt.
Message: Die Assembly mit dem Anzeigenamen "Telerik.ReportConverter.ActiveReports" konnte im "Load"-Bindungskontext der AppDomain mit ID 1 nicht geladen werden. Fehlerursache: System.IO.FileNotFoundException: Die Datei oder Assembly "Telerik.ReportConverter.ActiveReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Dateiname: "Telerik.ReportConverter.ActiveReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
 
=== Zustandsinformationen vor Bindung ===
LOG: Benutzer = NORD\OleA
LOG: DisplayName = Telerik.ReportConverter.ActiveReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be
 (Fully-specified)
LOG: Appbase = file:///C:/NET/Allinvos/ProcessManager/bin/Debug/
LOG: Ursprünglicher PrivatePath = NULL
Aufruf von Assembly : Telerik.Reporting, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be.
===
LOG: Diese Bindung startet im default-Load-Kontext.
LOG: Die Anwendungskonfigurationsdatei wird verwendet: C:\NET\Allinvos\ProcessManager\bin\Debug\ProcessManager.vshost.exe.Config
LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config wird verwendet.
LOG: Verweis nach der Richtlinie: Telerik.ReportConverter.ActiveReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.ActiveReports.DLL.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.ActiveReports/Telerik.ReportConverter.ActiveReports.DLL.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.ActiveReports.EXE.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.ActiveReports/Telerik.ReportConverter.ActiveReports.EXE.

BindingFailure wurde erkannt.
Message: Die Assembly mit dem Anzeigenamen "Telerik.ReportConverter.CrystalReports" konnte im "Load"-Bindungskontext der AppDomain mit ID 1 nicht geladen werden. Fehlerursache: System.IO.FileNotFoundException: Die Datei oder Assembly "Telerik.ReportConverter.CrystalReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Dateiname: "Telerik.ReportConverter.CrystalReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
 
=== Zustandsinformationen vor Bindung ===
LOG: Benutzer = NORD\OleA
LOG: DisplayName = Telerik.ReportConverter.CrystalReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be
 (Fully-specified)
LOG: Appbase = file:///C:/NET/Allinvos/ProcessManager/bin/Debug/
LOG: Ursprünglicher PrivatePath = NULL
Aufruf von Assembly : Telerik.Reporting, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be.
===
LOG: Diese Bindung startet im default-Load-Kontext.
LOG: Die Anwendungskonfigurationsdatei wird verwendet: C:\NET\Allinvos\ProcessManager\bin\Debug\ProcessManager.vshost.exe.Config
LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config wird verwendet.
LOG: Verweis nach der Richtlinie: Telerik.ReportConverter.CrystalReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.CrystalReports.DLL.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.CrystalReports/Telerik.ReportConverter.CrystalReports.DLL.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.CrystalReports.EXE.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.CrystalReports/Telerik.ReportConverter.CrystalReports.EXE.

BindingFailure wurde erkannt.
Message: Die Assembly mit dem Anzeigenamen "Telerik.ReportConverter.XtraReports" konnte im "Load"-Bindungskontext der AppDomain mit ID 1 nicht geladen werden. Fehlerursache: System.IO.FileNotFoundException: Die Datei oder Assembly "Telerik.ReportConverter.XtraReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Dateiname: "Telerik.ReportConverter.XtraReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
 
=== Zustandsinformationen vor Bindung ===
LOG: Benutzer = NORD\OleA
LOG: DisplayName = Telerik.ReportConverter.XtraReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be
 (Fully-specified)
LOG: Appbase = file:///C:/NET/Allinvos/ProcessManager/bin/Debug/
LOG: Ursprünglicher PrivatePath = NULL
Aufruf von Assembly : Telerik.Reporting, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be.
===
LOG: Diese Bindung startet im default-Load-Kontext.
LOG: Die Anwendungskonfigurationsdatei wird verwendet: C:\NET\Allinvos\ProcessManager\bin\Debug\ProcessManager.vshost.exe.Config
LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config wird verwendet.
LOG: Verweis nach der Richtlinie: Telerik.ReportConverter.XtraReports, Version=5.1.11.928, Culture=neutral, PublicKeyToken=a9d7983dfcc261be
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.XtraReports.DLL.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.XtraReports/Telerik.ReportConverter.XtraReports.DLL.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.XtraReports.EXE.
LOG: Download von neuem URL file:///C:/NET/Allinvos/ProcessManager/bin/Debug/Telerik.ReportConverter.XtraReports/Telerik.ReportConverter.XtraReports.EXE.

To translate this it means the , Telerik.ReportConverter.ActiveReports, Crystalereports and XtraReports could not be found. The telerik reporting dll 5.1.11.928  is added as a reference. I also tried another (newer) version of reports. The code area looks like this:
private RenderingResult RenderClearingArchivedReport(int clearingId, string culLang)
       {
           RenderingResult result = null;
 
           rptClearingArchived reportClearingArchived = new rptClearingArchived(culLang, this.DocumentTitle);
           reportClearingArchived.ReportParameters["clearingId"].Value = clearingId;
           result = new ReportProcessor().RenderReport("pdf", reportClearingArchived, null);
 
           return result;
       }

the line "result=" is throwing the exception.

The code was working on my collegues machine (who is on holidays currently) so there MIGHT be a configuration issue he did not check in.

Probably something really stupid.


Ole Albers
Top achievements
Rank 2
 answered on 20 Feb 2012
3 answers
601 views
I currently have a standard report that is working well and looks something like the following:

-----------------------------
Product: Foo
-----------------------------
Date      Itmes Sold    Total
Feb 01    5             14.95
Feb 03    2             5.98
Feb 04    10            29.90
-----------------------------
Total     17            50.83 [1]
-----------------------------

-----------------------------
Product: Bar
-----------------------------
Date      Itmes Sold    Total
Feb 01    7             34.94
Feb 03    1             4.99
-----------------------------
Total     8             39.92 [1]
-----------------------------

//...
more products
//....

-----------------------------
Report
Totals    26            90.75
-----------------------------

I've been asked to include a summary at the bottom of the report.  The summary will list the totals for each product (the information marked [1] above) similar to the following:


-----------------------------
Summary
-----------------------------
Foos      17            50.83
Bars       8            39.92
-----------------------------
Total     26            90.75
-----------------------------


As there is only one item detail per report, can this be done?  How would I create the summary?  Do I need to create a sub report?

Any help would be appreciated.


Elian
Telerik team
 answered on 20 Feb 2012
1 answer
815 views
I have just installed the 2012 Q1 release.
If I create a new project and add a Telerik report,
the Telerik.Reporting and Telerik.Reporting.Design dlls
are added to the project's references.
The designer throws an error that the Telerik.Reporting.Report class is not found.
The Telerik,Reporting assembly is not visible in the object browser.
Afte closing VS and reloading the project, the Telerik.Reporting dll is visible
in the object browser until I either build the project or open the report designer wizard.

I'm using VS2010 SP1 on windows 7 professional 64bit.
Has anyone else run into this issue?
Corrective action?
Thanks,
Mark
Hristo
Telerik team
 answered on 20 Feb 2012
1 answer
79 views
I have a query that is returning TotalSubmissions, AcceptedSubmissions, RejectedSubmissions and PendingSubmissions.  These are drawn as four bars on a bar chart.  I want to add two ChartMarkedZones to the chart, one at 10% of the TotalSubmissions and one at 60% of TotalSubmissions.  How do I go about this?

Thomas
Elian
Telerik team
 answered on 20 Feb 2012
3 answers
317 views
I have a crosstab with the following Row Groups:
Year ->
     Month ->
             Sales Unit ->
                       Sub Sales Unit 1 ->
                                  ... Sub Sales Unit N ->
                                                           Product ->
                                                                             Detail.

Groups are linked to each other by parent-child relationship.
In an application this tree structure is dynamic, the level of the Sub Sales Units equals 1...N (for example Nmax=5). User can select Sales Units that are shown on the report.
How to prepare a report with this structure. Is it possible to hide unused levels and show Product and Details?
Detail group in the crosstab is linked with the last child group. How can I show Product and Details if there are less levels than Nmax?
Attached image shows a report with one Sub Sales Unit. I'd like to avoid designing a separate reports for each level.

Thanks,
Sebastian
IvanY
Telerik team
 answered on 20 Feb 2012
3 answers
456 views
Hi,

After click the print button,no dialog display anymore and directly print to a pdf file. I checked the demo(http://demos.telerik.com/reporting/product-sales/demo.aspx)     it's the same.But the previous version is normal.

thanks

Kevin

IvanY
Telerik team
 answered on 20 Feb 2012
13 answers
395 views
I am calling ReportBook from ReportViewer(in silverlight). In silverlight I am passing parameter to reportbook as follows.
void ReportViewer1_RenderBegin(object sender, RenderBeginEventArgs args)
  
{
  
//single value parameter 
  
args.ParameterValues["FormNumber"] = "ABC1";
  
args.ParameterValues["FormID"] = 10;
  
}
In ReportBook I am adding reports as follows.
class ReportBook2 : Telerik.Reporting.ReportBook
  
{
  
public ReportBook2()
  
{
  
this.Reports.Add(new Report1());
  
this.Reports.Add(new Report2());
  
this.Reports[0].DocumentMapText = "Dash Board";
  
this.Reports[1].DocumentMapText = "Product Sales";
  
}
  
}

Report1 needs parameter FormNumber. Report2 needs parameter FormID.
1. How to transfer these parameter to appropriate reports from reportbook?
2. Is there any way to add reports to reportbook from client(Silverlight) with appropriate parameters?


Steve
Telerik team
 answered on 20 Feb 2012
4 answers
269 views
Hi,

I need to put a subreport in a groupfooter, and I can't seem to make it work.
So, I have a Master Report, called List, this object has several properties that have to be set on the Master report.
In the detailsection I've put an SubReport, this Detail Report contains all lines from the List.
Until here, everything works great.
In the detailreport I've added several groups, because the lines have to be grouped.

Example:

Driver A (Driver-Group)
    Customer X (Customer Group)
         Address XYZ (Address Group)
              - Line1
              - Line 2
              - Line 3
          Address XYZ Footer: SubReport with all carriers on line 1,2,3
        Address ABC
              - Line 4
              - Line 5
         Adress ABC Footer: Subreport with all carriers on line 4,5
    Customer Y
    ...
Driver B
...

So I've managed to display all lines corretly,
I've also managed to get all group-data (Driver A, Customer X, Address XYZ)
By storing it in private variable in the detail_ItemDataBound,
when I debug I see that the correct data is being fetched.

private void detail_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.DetailSection detailSection = (Telerik.Reporting.Processing.DetailSection)sender;
 
            TransportListDocument doc = (TransportListDocument)detailSection.DataObject.RawData;
 
            if (doc != null)
            {
                if( String.IsNullOrEmpty(doc.Memo))
                {
                    txtMemo.Visible = false;
                    captionMemo.Visible = false;
                }
 
                txtType.Value = Translator.Translate("_" + doc.DocumentType);
                listId = doc.TransportListId;
                driverId = doc.Driver.Id;
                customerId = doc.Customer.Id;
                addressId = doc.Address.Id;
            }
        }

private void subCarriers_NeedDataSource(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.SubReport subReport = (Telerik.Reporting.Processing.SubReport)sender;
            if(listId > 0 && driverId > 0 && customerId > 0 && addressId > 0)
            {
                AmountOfCarriers amountOfCarriers = DataFacade.Transport.DFCarrier.GetAmountOfCarriers(listId, driverId, CustomerId, addressId, LanguageId, BranchId);
 
                if (amountOfCarriers != null && amountOfCarriers.Count > 0)
                {
                    subTLCarriers1.SetPrivateDataMembers(Translator, LanguageId);
                    subTLCarriers1.DataSource = amountOfCarriers;
                }
            }
        }


or by using the data I find for each Address-group:

private void groupFooterAddress_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.ReportSection addressGroupSection = ((Telerik.Reporting.Processing.ReportSection)sender);
            Telerik.Reporting.Processing.Group customerGroup = ((Telerik.Reporting.Processing.Group)addressGroupSection.Parent.Parent);
            Telerik.Reporting.Processing.Group driverGroup = ((Telerik.Reporting.Processing.Group)customerGroup.Parent);
            TransportListDocuments docs = (TransportListDocuments)addressGroupSection.Report.DataSource;
 
 
            int selectedAddressId = ((Address)addressGroupSection.DataObject["Address"]).Id;
            int selectedCustomerId = ((ObjectModel.Customer.Customer)(customerGroup.GroupHeader.DataObject["Customer"])).Id;
            int selectedDriverId = ((Driver)(driverGroup.GroupHeader.DataObject["Driver"])).Id;
 
            AmountOfCarriers amountOfCarriers = DataFacade.Transport.DFCarrier.GetAmountOfCarriers(docs[0].TransportListId, selectedAddressId, selectedCustomerId, selectedDriverId, LanguageId, BranchId);
 
            if (amountOfCarriers != null && amountOfCarriers.Count > 0)
            {
                subTLCarriers1.SetPrivateDataMembers(Translator, LanguageId);
                subTLCarriers1.DataSource = amountOfCarriers;
 
            }
        }

which is sufficient to me to get data for the subreport in the footer.


Only the last line of code (subTLCarriers1.DataSource = amountOfCarriers;) sets the datasource on the control on the Detail Report, not the instance of the subreport in de groupFooter, as result, I get the same subreport for ALL the groups in my Detail Report instead of a different subreport for each address-group of lines.

Could you help me find a way to set the DataSource of each instance of the subreport in the Group-Footer,
so that each Address-Group get it's own subreport in it's footer?

Any help is very much welcome since I've been struggling with this for a few days now.



Koen L
Top achievements
Rank 1
 answered on 20 Feb 2012
1 answer
288 views
How to show ellipsis to indicate text overflow in the textblock control in telerik reporting 
Steve
Telerik team
 answered on 20 Feb 2012
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?