Telerik Forums
Reporting Forum
1 answer
682 views
I wanted to share my experiences with the crosstab and pivottable features of Telerik Reporting as it took me a significant amount of time to develop and I hope this will help someone else reduce their time.

I have some values I want pivoted from a schedule and printed appropriately. Since we work schedule by days instead of hours this is slightly different than what most people would do but I believe you could use this example to duplicate.

I had a table output like this:

installdate (date), locationname, team_neam, techname, technumber, ma, installerStatus (number)

I wanted to pivot on the installdate and create dynamic columns across the page and open a new page only after grouping by week.

So my output would look like:

Team Name (grouped), TechName, Tech #, MA, dynamic columns based on date range grouped by week number, then sub-grouped (though each resulted in a single record) by date and day of week.

So first I created a blank report, with header, footer, and detail section. I set up the header section with a logo, and an htmltextbox, in the codebehind I grab the first row of my output and get the locname from there to fill in the htmlbox, and get the month name from a passing variable to initiate the report. So my top has a logo and "xxx Location  |  August Schedule". My footer has a legend a single textbox with lightgreenbackground and black text that says working, another textbox with red background and black text that says off and a page # cue. I set the pagenumber by dropping a textbox in the bottom right, set the textalign to right, aligned it with the end of my header row and put this value in it: 

='Page ' + PageNumber + ' of ' + PageCount

Then comes the fun/confusing part. I've had some difficulty with the crosstab portion of the designer so after some trial and error I started copying the files (.cs, designer, and resource file) to a safe spot before every change. If the change failed I copied them back.
I created a dataset with the fields I want, used the crosstab wizard to create a basic report with only team name on the row group, installdate on the column group, and sum of installerstatus on the detail group.

I then finished the wizard and added some code to the codebehind to fill the dataset. I also added some user functions under to clean up my data (and get week number of year etc) Put these at the bottom of your class, but inside. You must rebuild your project to get access to them in the designer.

        public static int Week(DateTime date)  
        {  
            System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("en-US");  
            return myCI.Calendar.GetWeekOfYear(date, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Sunday);  
        }  
 
        public static string ShortDate(DateTime shortDate)  
        {  
            return shortDate.ToString("MM-dd");  
        }  
 
        public static string ShortDay(DateTime shortDate)  
        {  
            return shortDate.ToString("ddd");  
        } 

Then I change back to designer view and right click on the teamname group in the area and added a child group for each column. Very Important: Add a child group to team name, do not add a child group and try to add another child group to that group! Then I added a child group to installdate, and another child group to installdate for my date, and dayofweek column/rows. Then right click on the first column group I created and set the group expression and value expression using the previous examples (see ProductSalesbyYear/QTR) (right click on it and choose properties, set Expression, click expression, choose user functions, select the one you want, then fields, and click the field you want). I set the sort on these to be the installdate field itself (not the user function!). I also changed the groupbyexpression for my prebuilt column of installdate for the Week # using userfunction. I had to merge some cells, and manually type my header names above each one in the corner tab but that was easy enough. I also set the team name field, and it's rowgroup field to vertical 90 degree angle.

Hope this help someone else, if you have any question let me know I would be glad to help.
Vassil Petev
Telerik team
 answered on 02 Sep 2009
1 answer
100 views
I installed the Reporting msi file but when I launch my VS 80 Prof., I don't see Report Wizards for me to design the report.  can someone help?

Thanks
Svetoslav
Telerik team
 answered on 02 Sep 2009
3 answers
210 views
Hi!

I'm trying to create your invoice demo example using datasets but I cannot get it to work.
Does parameters and filters work for datasets?

I have a dataset called "dsInvoiceInformation" containing two tables "Header" and "Rows"
In my master report, I have set the datasource to "dsInvoiceInformation" and datamember to "Header".
When I generate my reports, the header information is shown without problem, but how do I bind my "Rows" table to the SubReport datasource/datamember and how do I get it to filter out the rows belonging to the right invoice (from the "Rows" table)?

Regards
Per
Milen | Product Manager @DX
Telerik team
 answered on 02 Sep 2009
7 answers
567 views
Before I download the beta, I was wondering if telerik reporting is going to support using RDLC report templates?

We've developed some in Visual Studio 2005 for use with the webform reportViewer control, and would like to avoid having to rebuild those.  Plus we have some customers that are building their own in Visual Web Dev Express.

Chavdar
Telerik team
 answered on 02 Sep 2009
1 answer
93 views
Hello,
I've got a row from database of type [String] [Double], I want to set the Y value to the string and showing "Classe1", "Classe" ... so I also need to disable the autostep property ...how can I do that since for the Y value I've got a double?
Can I?

Thanks
Paolo
Giuseppe
Telerik team
 answered on 02 Sep 2009
1 answer
126 views
hi,

is it possible to catch a change-event of the parameter-combobox? mhm, when i have a report opened with web report-viewer, i have two parameter comboboxes and now i change the first and the second could only be load by the data of the first.

any ideas??

greetz
Milen | Product Manager @DX
Telerik team
 answered on 02 Sep 2009
1 answer
411 views
Hi Telerik,
I have the following "challenge":
In a Crosstab I get the following Columns "r1, r2, r3, r4, r5, r6" with the Values "v1-v6". But I need only the Columns "r2, r3, r5" with their values. How can I filter this Columns out?
In other words: It exists "fields.first()" and "fields.last()". How I get a "fields.inbetween()"?

Thanks for answering,
Res
Svetoslav
Telerik team
 answered on 02 Sep 2009
1 answer
118 views
I'm using a ReportViewer in a SL3 application, identical to the TelerikTV tutorial, except that I'm placing the report in a RadWindow modal window that is resizeable by the user.  In the ASPX file, I am able to set the width to 100%, but the Height cannot seem to be set to 100% in the ReportViewer.  The issue is that I'm not able to get the vertical scrolling correct for the report in the RadWindow.  I'm using the HtmlPlaceholder to house the report.  The horizontal scrolling works great.  It's the vertical scrolling that I can't get to work correctly.
Chavdar
Telerik team
 answered on 02 Sep 2009
2 answers
160 views
hi,

i have a problem with the web report viewer. when i have too much parameters, the area where the parameters listed, doesn't change their height... so scrollbars appears and it looks really nasty

error pic

is there a chance to resize this content area, when there are more parameters??

sorry for my english ;)

greetz

Farouk
Top achievements
Rank 1
 answered on 02 Sep 2009
12 answers
487 views
Just upgraded to Q1 2009 trying to compile my web application I am getting this error message.
'Telerik.Reporting.IReportDocument' does not contain a definition for 'DataSource' and no extension method 'DataSource' accepting a first argument of type 'Telerik.Reporting.IReportDocument' could be found (are you missing a using directive or an assembly reference?)

I looked through the documentation and can't find an answer to this simple question:
How do I set the DataSource of the Report at run-time through code?
I used to use the ReportViewer1.Report.DataSource but it seems DataSource is no longer there. Please help.

Nate
Chavdar
Telerik team
 answered on 02 Sep 2009
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?