Telerik Forums
Reporting Forum
1 answer
179 views
Hi

I read the post at http://www.telerik.com/help/reporting/understanding-events.html to know how to retrieve the value of the data from datasource before rendering all of the parts of the report

However, no matter what i tried to set the width of my TextBoxSeg ... the FIRST row data won't be reformatted correctly
Basically i want to display something similar to this XX-XX-XXXX-XXX-XXX  . But i don't know EXACTLY how many characters for each segment. And that information only available when the data has been bounded to the textbox.
So I use the ItemDataBound event. Inside that event , I will find the length of the Data of the TextBox and set the width of the textBox corresponding to the Length.
Then i just need to move the Location of other segments correspondingly
That's the whole idea 

I also attach the image of my report result to let you see the problem of rendering
this is the code
private Unit oneUnit = new Unit(100/8);
        private Unit originalTextSeg1Width;
        private Unit originalTextSeg2Width;
        private Unit originalTextSeg3Width;
        private Unit originalTextSeg4Width;
        private Unit originalTextSeg5Width;
        private Unit originalTextDash1X;
        private Unit originalTextDash2X;
        private Unit originalTextDash3X;
        private Unit originalTextDash4X;
        
        private Unit originalTextSeg2X;
        private Unit originalTextSeg3X;
        private Unit originalTextSeg4X;
        private Unit originalTextSeg5X;
        public GLIncomeStatementDT()
        {
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
            //Original Width
            originalTextSeg1Width = textSeg1.Width;
            originalTextSeg2Width = textSeg2.Width;
            originalTextSeg3Width = textSeg3.Width;
            originalTextSeg4Width = textSeg4.Width;
            originalTextSeg5Width = textSeg5.Width;
            //Original X location
            originalTextDash1X = textDash1.Location.X;
            originalTextDash2X = textDash2.Location.X;
            originalTextDash3X = textDash3.Location.X;
            originalTextDash4X = textDash4.Location.X;
             
            originalTextSeg2X = textSeg2.Location.X;
            originalTextSeg3X = textSeg3.Location.X;
            originalTextSeg4X = textSeg4.Location.X;
            originalTextSeg5X = textSeg5.Location.X;
            //
            textSeg1.ItemDataBound += new EventHandler(textSeg1_ItemDataBound);
            textSeg2.ItemDataBound += new EventHandler(textSeg2_ItemDataBound);
            textSeg3.ItemDataBound += new EventHandler(textSeg3_ItemDataBound);
            textSeg4.ItemDataBound += new EventHandler(textSeg4_ItemDataBound);
            textSeg5.ItemDataBound += new EventHandler(textSeg5_ItemDataBound);
            this.DataSource = null;
            this.NeedDataSource += new EventHandler(FilteredReport_NeedDataSource);
             
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
 
        #region Setup Seg's Width dynamically
        
        void textSeg5_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.TextBox textSeg5Position = (Telerik.Reporting.Processing.TextBox)sender;
            textSeg5.Style.BackgroundColor = Color.Purple;
            textSeg5.Width = originalTextSeg5Width * (textSeg5Position.Text.Length);
        }
 
        void textSeg4_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.TextBox textSeg4Position = (Telerik.Reporting.Processing.TextBox)sender;
            textSeg4.Style.BackgroundColor = Color.Yellow;
            textSeg4.Width = originalTextSeg4Width * (textSeg4Position.Text.Length);
 
 
 
 
 
            textDash4.Location = new PointU() { X = originalTextDash4X + textSeg4.Width - oneUnit, Y = textDash4.Location.Y };
            textSeg5.Location = new PointU() { X = originalTextSeg5X + textSeg4.Width - oneUnit, Y = textSeg5.Location.Y };
        }
 
        void textSeg3_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.TextBox textSeg3Position = (Telerik.Reporting.Processing.TextBox)sender;
            textSeg3.Style.BackgroundColor = Color.Green;
            textSeg3.Width = originalTextSeg3Width * (textSeg3Position.Text.Length);
 
 
 
 
            textDash3.Location = new PointU() { X = originalTextDash3X + textSeg3.Width - oneUnit, Y = textDash3.Location.Y };
            textSeg4.Location = new PointU() { X = originalTextSeg4X + textSeg3.Width - oneUnit, Y = textSeg4.Location.Y };
            textDash4.Location = new PointU() { X = originalTextDash4X + textSeg3.Width - oneUnit, Y = textDash4.Location.Y };
            textSeg5.Location = new PointU() { X = originalTextSeg5X + textSeg3.Width - oneUnit, Y = textSeg5.Location.Y };
        }
 
        void textSeg2_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.TextBox textSeg2Position = (Telerik.Reporting.Processing.TextBox)sender;
            textSeg2.Style.BackgroundColor = Color.Blue;
            textSeg2.Width = originalTextSeg2Width * (textSeg2Position.Text.Length);
 
 
            textDash2.Location = new PointU() { X = originalTextDash2X + textSeg2.Width - oneUnit, Y = textDash2.Location.Y };
            textSeg3.Location = new PointU() { X = originalTextSeg3X + textSeg2.Width - oneUnit, Y = textSeg3.Location.Y };
            textDash3.Location = new PointU() { X = originalTextDash3X + textSeg2.Width - oneUnit, Y = textDash3.Location.Y };
            textSeg4.Location = new PointU() { X = originalTextSeg4X + textSeg2.Width - oneUnit, Y = textSeg4.Location.Y };
            textDash4.Location = new PointU() { X = originalTextDash4X + textSeg2.Width - oneUnit, Y = textDash4.Location.Y };
            textSeg5.Location = new PointU() { X = originalTextSeg5X + textSeg2.Width - oneUnit, Y = textSeg5.Location.Y };
        }
        void textSeg1_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.TextBox textSeg1Position = (Telerik.Reporting.Processing.TextBox)sender;
            textSeg1.Style.BackgroundColor = Color.Red;
            textSeg1.Width = originalTextSeg1Width * (textSeg1Position.Text.Length);
 
 
            textDash1.Location = new PointU() { X = originalTextDash1X + textSeg1.Width - oneUnit, Y = textDash1.Location.Y };
            textSeg2.Location = new PointU() { X = originalTextSeg2X + textSeg1.Width - oneUnit, Y = textSeg2.Location.Y };
            textDash2.Location = new PointU() { X = originalTextDash2X + textSeg1.Width - oneUnit, Y = textDash2.Location.Y };
            textSeg3.Location = new PointU() { X = originalTextSeg3X + textSeg1.Width - oneUnit, Y = textSeg3.Location.Y };
            textDash3.Location = new PointU() { X = originalTextDash3X + textSeg1.Width - oneUnit, Y = textDash3.Location.Y };
            textSeg4.Location = new PointU() { X = originalTextSeg4X + textSeg1.Width - oneUnit, Y = textSeg4.Location.Y };
            textDash4.Location = new PointU() { X = originalTextDash4X + textSeg1.Width - oneUnit, Y = textDash4.Location.Y };
            textSeg5.Location = new PointU() { X = originalTextSeg5X + textSeg1.Width - oneUnit, Y = textSeg5.Location.Y };
        }
