Telerik Forums
Reporting Forum
2 answers
85 views
Hi

I am binding a chart at runtime to a generic list and having some difficulty with "what" gets charted.  I have an object structure like this:

    sealed public class MisPricedRegions : List<MisPricedRegion> 
    {  
    }  
 
    sealed public class MisPricedRegion  
    {  
        public string Region { get; set; }  
        public string Quarter { get; set; }  
        public int NumberConnectionPoints { get; set; }  
        public double AverageAmount { get; set; }  
    } 

I want to use this for two different charts... one where the Y axis is for NumberConnectionPoints and the other where the Y axis is for AverageAmount.

The sample code on your site here gave me an idea of what I need to do (set the Series[0].DataYColumn), but the sample code throws an error (IndexOutOfRange) as there is no series... even though the datasource has been set?

Thanks,

John

John McLean
Top achievements
Rank 1
 answered on 01 Dec 2009
1 answer
46 views
Currently we are programmatically adding values, labels to a chartseries within a Telerik Report.
For each item within the series, we would like to set the Item's MainColor and FillType.

Adding values and labels to ChartSeries
...ChartSeries cs = new Telerik.Reporting.Charting.ChartSeries();
Hashtable ht = ....;
double total = 0;
            foreach (DictionaryEntry de in ht)
                total += (double)de.Value;
            foreach (DictionaryEntry de in ht)
            {
               cs.AddItem((double)de.Value, (String)de.Key + " " + ((double)de.Value / total).ToString("P02"));
            }

The following is where we have problems. For each of the above items, we would like to set the item's color and Filltype:
 
int dcount = 0;
            foreach (DictionaryEntry de in ht)
            {
                cs.Items[dcount].Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Solid;
                cs.Items[dcount].Appearance.FillStyle.MainColor = System.Drawing.Color.FromArgb(14, 55, 147);
                dcount = +1;
            }

For some reason ,however, not all the items get the above color when rendering the report (it typically works fine for the first few items). 

Not sure how to proceed.

Steve
Telerik team
 answered on 01 Dec 2009
1 answer
175 views
Hi,

Are we able to use the Silverlight Viewer to view SSRS reports?  So does your XAML or XPS extension work in SSRS?

Or could I import SSRS reports into your reporting product?  Our reports are complex and we have data extensions that call to custom data sources?

Many thanks for your help.

Zack
Steve
Telerik team
 answered on 01 Dec 2009
1 answer
117 views
Hi,
is there any barcodes that supports Å,Ä,Ö,å,ä,ö?
Ivan
Telerik team
 answered on 01 Dec 2009
5 answers
107 views


developing a report in vstudio should i be able to preview a report if i am using needdatasource to supply the data ?



thanks
kevin
kmv
Top achievements
Rank 1
 answered on 01 Dec 2009
4 answers
173 views
Hello,
I have a scenario where I need to pass a session varable value to a report in a reportbook on a html page. I haven't been able to find any code for this in the forums or figured it out by my self.
Depending on who's logging in to my reportpages different report results will appear. I store the users id in a sessionvariable on loggin. I've found a solution for a single report but not when I want to put the report in a reportbook.

I'm thankful for any directions and/or codesamples.

Best regards

Janne
Jan
Top achievements
Rank 1
 answered on 01 Dec 2009
2 answers
84 views
There was recently a great blog on SL report viewer (btw, why was it removed?), which described a great feature of the report generator. It said, the report generator, generates XAML code on the server and then sends it to the client and that's how the client viewer displays a perfect output.

This has opened up a new idea in my head to use RADBook (another great product from SL team), in conjunction with the viewer. What I'd like to do, is to have those xaml pages render in the RADBook pages, allowing us to create and send a perfect report in a form of a book with front page.

How can we accomplish getting the xaml from report generator to RADBook, without the UI of the viewer?
Thanks!
..Ben
Ben Hayat
Top achievements
Rank 2
 answered on 30 Nov 2009
1 answer
173 views
Hi,

I'm generating a pie chart for 2 series on the one graph.  I need to label each series with its own sub heading.  The only way I could find to do this was to use overlapping textbox controls on top of the chart control. 
When I view the report in the ReportViewer, the textboxes move to the right of the chart so they no longer overlap.  I understand that this is a limitation of the html rendering in the control.  Is there a way to get this control to render an image instead? 

Many Thanks.

Tony
Steve
Telerik team
 answered on 30 Nov 2009
1 answer
1.1K+ views

There's a lot of examples centered around the WebForms reportviewer, and which use the ReportProcessor independently. But I've got some complex reports that I've extended which require programmatic manipulation to process, and it seems that there's no examples available for how to generate those through the ReportProcessor. And as I found, calling ExportReport() simply pops up the export dialog in the UI.

So here's a nice concept to have in your toolbox - it's simple, but it eluded me for a bit so I thought I'd share it.

Assuming you have a ReportViewer in a windows form (or a RadForm), and you've already rendered the report there, you can simply grab the report object from the report viewer and pass it to the ReportProcessor like this:

    private void SaveReport(string fileLocation) { 
      ReportProcessor reportProcessor = new ReportProcessor(); 
      //pass the reportViewer1's "Report" object to the RenderReport method 
      //populate the HashTable if you need to specify DeviceInfo properties, otherwise just pass an empty one like I've done here 
      RenderingResult renderingResult = reportProcessor.RenderReport("PDF", reportViewer1.Report, new Hashtable()); 
      //now just create a filestream and write the DocumentBytes array to it - flush and close, and your file is ready. 
      using (FileStream destinationFileStream = new FileStream(fileLocation, FileMode.Create, FileAccess.Write)) { 
        destinationFileStream.Write(renderingResult.DocumentBytes, 0, renderingResult.DocumentBytes.GetLength(0)); 
        destinationFileStream.Flush(); 
        destinationFileStream.Close(); 
      } 
    } 

There's a sample project attached, but that little routine is the basis of it.
Steve
Telerik team
 answered on 30 Nov 2009
2 answers
71 views
Hi there

I am dynamically adding crosstab tables and charts to a report and populating via the NeedDataSource event.  The problem I am having is setting the locations of these components.  For example I require the following:

CrossTab
Chart

Crosstab
Chart

...

So I have a table of results above the chart showing the table data.  The issue is the Crosstab height will change depending upon the amount of data, so I can't calculate and set the correct location of the chart at runtime.  I'm sure there is something simple I'm missing.  How can I get around this?

Thanks,

John
John McLean
Top achievements
Rank 1
 answered on 29 Nov 2009
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?