Telerik Forums
Reporting Forum
5 answers
573 views

Hi,

I have created a report with the built in UI. I create the parameters programmatically in the following way:

 

ReportParameter

 

parameter = new ReportParameter();

 

parameter.Name =

"ParameterOne";

 

parameter.UI.AvailableValues.DataSource = m_dataSource;

parameter.UI.AvailableValues.DisplayMember =

"displayText";

 

parameter.UI.AvailableValues.ValueMember =

"value";

 

parameter.UI.Visible =

true;

 

parameter.UI.Text =

"please choose a value";

 

parameter.Value =

"None";

 

report.ReportParameters.Add(parameter);

 

In addition to the report i have a aspx page with a web report viewer and a button.
In the button event click I would like to read the values of the parameters as the user entered (or the default values if none were entered) and save them to my database.

I can't get to the new values, all I get is the default values.

I think if I could fire the Need_DataSource event I would be able to read the values the users chose there. But I can't figure out a way to fire the event without creating a new report and then loosing all the information I need.

Is this they way to get what I want? If so how can I fire the event. If not how can I achieve what I want?

Naphtali

Naphtali
Top achievements
Rank 1
 answered on 28 Jul 2009
2 answers
282 views
How do you hide the item label (number above the bar in a bar chart) for each series when series is created at runtime through needdatasource? 
Steve
Telerik team
 answered on 28 Jul 2009
1 answer
104 views
I down loaded the reports MSi file for Q2 2009 and ran the install.

I now have a Section in my toolbok listing Telerik Preporting Q2 2009 with 3 object in it: pointer, ReportBookControl, and ReportViewer but none of the tools shown in the demo.  Nor do I have the Telerin Reporting item in the menu bar but I do have the Telerik menu iteem for the ASP.NET tools.

Is there something else I need to do to get these?
Steve
Telerik team
 answered on 28 Jul 2009
1 answer
126 views
How do I change the name of the series programmatically for display in the legend?  (Chart Object)

I have this as my needdatasource event and every time I try to hit series(0) I get index out of range errors.   I have a datatable that always returns 3 columns of label, x, y and need to name x and y to what the user selects.  (x = sales, y =volume).  I have seen a number of examples, and tried them, but to no avail.

    Private Sub Chart1_NeedDataSource(ByVal sender As Object, ByVal e As EventArgs) Handles Chart1.NeedDataSource 
        Dim chart As Telerik.Reporting.Processing.Chart = TryCast(sender, Telerik.Reporting.Processing.Chart) 
        Dim mydt As DataTable 
        mydt = GetDTNoQ() 
        Dim mycount As Int32 = CInt(mydt.Rows.Count / 8) 
        Chart1.PlotArea.XAxis.LabelStep = mycount 
        chart.DataSource = mydt 
        'Dim mySeries As Telerik.Reporting.Charting.ChartSeries = Chart1.Series.GetSeries(0) 
        'mySeries.Name = "Sales" 
    End Sub 

Joel
Top achievements
Rank 2
 answered on 27 Jul 2009
3 answers
157 views
Hi,

I changed my web project over to using a state server rather than inProc e.g.

sessionState

 

 

mode="SQLServer"

 


Once I implemented this my parametered reports failed, ok not too much of a problem I thought, I will use parameters to pass the information into the report, and use the NeedDataSource event to collect the correct data, this has worked for everything that is bound to controls, but on a lot of my reports I programmically set the Values of some of the text boxes, this cannot be done within the NeedDataSource event because at this point the textboxes are already set (I think?),

so in the past I was able to do the following

this.txtCompany.Value ='this is a test'


in the constructor, but this now does not work because this work is now done in the NeedDataSource event, so I have tried the following

Telerik.Reporting.Processing.TextBox MyCompany = (Telerik.Reporting.Processing.TextBox)txtCompany;

MyCompany.Text = 'this is a test'

 

;

of course the Telerik.Reporting.Processing.TextBox is different to Telerik.Reporting.TextBox so it does not work.

does anyone have a solution to this problem, specifically programmically assigning values to textboxes on reports in any event after the constructor, I have maybe 20 textboxes on each report so setting an event for each textbox would be slow.


thanks in adavnce.


Alex


 





Alex White
Top achievements
Rank 1
 answered on 27 Jul 2009
5 answers
134 views

Everything works okay in Q12009, however, after I upgraded to Q2, I got "World is not Supported" error, just seeking for any suggestions.

I use the following code to generate and preview the report

Dim reportType As Type = Type.[GetType](String.Format("AgentLive.{0}, AgentLive, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", reportName))  
Dim report As IReportDocument = DirectCast(Activator.CreateInstance(reportType), IReportDocument)  
Me.ReportViewer1.Report = report 

And at report code-behind
 Private Sub dbReport_NeedDataSource(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.NeedDataSource  
        Dim report As Telerik.Reporting.Processing.Report = DirectCast(sender, Telerik.Reporting.Processing.Report)  
        report.DataSource = PrepareDBRPT(dbSource)  
    End Sub 
 
 
  Private Sub detail_ItemDataBound(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles detail.ItemDataBound  
        Dim detail As Telerik.Reporting.Processing.DetailSection = DirectCast(sender, Telerik.Reporting.Processing.DetailSection)  
        Dim section As Processing.DetailSection = TryCast(sender, Processing.DetailSection)  
'Customize something  
    End Sub 
Steve
Telerik team
 answered on 27 Jul 2009
11 answers
867 views
We've been using Telerik Reporting with a product that we have been developing for about a year. We have designed 5 or 6 reports for that product over the past several months using Q3 2008 SP1. These reports are bound to business objects that we have designed to work with NHibernate.

Today after upgrading to Q1 2009 we now get this error at design time on any report bound to an object with a nullable type such as:
'int?'

Our objects have had nullable types for quite some time now and we have never had any problems. We are excited about the new Table and Crosstab controls that were introduced with Q1 2009 and are looking forward to using them, but we must be able to bind to our business objects at design time and they must include nullable data types. 
Mattias
Top achievements
Rank 1
 answered on 25 Jul 2009
3 answers
106 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
386 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
166 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
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?