Telerik Forums
Reporting Forum
1 answer
166 views
In the print detail section, I have customer name print in the first row, and address print in second row.
So my question: Is there any way I can skip second row if address is empty.

Right now, my report print this if Customer B address field is empty:

Header
----------------------------------
Customer A
Customer A's address
Customer B

Customer C
Customer C's address
-----------------------------------
Footer

Instead, I want it to print like this if Customer B address field is empty:

Header
----------------------------------
Customer A
Customer A's address
Customer B
Customer C
Customer C's address
-----------------------------------
Footer

Thanks for any suggestions.
Paul Hutson
Top achievements
Rank 1
 answered on 19 Mar 2008
7 answers
1.3K+ views
I searched the Reporting forums for any example I could find about combining multiple reports together in to one report, sadly I found none what so ever. Yes there were mentions of using sub reports, but what if you had more than one report you wanted to add in there. There was no examples at all that I could find. So I sat down and started hacking away at this problem. Luckily I did find a solution that works. I hope this helps out anyone that read this, enjoy. There may be some errors here and there, as there always are in examples. But the general idea should be straight forward. Also that only the detail section of each report will be placed in the sub report at the current moment. Thank you for your time.

PageBatch.cs
public PageBatch(List<int> ItemIds) { 
            //Create new sections 
            PageHeaderSection header = new PageHeaderSection(); 
            PageFooterSection footer = new PageFooterSection(); 
            DetailSection ds = new DetailSection(); 
 
            //"Remove" the header and footer 
            header.Height = new Unit(0.1, UnitType.Pixel); 
            footer.Height = new Unit(0.1, UnitType.Pixel); 
 
            //add header 
            this.Report.Items.Add((ReportItemBase)header); 
 
            double previousLocation = 0; //this will store the offset of the Y direction 
 
            UnitType pageMeasurementType = this.PageSettings.PaperSize.Width.Type; 
 
            for(int i = 0; i < ItemIds.Count; i++){ 
                 
                //since subReport inherits from baseitem it can be fed in programmaticly 
                SubReport sb = new SubReport(); 
                sb.ReportSource = new TestPage(ItemIds[i]); 
 
                //move subreport 1.25 inches in Y direction 
                sb.Location = new PointU(new Unit(0, pageMeasurementType), new Unit(previousLocation, pageMeasurementType)); 
                sb.Width = this.PageSettings.PaperSize.Width - (this.PageSettings.Margins.Right + this.PageSettings.Margins.Left ); 
                previousLocation += this.PageSettings.PaperSize.Height.Value; 
                ds.Items.Add(sb); 
            } 
 
            this.Report.Items.Add((ReportItemBase)ds); 
            this.Report.Items.Add((ReportItemBase)footer); 
 
            this.Report.PageSettings.Margins.Top = new Unit(0.15, UnitType.Inch); 
            this.Report.PageSettings.Margins.Bottom = new Unit(0.25, UnitType.Inch); 
            this.Report.PageSettings.Margins.Left = new Unit(0.25, UnitType.Inch); 
            this.Report.PageSettings.Margins.Right = new Unit(0.25, UnitType.Inch); 
        } 

TestPage.cs
        public TestPage(int _ItemId) { 
                //do some logic here 
        } 


Svetoslav
Telerik team
 answered on 18 Mar 2008
1 answer
209 views
Hi I am using Q2 2007.  I have a report that uses a single integer parameter, and that parameter is referenced in a simple filter "field=parameter".

I have a text box on teh page header that shows the parameter value, so I know it is set.  But none of my header or detail sections shows up when I pass in a value.

Dim clientBatchID As Integer
clientBatchID = CInt(Request.QueryString("clientBatchID"))
Me.ReportViewer1.Report.ReportParameters("clientBatchID").Value = clientBatchID

If I run the report like this, I get the constants values (header text, page numbers etc) and the parameter text box, but no data.

If I do this

