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?
|
||||||||||||||||||||||||||||||||||||
|
||||||||
|
| ConnectionStringSettings connSettings = ConfigurationManager.ConnectionStrings["myConnectionString"]; |
| if ((connSettings != null) && (connSettings.ConnectionString != null)) |
| { |
| this.hospitalDataSetTableAdapter1.Connection.ConnectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString; |
| } |
| } |
| 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); |
| } |
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
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