Telerik Forums
Reporting Forum
4 answers
324 views
When previewing a report I get the following error:

Unable to cast object of type 'SqldataObject' to type 'Telerik.Reporting.Processing.Expressions.IHierarchicalData'

I have narrowed down the problem to a textbox that has

=Sum(Exec("group4",Fields.Amount1))

Any help is appreciated
Steve
Telerik team
 answered on 28 Apr 2011
2 answers
290 views
Hello,

I'm using VS 2008 Q1 2010 Telerik Reporting

I'm attempting to set and bind a Telerik.Reporting.Processing.Table inside of the Detail's detail_ItemDataBound event and I'm running into some trouble.

I currently have a simple table inside my Report's detail. The table has a header and a detail row that repeats.

Originally I was binding the table to a DataTable inside of the DataBind() and having no issues.  After having some trouble getting the table's groupings correct I decided it would be a little more practical move the Telerik.Reporting.Processing.Table binding inside the detail_ItemDataBound event and bind it there with the correct data.  When I move the binding inside the detail_ItemDataBound event I get a blank table with no data.

Below is my code from the detail_ItemDataBound event:
private void detail_ItemDataBound(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.DetailSection detail = (Telerik.Reporting.Processing.DetailSection)sender;
    Telerik.Reporting.Processing.TextBox txtHierarchicalEntityID = (Telerik.Reporting.Processing.TextBox)detail.ChildElements.Find("txtHierarchicalEntityID", true)[0];
    Telerik.Reporting.Processing.Table tblReport = (Telerik.Reporting.Processing.Table)detail.ChildElements.Find("tblReport", true)[0];
 
    int hierarchicalEntityID = Convert.ToInt32(txtHierarchicalEntityID.Text);
 
    dsReporting dsBindingData = new dsReporting();
 
    foreach (dsReporting.AssessmentResultsChartRow currRow in dsRaw.AssessmentResultsChart.Rows)
        if ((int)currRow["HierarchicalEntityID"] == hierarchicalEntityID)
            dsBindingData.AssessmentResultsChart.ImportRow(currRow);
 
    dsBindingData.AcceptChanges();
 
    tblReport.DataSource = dsBindingData.AssessmentResultsChart;
}

Am I missing anything simple that would keep the tblReport from binding correctly?

Thanks for the help and let me know if you need anything else,
Allen
Allen Smothers
Top achievements
Rank 2
 answered on 28 Apr 2011
1 answer
118 views
I have a bar report that is using the NeedDataSource event to set the datasource and labels. On the initial report load the data is correct but the labels are just 1,2,3,... If I refresh the report I get the correct text labels (AUS Approved, AUS Declined,etc...). I have stepped through the code to verify that the dataset is being populated correctly on the initial load. However, when I get to the line of code that sets any of the series elements I get the following error message:"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index". I am trapping for any errors so the report will load with the correct data but no text for the labels. On a refresh I do not get the error and the label appear correctly. Here is the code for my NeedDataSource event:

private void chart1_NeedDataSource(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Chart procChart = sender as Telerik.Reporting.Processing.Chart;
              
            string sql = @"SELECT COUNT(l.[LookupID]) as 'AUSStatusCnt',l.[ClientLookupValue] as 'AUSStatus' 
                            FROM [AUS] a 
                            INNER JOIN [Organization] o ON a.[OrganizationID]=o.[OrganizationID] 
                            INNER JOIN [Lookup] l ON l.[LookupID] = a.[AUSStatusID] 
                            where  a.[AUSID] in ([dbo].[udf_GetLastAUSStatus](a.[AUSParentID])) 
                            AND a.[OrganizationID]=@OrganizationID AND l.[LookupTypeID]=13 
                            and l.[Active]=1 
                            AND a.[UpdatedByDate] >= DATEADD(d,-90,GETDATE())
                            GROUP BY l.ClientLookupValue,l.LookupID";
             
              
            SqlConnection sqlCnn = new SqlConnection();
            sqlCnn.ConnectionString = ConfigurationManager.ConnectionStrings["appConnString"].ConnectionString;
            try
            {
                DataSet ds = new DataSet();
                SqlCommand sqlCmd = new SqlCommand(sql,sqlCnn);
                sqlCmd.Parameters.Add("@OrganizationID",SqlDbType.Int);
                sqlCmd.Parameters["@OrganizationID"].Value = int.Parse(Report.ReportParameters["OrganizationID"].Value.ToString());
                SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd);
                adapter.Fill(ds);
  
                procChart.DataSource = ds;
                chart1.Series[0].DataLabelsColumn = "AUSStatusCnt";
                chart1.Series[0].DataYColumn = "AUSStatusCnt";
                  
                chart1.Legend.Visible = false;
  
                chart1.PlotArea.XAxis.DataLabelsColumn = "AUSStatus";
                chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 0;
                chart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.DarkSlateBlue;
                chart1.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Reporting.Charting.Styles.Unit.Percentage(20);
                chart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Arial", 10,FontStyle.Bold);
  
                  
  
                adapter.Dispose();
                sqlCmd.Dispose();
                sqlCnn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error loading report! ");
            }
  }