Dim clientBatchID As Integer
clientBatchID = 175
Me.ReportViewer1.Report.ReportParameters("clientBatchID").Value = clientBatchID

I get data for batch 175, report looks fine.

Could this be a transaction problem?  In the first example, I have left out some steps in teh pasted code above, where the records I want to report on are assigned the batch ID.  I imagine they might not be committed and the report doesn't see them.  But I follow this same pattern in other reports and do not have this problem...

any ideas?


Hrisi
Telerik team
 answered on 17 Mar 2008
4 answers
235 views
Hi

I'm having a problem using the ReportViewer with radAjaxManager (Prometheus)

I have a button click event which updates the report datasource
HOWEVER with radAjaxManager enabled,
the report doesn't update correctly and shows zero records

When the radAjaxManager AjaxEnabled is set to false
The report refreshes successfully...

I've tried hooking the radAjaxManager to both the Reportviewer and a panel containing the Reportviewer

Hope someone can help...


Here's the ASPX
===============
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="ButtonRefresh">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="ReportViewer1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<asp:Button ID="ButtonRefresh" runat="server" Text="Refresh" />
<br />

<asp:Panel ID="PanelReport" runat="server">
    <telerik:ReportViewer id="ReportViewer1" runat="server">
    </telerik:ReportViewer>
</asp:Panel>


This is the code behind
=======================
    Protected Sub ButtonRefresh_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonRefresh.Click
        Me.ReportBindIt(" FullName LIKE '%hoey%' ")
    End Sub

    Public Sub ReportBindIt(ByVal Criteria As String)

        Dim TelerikReport As New CaseReports.A4_CaseReport1
        Dim sqlSelectCommand1 As New SqlCommand()
        Dim sqlDataAdapter1 As New SqlDataAdapter()
        Dim sqlConnection1 As New SqlConnection()

        sqlConnection1.ConnectionString = GetConnectionString()
        sqlSelectCommand1.CommandText = "dbo.procGetReportCaseList1"
        sqlSelectCommand1.CommandType = Data.CommandType.StoredProcedure

        sqlSelectCommand1.Parameters.AddWithValue("Criteria", Criteria)
        sqlSelectCommand1.Parameters.AddWithValue("SortExpression", "fileref DESC")

        sqlSelectCommand1.Connection = sqlConnection1
        sqlDataAdapter1.SelectCommand = sqlSelectCommand1

        TelerikReport.DataSource = sqlDataAdapter1
        ReportViewer1.Report = TelerikReport


    End Sub
Martin
Top achievements
Rank 1
 answered on 14 Mar 2008
1 answer
190 views
Hello,

We've got a problem for web report viewer when displaying a report containing more than 1 page. The report has a group header and the detail section has a subreport containing data longer than 1 page. On web report viewer, the first page only display the group header, no subreport details, the second page starts to display subreport details. After export the report to PDF, the first page display group header and subreport details correctly.

Could you fix this problem in next release?

Thanks in advance.

mei
Chavdar
Telerik team
 answered on 12 Mar 2008
5 answers
424 views
We are currently running our builds through TFS. On our local machine, everything with the reports runs just fine, but when it runs through TFS, we end up getting some unusual errors and the build fails. I've copied the 4 required DLLs for web forms out to our additional references folder, which is all we've ever had to do in the past. Anyhow, the first time the build ran we got the following error:
C:\BUILD\Build\LearnShare Team Project\FEATURE Build\Sources\LMSOBJECTS\LMSReport.vb(7): warning BC40056: Namespace or type specified in the Imports 'Telerik.Reporting' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. 
MSBUILD : warning : TF42097: A work item could not be created for build failure. The value for the following required fields is invalid or missing: Assigned To 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(7): error BC31072: Warning treated as error : Namespace or type specified in the Imports 'Telerik.Reporting' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(818): error BC30002: Type 'Telerik.Reporting.Report' is not defined. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(943): error BC30002: Type 'Telerik.Reporting.Report' is not defined. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1327): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1328): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1329): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1330): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1331): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1332): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1337): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1339): error BC30451: Name 'ReportParameterType' is not declared. 
C:\BUILD\Build\XXXX\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1347): error BC30451: Name 'Telerik' is not declared. 

