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
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 |
sessionState
mode="SQLServer"
this.txtCompany.Value ='this is a test'
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
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 |
Private Sub dbReport_NeedDataSource(ByVal sender As System.Object, ByVal 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.Object, ByVal 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 |
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 |
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 |
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
setting PlotArea->XAxis->DataLabelsColumn to PolicyYear and DataGroupColumn to Line. It isn't working. Any ideas on how to do this?
|
||||||||||||||||||||||||||||||||||||
|
|