Telerik Forums
Reporting Forum
1 answer
915 views
Hello,

I am using the latest evaluation version of Telerik Report Control. I am running into a problem where I have to get data from two different objects and then combine them into a single DataSource object. Here's my problem in detail:

1. In the code below, I have two classes A and G that get data from two different data sources. Either of them or both can be null.
2. I want my Telerik report to read both the data sources and then print the results. However, since I cannot define two different data sources to a single report, I thought of combining them into a bigger class and making that class as a DataSource to the report.
3. The class ReportData serves as a container class that holds a List of the two types of objects, A and G.
4. I then return the ReportData object from TheData class. The TheData class is defined as the ObjectDataSource for the Telerik report.
5. When I go to the designer to attach my data source fields, I am getting the intellisense and the report designer is able to detect the class hierarchy and lets me set the binding to "= Fields.a.Item.Name". However, when I try to run this report in the Preview mode, I am getting an error "An error has occured processing TextBox "textBox1". Common language runtime detected an invalid program.

I have tried quite a few options here but nothing seems to work. I cannot control how I receive the data so I need to combine the two objects somehow at my end and feed them to my Report.

Any help would be greatly appreciated.

Thanks.

   [DataObjectAttribute]
    class TheData
    {
        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public ReportData GetData()
        {
            ReportData X = new ReportData();
            X.Init();
            return X;
        }
    }

    class ReportData
    {
        public List<A> a { get; set; }
        public List<G> g { get; set; }

        public void Init()
        {
            a = new List<A>();
            g = new List<G>();
            A TheA1 = new A();
            TheA1.Name = "A1";
            A TheA2 = new A();
            TheA2.Name = "A2";
            G TheG1 = new G();
            TheG1.ID = "G1";
            G TheG2 = new G();
            TheG2.ID = "G2";
            a.Add(TheA1);
            a.Add(TheA2);
            g.Add(TheG1);
            g.Add(TheG2);
        }
    }

    public class A
    {
        public string Name { get; set; }
    }

    public class G
    {
        public string ID { get; set; }
    }
Steve
Telerik team
 answered on 28 Jul 2010
1 answer
278 views
HI,
I have .net 2010 , silverlight 4.
I try to make a demo project for using the telerik report viewer for the silver light.
I make exactly like what you write on the description and i make like
http://tv.telerik.com/watch/reporting/video/telerik-reporting-getting-started-with-silverlight-report-viewer

but i get an error which i cannot understand any thing from it.
can you please sent me a demo progect for the reporting on silverlight, (make simple report include one empty1 text box, do not make any connection to DB)


best regards.


Steve
Telerik team
 answered on 28 Jul 2010
1 answer
235 views
I've added a pictureBox to the header of my report and now I want to add a picture that is in my images folder of my website.  So for the Value field I entered "./images/letterhead.jpg" but I get the error below (I've tried variations like "/images/letterhead.jpg" and ".\images\letterhead.jpg", none of them work).  It seems like no matter what I type in for the value field it looks on the local C: drive.

An error has occured while processing PictureBox 'pictureBox1':
Could not find a part of the path 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\images\letterhead.jpg'.
Steve
Telerik team
 answered on 28 Jul 2010
1 answer
344 views

Hi,

When I'm assigning 'null' to ReportViewer.Report like
ReportViewer.Report = null;
Report will be getting as readonly mode but getting message as "The source of the report definition has not been specified".

We do not want to get the message.

Please help.

Thanks

Steve
Telerik team
 answered on 28 Jul 2010
1 answer
92 views

Hello.

Can you please tell me if it is possible (through code or wizard) to impact and design the visual layout of Silverlight Telerik Reporting Parameter fields? To set their width, layout...etc..

If there is a lot of them (and i need them) they are all by default positioned in black background, in two rows only and they are not aligned etc...It looks messy. if there is a way to "fit" them in some table or otherwise impact the look of the parameters area?

I noticed that in asp.net version parameters are spaced much more neatly out of the box so if it is possible in silverlight to achieve some control that would be really nice.

Thank you very much.

Steve
Telerik team
 answered on 28 Jul 2010
1 answer
68 views
Just though I would let you know the following produces an error everytime and the report designer sort of hangs and has to be closed and repopened.

1. Add a new panel to existing report.
2. Drag an exsting control into the panel
3. Use alt-bksp or ctrl-z to do undo
4. Receive error: Value cannot be null. Parameter name: component.
Steve
Telerik team
 answered on 28 Jul 2010
1 answer
189 views
how can i set a value to the Header of the Table?
for example i have a list<string> that contains the column header text of a datatable. and i need to set the header value to this list so it will display all column names.
i successfully created the rows in the table according to the Datatabl since i can access the body of the table(Table.body). how can i access table header and set its value?
any help?
Steve
Telerik team
 answered on 27 Jul 2010
1 answer
136 views
Hello,
we're currently using a silverlight report viewer and using this to pass a parameter :

   private void btnCarica_Click(object sender, RoutedEventArgs e)
        {
            cvContent.Content = null;
 
            Telerik.ReportViewer.Silverlight.ReportViewer report = new Telerik.ReportViewer.Silverlight.ReportViewer();
 
          //  report.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
          //  report.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
 
            report.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(report_RenderBegin);
            report.ReportServiceUri = new Uri("../WebServices/TelerikReporting.svc",UriKind.Relative);
            report.Report = "Web.Reports.Rendicontazione.ReportRendiconto,Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
             
            cvContent.Content = report;
//            wr = new WeakReference(report);
        }
 
        private void report_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
        {
            int i = 0;
            string idRapporto = tbRapporto.Text;
            DateTime data = dtPicker.SelectedDate.Value;
 
            args.ParameterValues["ProductCategory"] = "Components";
            args.ParameterValues.Add("a", "1");
        }

I've used a and ProductCategory as in your example just for test, but with no luck... inside the report the ReportParameters field has Count = 0

can you please tell me if it can be a bug of the reportviewer or if I'm missing something really stupid?' Can you provide me a sample demo?
Thanks

Paolo
Steve
Telerik team
 answered on 27 Jul 2010
1 answer
149 views
Hi,

    I'm new to the Telerik scene, and I'm having an issue with creating my first sample report using Telerik Reporting.

    I created the class for the report, and I am in the wizard for what data to get and view.....

    I'm connecting to a MySQL database, and I have the query built in the query builder... and in this query builder the desired output is attained....

    when I go to the next section, the Preview Data Source Results.... whenever I click Execute Query... I receive the following error:

                                 Number must be either non-negative and less than zero or equal to Int32.MaxValue or -1.
                                 Parameter name: dueTime

I never accessed or set anything related to that parameter... I don't even know what this issue is referring.... that's why I'm asking for help.

what do I do to resolve this?


Thanks,
    Amit
Peter
Telerik team
 answered on 27 Jul 2010
1 answer
140 views
Hello,
it's possible to specify the save path when clicking the save button? the dialogbox that appears is empty... I wish I could suggest a filename

Thanks

Paolo
Steve
Telerik team
 answered on 27 Jul 2010
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?