I then decided to remove the "Imports Telerik.Reporting" from the top of my class file and fully qualify all of the references to Telerik.Reporting.Report and Telerik.Reporting.ReportParameterType. I now get the following error.
MSBUILD : warning : TF42097: A work item could not be created for build failure. The value for the following required fields is invalid or missing: Assigned To 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(817): error BC30002: Type 'Telerik.Reporting.Report' is not defined. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(942): error BC30002: Type 'Telerik.Reporting.Report' is not defined. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1326): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1327): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1328): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1329): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1330): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1331): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1336): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1338): error BC30451: Name 'Telerik' is not declared. 
C:\BUILD\Build\XXXX Team Project\FEATURE Build\Sources\xxOBJECTS\xxReport.vb(1346): error BC30451: Name 'Telerik' is not declared. 
Paul
Top achievements
Rank 1
 answered on 11 Mar 2008
1 answer
316 views
Hi all,
two question about telerik reporting:

1)  Can convert a report created with XTraReport suite 7.3.7.0 ?
I'm considering various reports tools and I would compare telerik features with xtrareport features.
2) Why there isn't a grid component for report ?


Thanks in advance and best regards,
Diego
Svetoslav
Telerik team
 answered on 11 Mar 2008
1 answer
230 views
I have built a report using Telerik Reporting in VS2008.  Everything works while in VS2008, including running the web application.  The report is generated within the browser without a problem.  However when I migrate it to the webserver and run it all of the icons (next page, previous page, refresh...) show as broken image links and no data is displayed.  I have copied the the following files to the webserver:
Telerik.Reporting.dll
Telerik.Reporting.Interfaces.dll
Telerik.Reporting.Processing.dll
Telerik.ReportViewer.WebForms.dll

The web.config file contains the following lines:

<

assemblies>
<
add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<
add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<
add assembly="Telerik.ReportViewer.WebForms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
<
add assembly="Telerik.Reporting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
<
add assembly="Telerik.Reporting.Processing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
<
add assembly="Telerik.Reporting.Interfaces, Version=2.0.0.0, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>
</
assemblies>

<

httpHandlers>
<
remove path="*.asmx" verb="*" />
<
add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<
add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<
add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<
add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" validate="true" />
</
httpHandlers>

<
handlers>
<
remove name="WebServiceHandlerFactory-Integrated"/>
<
remove name="ScriptHandlerFactory"/>
<
remove name="ScriptHandlerFactoryAppServices"/>
<
remove name="ScriptResource"/>
<
remove name="Telerik.ReportViewer.axd_*"/>
<
add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=2.0.1.0, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode,runtimeVersionv2.0" />
<
add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<
add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</
handlers>

Any help would be welcome.
Steve

Chavdar
Telerik team
 answered on 11 Mar 2008
2 answers
125 views

I have a web project in Visual Studio.net 2005.  The backend is VB and it is on a networked server.  My computer is running

When I follow the instructions to create a report, it puts the VB file in my app_code folder.  I can then right click and open the report in Design Mode.

When I click the “Telerik Reporting” menu and select “Report Wizard”  visual studio either crashes with “Visual Basic Compiler has encountered a problem and needs to close.” Or I get this error: “An error occurred while processing this command.  Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Or this error. “the type initializer for 'keys' threw an exception”  I don’t know what to make of it.

If I click the drop down for DataSource in the reports properties, I get more errors…..

Any thoughts?

John
Top achievements
Rank 1
 answered on 10 Mar 2008
1 answer
160 views
How do I assign telerik reporting to dataset?

Is it possible?
Ivan
Telerik team
 answered on 05 Mar 2008
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?