Telerik Forums
Reporting Forum
3 answers
154 views
Hi,

I need to find out if there is some way for me to do checks in my report when it is generated. Currently I'm generating a report that receives a collection of objects as its datasource(via a bindingsource). Each of these objects in my collection is of type ITenderLineItem. This is an interface that I wrote. So basicly this list contains objects of different datatypes. They are: TenderSeries, TenderSection and TenderItem. All three these classes implements ITenderLineItem. Now in my report I'd like to display:

Series/Section Nr Item Nr Description Unit Qty Rate 1 Amount 1 Rate 2
                 
1000   General     0   0   --> Series  
1000   Section 1     0   0  
  10.1 Item 1     1000   1000  
  10.1 SubItem 1     2000   3000  



Summary Here
 
(i) SubSubItem 1 mm2 5 4000   7000  
2000   Housing     0   0  --> Series  
2100   Section 1     0   0  
  21.1 Item 1 UNIT 100 0   0  
  (i) SubItem 1     0   0  
  (i) Sub-SubItem 1     0   0  

Summary Here

But at the moment I'm just getting my report to display all Items:

Series/Section Nr Item Nr Description Unit Qty Rate 1 Amount 1 Rate 2
                 
1000   General     0   0  
1000   Section 1     0   0  
  10.1 Item 1     1000   1000  
  10.1 SubItem 1     2000   3000  
  (i) SubSubItem 1 mm2 5 4000   7000  
2000   Housing     0   0  
2100   Section 1     0   0  
  21.1 Item 1 UNIT 100 0   0  
  (i) SubItem 1     0   0  
  (i) Sub-SubItem 1     0   0  


The way I see it is that I'd need to have some sort of check in my report to determine if the Item being added is a Series Item and then to insert a summary section to summarize the totals per series etc. This I can do by castig the object or calling the ToString() method and checking what gets returned. Problem is I don't know how to do this sort of testing in my report. What events should I use and what expressions do I need to add to my TextBoxes.

Regards

Jacobus

Hrisi
Telerik team
 answered on 24 Jul 2009
5 answers
414 views
I have the following data coming from a SqlDataAdapter:

Line                PolicyEffectiveDate     PolicyYear  TotalIncurred         ClaimCount
------------------- ----------------------- --------------------------------- ------------
Auto                2002-07-01 00:00:00.000 2002        27510                 9
Auto                2003-07-01 00:00:00.000 2003        86348                 9
Auto                2004-07-01 00:00:00.000 2004        189816                11
Auto                2005-07-01 00:00:00.000 2005        71493                 15
Auto                2006-07-01 00:00:00.000 2006        84040                 13
Auto                2007-07-01 00:00:00.000 2007        32843                 7
Auto                2008-07-01 00:00:00.000 2008        48563                 11
GL                  2002-07-01 00:00:00.000 2002        48617                 5
GL                  2003-07-01 00:00:00.000 2003        305553                4
GL                  2005-07-01 00:00:00.000 2005        714                   3
GL                  2008-07-01 00:00:00.000 2008        23000                 2
Property            2003-07-01 00:00:00.000 2003        12782                 1
Property            2007-07-01 00:00:00.000 2007        8372                  1
WC                  2003-07-01 00:00:00.000 2003        384394                25
WC                  2004-07-01 00:00:00.000 2004        304270                28
WC                  2005-07-01 00:00:00.000 2005        52678                 14
WC                  2006-07-01 00:00:00.000 2006        4638                  2
WC                  2007-07-01 00:00:00.000 2007        50125                 7
WC                  2008-07-01 00:00:00.000 2008        64037                 5