Peter
Telerik team
 answered on 04 May 2011
4 answers
129 views
Hi
I'm new to telerel reporting.  I know telerik reports are created as .cs file and compiled with my web applications.  I would like to know if it is possible for me to create a report in some format so that I can distribute this report to users later and they can use their current web application to run the report without re-compiling the whole thing.  Can this be done with telerik reporting?
Thanks
Edwin
Zensell
Top achievements
Rank 1
 answered on 04 May 2011
1 answer
137 views
Hello, I'm trying to do a master-detail kind of report. I have tried to put my data in a crosstab, but the detail cell only shows me the first entry for every group, instead of showing a list of entries. 

I am trying to do some kind of schedule, having a row grouping on the resources and a column group on the date. Since a resource can do multiple jobs in a day, in the detail cell I would like to show a list of those jobs. 

For example: 
Data: 
Entry1:  Resource1 Day1 Activity1
Entry2:  Resource1 Day2 DayOff
Entry3:  Resource1 Day1 Activity2
Entry4:  Resource2 Day1 Activity1
Entry5:  Resource2 Day2 Activity2

Output: 
Day1 Day2
Resource1 Activity1 DayOff
Activity2
Resource2 Activity1 Activity2

I have tried multiple things, but none did exactly what I need: 
 - Create a child Detail row group on the resource group, but that doesn't work because it puts me every activity as a unique entry, like this: 