Steve
Telerik team
 answered on 28 Apr 2011
3 answers
133 views
Hello,

I know in a "detail" page of a report you can create a "loop". In my app I make each detail area show a ticket.
Right now my detail area fits 5 boxes- one on top of antoher.

Is it possible to make a detail area go both horizontal & verticle?
In .net webform this would like like setting a RadioGroup or TableView to repeat 2 columns wide and unlimited long.

Sample of what I'm trying to accomplish: http://img101.imageshack.us/img101/5752/10perpage.png

As you can see it loop 2 columns wide. If there's an odd number of rows the last column on the last row would be blank.
Massimiliano Bassili
Top achievements
Rank 1
 answered on 28 Apr 2011
6 answers
226 views
Hi I have a problem with Telerik Reporting or a challenge ;-)

I have a report of 3 records in a table as shown below and need to display based in value, and total up based upon value...
Field name is Fields.Amount

Description                            Debit                Credit
Product X                                120.00        
Product Y                                240.00
Payment A                                                    200.00
========================================
Totals                                    360.00            200.00
Balance                                160.00


Any help appreciated.

Desmond.
Desmond
Top achievements
Rank 1
 answered on 28 Apr 2011
3 answers
249 views

Friend I have query in Drillthrough Report I have two report Rone and Rtwo , I add report two as Drillthrough Report so when we open Rone we can go at Rtwo.
Now I want to know how I can come back again , when it open Drillthrough Report , Rtwo , how I can come back again on previous report , Rone.

I hope my question is clear.

Thanks

Steve
Telerik team
 answered on 28 Apr 2011
2 answers
228 views
I'm having a problem with Page Breaks.

I have a MasterReport which is simply an empty report that contains a standard Header, Footer that I want to use on all reports and maintain in only one location.  The master report has a subreport object on it.

I then dynamically bind reports to the subreport at run time inside of the ASPX page.

When the reports are rendered and or exported the paging isn't honored.   If I just render the sub reports directly then the paging is done correctly.

I have the subreport inside the Detail Section on the Master Report(See reportexplorer.png).  The subreport has a subreport as well.  Its report explorer is shown as well.  I've also included images of the two renderings. The correct rendering is when the subreport is bound to the viewer directly.   the incorrect rendering is when the master is bound to the viewer.

Thanks
  Marcus
Peter
Telerik team
 answered on 27 Apr 2011
9 answers
1.4K+ views

I'm wokring on an application for a client that wants some high res print media PDFs generated. I am trying to use telerik reports for this.

I have all my elements added to the report using cm so the elements will all fit correctly on the page. However when adding the images i have into picture boxes, I have them exported based on 300 dpi, and telerik reports seems to default to 96 dpi, so they do not fit in the designer. If i reduce them to 96 dpi the do fit but come of rat shit on the PDF and when printed (and yes i have read this article http://blogs.telerik.com/blogs/posts/09-01-07/the_strange_case_of_adobe_acrobat_or_why_do_images_in_telerik_reports_get_fuzzy_when_exported_to_pdf.aspx).

Can someone please tell me how to specific the pixels per inch/cm for telerik reports?

Thanks,

Joel

Massimiliano Bassili
Top achievements
Rank 1
 answered on 27 Apr 2011
3 answers
189 views
Hi,
I'm new to Telerik and Telerik Reporting. I was wondering if someone could help me out. I have some RadControls and ASP .Net controls that I need to get values from in order to pass them as parameters to a report viewer.  On the Report itself I don't have the Value property set on any parameters, the parameters in question are boolean. I get the following error:
"An error has occurred while processing the report. Processing canceled. Check the InnerException for more information.
Invalid value of report parameter 'InfoSectionVisible'.
"
Where should I put the logic for grabbing the report parameters from controls on the aspx page so that when users hit the preview button the report reflects the user's input from the controls?
Thanks!
20Below
Top achievements
Rank 1
 answered on 27 Apr 2011
1 answer
253 views
I have a report that requiers a count of users in specific roles.  I am usiing the following expression:
= IIF(Count(Fields.spendSpeakerID) = 1 ,Count(Fields.spendSpeakerID),Count(Fields.spendUserID))

If the user is a speaker the it populates with 1 which is correct however if the user is a none speaker it populates with a 1 also.

I have made two text boxes and used the following Count(Fields.spendUserID) and Count(Fields.spendSpeakerID).  The text boxes show the correct umber 1 and in this case 8.  However I cannot get the text boxes that make up the column to show the correct number of users when I use a conditional statement.

As a side note there will only be a maximum speakerID of 1 in any report.  But the number of non-speaker users will vary.

I thought about using the value of the test Textbox that gives the correct number but I found out I cannot reference that value.  Any help or suggestions?

Russ
Squall
Top achievements
Rank 1
 answered on 27 Apr 2011
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?