I have the following code in my NeedDataSource:

        Me.SqlDataAdapter1.SelectCommand.Parameters("@PolicyNum").Value = Me.ReportParameters("@PolicyNum").Value
        Me.SqlDataAdapter1.SelectCommand.Parameters("@AcctNum").Value = Me.ReportParameters("@AcctNum").Value
        Me.SqlDataAdapter1.SelectCommand.Parameters("@SaleNum").Value = Me.ReportParameters("@SaleNum").Value
        Me.SqlDataAdapter1.SelectCommand.Parameters("@Lineid").Value = Me.ReportParameters("@Lineid").Value
        Me.SqlDataAdapter1.SelectCommand.Parameters("@ParentAgent").Value = Me.ReportParameters("@ParentAgent").Value
        Me.SqlDataAdapter1.SelectCommand.Parameters("@SubAgent").Value = Me.ReportParameters("@SubAgent").Value
        Me.SqlDataAdapter1.SelectCommand.Parameters("@StartEffDate").Value = Me.ReportParameters("@StartEffDate").Value
        Me.SqlDataAdapter1.SelectCommand.Parameters("@EndEffDate").Value = Me.ReportParameters("@EndEffDate").Value

        Dim dataSet As New DataSet()
        SqlDataAdapter1.Fill(dataSet)

        Dim ChartInc As Telerik.Reporting.Processing.Chart = CType(sender, Telerik.Reporting.Processing.Chart)
        Dim DefChart As Telerik.Reporting.Chart = DirectCast(ChartInc.ItemDefinition, Telerik.Reporting.Chart)
        ChartInc.DataSource = dataSet


I am trying to have 2 different charts: one showing TotalIncurred and one showing ClaimCount as the series.  I want to show them by Policy Year and by Line on the same chart, but group them.  I thought I could use the DataGroupColumn, so I tried 

setting PlotArea->XAxis->DataLabelsColumn to PolicyYear and DataGroupColumn to Line.  It isn't working.  Any ideas on how to do this?

 



Giuseppe
Telerik team
 answered on 24 Jul 2009
8 answers
196 views
Hi guys, i feel that i must be missing something in the installation as i can never see the design view in vs2008. I have tried to install reporting on 3 machines running VS 2008 SP1 and in all 3 i get the same issue.

Step 1, i create a new class lib
step 2, i add a new item of type Telerik report 2009 Q1
when the design view comes up i get

To prevent possible data loss before loading the designer, the following errors must be resolved:
1 Error
Why am I seeing this page?
Object reference not set to an instance of an object.

 
Instances of this error (1)
1.
at Telerik.ReportViewer.WinForms.WinViewer.UpdateScrollSize()
at Telerik.ReportViewer.WinForms.WinViewer.OnSizeChanged(EventArgs eventArgs)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
at System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified)
at System.Windows.Forms.ScrollableControl.ScaleControl(SizeF factor, BoundsSpecified specified)
at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
at System.Windows.Forms.ContainerControl.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds)
at System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout()
at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout)
at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
at Telerik.ReportViewer.WinForms.ReportViewerAreaBase.InitializeComponent()
at Telerik.ReportViewer.WinForms.ReportViewerAreaBase..ctor()
at Telerik.ReportViewer.WinForms.WinViewer..ctor()
at Telerik.ReportViewer.WinForms.ReportViewer..ctor()
at Telerik.Reporting.Design.ReportPreviewer..ctor()
at Telerik.Reporting.Design.PreviewView..ctor(ReportRootDesigner rootDesigner, IServiceProvider provider)
at Telerik.Reporting.Design.ReportRootDesigner.Initialize(IComponent component)
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
 
What can i do so that i can view the designer so that i can start using the reporting?
Chuck Lynch
Top achievements
Rank 1
 answered on 23 Jul 2009
1 answer
186 views
If the table adapter in dataset use connection string stored in Web.config, the report works OK when running the web page but show no data while previewing in Design mode.

I tried the solution proposed in forums but didn't work.
            ConnectionStringSettings connSettings = ConfigurationManager.ConnectionStrings["myConnectionString"]; 
            if ((connSettings != null) && (connSettings.ConnectionString != null)) 
            { 
                this.hospitalDataSetTableAdapter1.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString; 
            } 
 

I debug Design Preview with a MessageBox like this...
            } 
            catch (System.Exception ex) 
            { 
                // An error has occurred while filling the data set. Please check the exception for more information. 
                MessageBox.Show(ex.Message); 
                System.Diagnostics.Debug.WriteLine(ex.Message); 
            } 

and I get "Object not set to an instance of an object"

What am I missing?
Thanks a lot!
Jorge
Top achievements
Rank 1
 answered on 23 Jul 2009
2 answers
159 views
Hello,

I have a line chart in my report and want to show dates on the x-axis. Unfortunately the X-axis item labels don't show up. I tried to do it with the following code:

 

private void _gideonChart_NeedDataSource(object sender, EventArgs e)

 