Day1 Day2
Resource1 Activity1
Activity2
DayOff
Resource2 Activity1
Activity2

 - Put a table or list in my detail cell, but I am not able to bind its data source to its parent's grouped data (ex. for Resource1, Day1). 

Has anybody ever tried to do such report? 
Can you help me? 

Thanks
Squall
Top achievements
Rank 1
 answered on 04 May 2011
1 answer
714 views
Hi,

I am looking for a way to create a bulleted list from a SQL data source on a Telerik report. When the report is exported to Word, the bulleted list will behave similarly as the bulleted list in Word.

Thank you very much for your help and support. It is much appreciated.

Guangxi Wu
gwu@critigen.com
Steve
Telerik team
 answered on 04 May 2011
3 answers
145 views
There is a Table which is hosted in a panel. I want to hide the panel when the table is empty. I can add a parameter to pass the number of rows at runtime and add rule to hide the panel. Just wondering is there a better way to do it.

Best Regards
Steve
Telerik team
 answered on 04 May 2011
2 answers
46 views
Please suggest some solution.Its an silverlight 4.0 appplication
pocha
Top achievements
Rank 1
 answered on 04 May 2011
0 answers
93 views
I know there is the limitation of vector rendering when report is converted to pdf. Just wondering, is there a way by modifing the telerik report source code to make it happen?

Best regards,

Ben Casse
Top achievements
Rank 1
 asked on 04 May 2011
3 answers
144 views
I'm trying to implement a report on hierarchical data as a drill-through -- i.e., recursively -- report returns all children of a given parent.  When one of the children is clicked that ID is passed as a parent_Id parameter) one of three parameters on the Navigate to Report action.  The other two parameters remain unchanged on drill-through).

But when I click on one of the items, the report simply returns "Please input data for all parameters".

Any reason it shouldn't work? 
Ideas? 


Hrisi
Telerik team
 answered on 03 May 2011
11 answers
1.1K+ views

Hello.

I use reporting together with entity framework.

Generally the structure is this:

1. I have a winform and there I select what kind of report I want to see, and also select data for the report.

2. I pass this data to report and refresh it.

I have a report that has some tables and lists inside. To pass data to those report elements I defined SetDS method for each report. For example:

public void SetDS(Product product)  
        {  
            EntityTools.LoadReferences(product);  
 
            foreach (WciFilling item in product.WciFilling)  
                EntityTools.LoadReferences(item);  
            foreach (WciAdditionalItem item in product.WciAdditionalItem)  
                EntityTools.LoadReferences(item);  
 
            this.DataSource = product;  
            this.lstFilling.DataSource = product.WciFilling;  
            this.tbGrid.DataSource = product.WciAdditionalItem.Where(o => o.WciAdditionalItemType.Id.Equals((int)EnWciAdditionalItemType.Grid));  
        } 

So, now I want to use one of these reports as a sub-report inside of list, and the question is how can I call SetDS for that subreport?

Or, maybe, I'm going in a wrong way, and there is a better approach?

Thanks.

Best regards,
Oleksandr

Steve
Telerik team
 answered on 03 May 2011
1 answer
45 views
Hi

Is possible to resize , in silverlight report viewer , the documentmap area ?
thx

Luciano Benetti
Solinfo srl
Steve
Telerik team
 answered on 03 May 2011
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?