{

_gideonChart.Series.Clear();

_gideonChart.PlotArea.XAxis.Clear();

_gideonChart.PlotArea.XAxis.AutoScale =

false;

 

_gideonChart.PlotArea.XAxis.AutoShrink =

false;

 

 

ChartSeries msciUsdSeries = new ChartSeries();

 

msciUsdSeries.Name =

"MSCI World USD";

 

msciUsdSeries.Type =

ChartSeriesType.Line;

 

msciUsdSeries.Appearance.FillStyle.MainColor =

Color.Purple;

 

msciUsdSeries.Appearance.FillStyle.SecondColor =

Color.Purple;

 

 

ChartSeries msciEurSeries = new ChartSeries();

 

msciEurSeries.Name =

"MSCI World EUR";

 

msciEurSeries.Type =

ChartSeriesType.Line;

 

msciEurSeries.Appearance.FillStyle.MainColor =

Color.FromArgb(203, 216, 254);

 

msciEurSeries.Appearance.FillStyle.SecondColor =

Color.FromArgb(203, 216, 254);

 

 

foreach (var entry in _dataSource)

 

{

 

ChartSeriesItem msciUsdItem = new ChartSeriesItem();

 

 

ChartSeriesItem msciEurItem = new ChartSeriesItem();

 

msciUsdItem.YValue = (

double)entry.MsciUsdQuote;

 

msciUsdItem.Label.Visible =

false;

 

msciUsdSeries.Items.Add(msciUsdItem);

msciEurItem.YValue = (

double)entry.MsciEurQuote;

 

msciEurItem.Label.Visible =

false;

 

msciEurSeries.Items.Add(msciEurItem);

 

ChartAxisItem chartAxisItem = new ChartAxisItem(entry.QuotesDate.Date.ToShortDateString());

 

_gideonChart.PlotArea.XAxis.AddItem(chartAxisItem);

}

_gideonChart.Series.Add(msciUsdSeries);

_gideonChart.Series.Add(msciEurSeries);

}

If you see some mistakes or know something else that might help, please let me know.

Thanks in advance and kind regards,
Gerald

Gerald
Top achievements
Rank 1
 answered on 23 Jul 2009
2 answers
1.1K+ views
Hi,

Is it possible to generate a report from code behind and then send this pdf as an email.

I would like to achieve this without the user having to generate the report so I would need to do it using the api.

The scenario is if a user clicks a button 3 reports will get generated and sent to the user;s email address.
I want to do this on the fly.

I guess I might have to save the generated pdf in a temp folder while I send the email and then delete the reports.

Thanks,

Ronan
rmoynihan
Top achievements
Rank 1
 answered on 23 Jul 2009
2 answers
351 views

I am having trouble with a ReportBook.  The reports I am using are in a class, and they work fine if I set them up to show in a regular Report Viewer with the below code (the parameters are used in the NeedDataSource in the report):

    Dim report As Telerik.Reporting.Report = Nothing
        report = New LRSummary()
        If Not report Is Nothing Then
            If Not Me.txtPolNum.Text Is Nothing Then
                report.ReportParameters(0).Value = Trim(Me.txtPolNum.Text)
            End If
            If Not Me.txtAcctNum.Text Is Nothing Then
                report.ReportParameters(1).Value = Trim(Me.txtAcctNum.Text)
            End If
            If Not Me.txtSaleNum.Text Is Nothing Then
                report.ReportParameters(2).Value = Trim(Me.txtSaleNum.Text)
            End If
            If Not Me.Linid.Text Is Nothing Then
                report.ReportParameters(3).Value = Trim(Me.Linid.Text)
            End If
            If Not Me.txtParentAgent.Text Is Nothing Then
                report.ReportParameters(4).Value = Trim(Me.txtParentAgent.Text)
            End If
            If Not Me.txtSubAgent.Text Is Nothing Then
                report.ReportParameters(5).Value = Trim(Me.txtSubAgent.Text)
            End If
            If Not Me.LimitEffective.Text Is Nothing Then
                report.ReportParameters(6).Value = Trim(Me.LimitEffective.Text)
            End If
            If Not Me.LimitExpiration.Text Is Nothing Then
                report.ReportParameters(7).Value = Trim(Me.LimitExpiration.Text)
            End If
        End If
        Me.ReportViewer1.Report = report

But if I use the below code to try to use the same report in a report book, it doesn't work.

       Dim reportBook As New ReportBook()
        Dim report As Telerik.Reporting.Report = Nothing
        report = New LRSummary()
        If Not report Is Nothing Then
            If Not Me.txtPolNum.Text Is Nothing Then
                report.ReportParameters(0).Value = Trim(Me.txtPolNum.Text)
            End If
            If Not Me.txtAcctNum.Text Is Nothing Then
                report.ReportParameters(1).Value = Trim(Me.txtAcctNum.Text)
            End If
            If Not Me.txtSaleNum.Text Is Nothing Then
                report.ReportParameters(2).Value = Trim(Me.txtSaleNum.Text)
            End If
            If Not Me.Linid.Text Is Nothing Then
                report.ReportParameters(3).Value = Trim(Me.Linid.Text)
            End If
            If Not Me.txtParentAgent.Text Is Nothing Then
                report.ReportParameters(4).Value = Trim(Me.txtParentAgent.Text)
            End If
            If Not Me.txtSubAgent.Text Is Nothing Then
                report.ReportParameters(5).Value = Trim(Me.txtSubAgent.Text)
            End If
            If Not Me.LimitEffective.Text Is Nothing Then
                report.ReportParameters(6).Value = Trim(Me.LimitEffective.Text)
            End If
            If Not Me.LimitExpiration.Text Is Nothing Then
                report.ReportParameters(7).Value = Trim(Me.LimitExpiration.Text)
            End If

        End If
        reportBook.Reports.Add(New LRSummary())
        Me.ReportViewer2.Report = reportBook
       
        I add more reports, but in the same way.  I get either no data or errors on the parameters.  If I set some sample parameters in the report class itself, the reports work, but with those sample parameters instead of the ones I set in code.  I almost feel like I should rebind the datasource somehow, but I don't seem to be able to access the report's datasource.  Plus why would I have to do that on the report book but not the report viewer?  Any ideas what I am doing wrong?

Thanks, Amy 
       

Amy
Top achievements
Rank 1
 answered on 22 Jul 2009
1 answer
347 views
Hiya Folks,

I'm evaluating the Telerik products.

I have a requirement to write a report that (concurrently) uses data from BOTH an ODBC MySQL Database Connection AND a MS SQL Database.

Will Telerik's Report Writer support this requirement?

The ODBC MySQL uses the MySQL 3.51 ODBC client and is read only using Views.   The MS SQL is current 2008.  VS 2008 and .NET 3.5 is the development environment.   I'd like to wrap the reports in a SL 3 app (yes, I saw the recent TK example on how to do this - very nice).

If so, is there an example that demonstrates this?

If the Report Writer doesn't support multiple data sources on a single report, is there a fuctional work around with OpenAccess to combine tables from separate sources into a single data connection/source?  If so, I'll follow through with a post in the ORM forum.

FYI: My last resort would be to create a data warehouse for the MySQL data in MS SQL - I would like to avoid having to do that.

I'm always open to alternate solutions.

Thanks,
     Garth

*********** Later Update  *********
I am looking into ORM example:
http://www.telerik.com/ClientsFiles/112754_classlibraries.zip

to access multiple databases.

I would appreciate hearing from experienced users or TK on best practices in creating multi-database applications.
Steve
Telerik team
 answered on 22 Jul 2009
1 answer
175 views
Hello telerik team,

I whas busy with a news module where I use the image editor to crop images to the size of 100x100. I tried but the result whas like this

http://i30.tinypic.com/jkkjzr.jpg

The crop area you see is supose to be 100x100 but it exualy is 98x114.

This only occourse in IE when I set the width & height in the textboxes but when I use the selection field to drag it works perfect.

Hope this is solved soon

Greetings,
Jeroen Speldekamp
Rumen
Telerik team
 answered on 22 Jul 2009
6 answers
256 views
Hi,

-When will the next version of Telerik reports be released?
-Will the next release of Telerik reports have a wpf viewer? Will I perhaps have the capability to use my own wpf controls in the report if that is the case? (I'd like to use some of my own chart controls in the report)

Regards.
Jacobus
Henrique Duarte
Top achievements
Rank 1
Veteran
 answered on 21 Jul 2009
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?