Hi,
I have a SQL view where one row of data is for Header section of the report and the remaining rows of data are for Details section of a report.
I have a field "RowType" in the view with values:
- "HeaderData" for row of data that goes to Header section (the view has only one such row).
- "DetailsData" for all other rows of data, which goes to Details section.
I tried adding filter to Details Group, but observed that this filters the whole report.
Also, I did not find any way to add filter to the Header Group.
My queries are:
1. On the Header section, how do I display only the data from the row containing "HeaderData" on "RowType" field?
2. On the Details section, how do I display remaining data (with "DetailsData" on "RowType" field) ?
Thanks in advance.
Sumit
I have a SQL view where one row of data is for Header section of the report and the remaining rows of data are for Details section of a report.
I have a field "RowType" in the view with values:
- "HeaderData" for row of data that goes to Header section (the view has only one such row).
- "DetailsData" for all other rows of data, which goes to Details section.
I tried adding filter to Details Group, but observed that this filters the whole report.
Also, I did not find any way to add filter to the Header Group.
My queries are:
1. On the Header section, how do I display only the data from the row containing "HeaderData" on "RowType" field?
2. On the Details section, how do I display remaining data (with "DetailsData" on "RowType" field) ?
Thanks in advance.
Sumit
7 Answers, 1 is accepted
0
Sumit
Top achievements
Rank 1
answered on 09 Sep 2011, 04:27 AM
Hi,
While I am waiting to get a reply, below is basic data on the SQL View:
RowType Desc
________ ______________
HeaderData This_record_goes_to_header_section.
DetailsData This_record_goes_to_details_section
DetailsData This_record_goes_to_details_section Awaiting reply.
Thanks
Sumit
While I am waiting to get a reply, below is basic data on the SQL View:
RowType Desc
________ ______________
HeaderData This_record_goes_to_header_section.
DetailsData This_record_goes_to_details_section
DetailsData This_record_goes_to_details_section Awaiting reply.
Thanks
Sumit
0
Hi Sumit,
You talk about "Header section of the report" but there are various header sections i.e. page header, report header, group header. According to your description you have two options:
Regards,
Steve
the Telerik team
You talk about "Header section of the report" but there are various header sections i.e. page header, report header, group header. According to your description you have two options:
- add another column to your database which would be used to group which HeaderData and DetailsData belong to one "segment". This way you can group by that field and use the HeaderData in the group header section.
- use only a single report section - the detail. The detail section is printed once for every row in the data source similarly to a repeater and the HeaderData being a first row would be displayed first and you can style it to separate it from the actual detail data.
- Report Life Cycle
- Understanding Report Structure
- Understanding Report Sections
- Understanding Report Items
Regards,
Steve
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Sumit
Top achievements
Rank 1
answered on 16 Sep 2011, 05:35 AM
Hi Steve,
Thank you for your reply.
Header section I talked about was generic one but we can take page header as our target header section for this example.
Normally, there is join between 'master' and 'details' table so that final view has just the exact number of rows that goes to details section, and will have columns with repeating data that goes to header section.
But, in this case, I have a separate row for header. The field for Header and Details section is also common one ('Desc') in this case.
I have constraint that I cannot change the view or database.
Second option given by you can be a possibility, but since common field 'Desc" is used, formatting same field differently for header and details data is not possible. Also, other functions like summing over group etc cannot be done.
I have gone through all Telerik reporting documentations but might have missed out how to do the above task.
Ideally, is there a way where I can filter data rows for Page Header and Details section individually (may be OnFormat events for these sections) ? Or any other way? Any example codes will be very helpful.
Thank you in advance.
Regards,
Sumit
Thank you for your reply.
Header section I talked about was generic one but we can take page header as our target header section for this example.
Normally, there is join between 'master' and 'details' table so that final view has just the exact number of rows that goes to details section, and will have columns with repeating data that goes to header section.
But, in this case, I have a separate row for header. The field for Header and Details section is also common one ('Desc') in this case.
I have constraint that I cannot change the view or database.
Second option given by you can be a possibility, but since common field 'Desc" is used, formatting same field differently for header and details data is not possible. Also, other functions like summing over group etc cannot be done.
I have gone through all Telerik reporting documentations but might have missed out how to do the above task.
Ideally, is there a way where I can filter data rows for Page Header and Details section individually (may be OnFormat events for these sections) ? Or any other way? Any example codes will be very helpful.
Thank you in advance.
Regards,
Sumit
0
Hi Sumit,
You should not look upon report sections differently - they are part of the report and the data that can be displayed in either section can only come from a single data source. On the other hand, page sections are processed by the corresponding rendering extension after the report data has been processed and at this moment the report data source is not available anymore. This information is available in the Understanding Report Sections help article.
Since you cannot change the database, using my second suggestion should use. You can use Conditional Formatting to style the first row only. You can see such approach in action in the Displaying data with alternating-style rows KB article.
Best wishes,
Steve
the Telerik team
You should not look upon report sections differently - they are part of the report and the data that can be displayed in either section can only come from a single data source. On the other hand, page sections are processed by the corresponding rendering extension after the report data has been processed and at this moment the report data source is not available anymore. This information is available in the Understanding Report Sections help article.
Since you cannot change the database, using my second suggestion should use. You can use Conditional Formatting to style the first row only. You can see such approach in action in the Displaying data with alternating-style rows KB article.
Best wishes,
Steve
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Sumit
Top achievements
Rank 1
answered on 22 Sep 2011, 07:33 AM
Hi Steve,
Thank you for your time.
This reporting was already done by somebody else on crystal with the same view. I have a printed copy and it is a simple invoice with -
- company code/name etc on header,
- item code/name etc on details,
- with view is like i described earlier- a row for header entry and other rows for details entry - with a rowtype field.
Conditional formatting can change colors, fonts, etc. But what I was looking for was differently sized / positioned text boxes with different labels on the header and normal tabular view on the details.
1. Only option I could think of, and feared that this is a clumsy way of getting results was to - design sub reports for header section and details section.
2. Could this be done by defining data source on each field of header section (SELECT Desc FROM TheView WHERE RowType Like 'HeaderData') or something similar?
Awaiting for your feedback.
An early response will be much appreciated.
Thank you.
Regards,
Sumit
Thank you for your time.
This reporting was already done by somebody else on crystal with the same view. I have a printed copy and it is a simple invoice with -
- company code/name etc on header,
- item code/name etc on details,
- with view is like i described earlier- a row for header entry and other rows for details entry - with a rowtype field.
Conditional formatting can change colors, fonts, etc. But what I was looking for was differently sized / positioned text boxes with different labels on the header and normal tabular view on the details.
1. Only option I could think of, and feared that this is a clumsy way of getting results was to - design sub reports for header section and details section.
2. Could this be done by defining data source on each field of header section (SELECT Desc FROM TheView WHERE RowType Like 'HeaderData') or something similar?
Awaiting for your feedback.
An early response will be much appreciated.
Thank you.
Regards,
Sumit
0
Hi Sumit,
The SubReport item is a container item and it holds reports i.e. you are still bound to the same approaches to create this layout with this data in a report independently of whether you would be using it as subreport or not.
Setting a TextBox size dynamically based on value length you can calculate the desired size and set it within a Binding.
Kind regards,
Steve
the Telerik team
The SubReport item is a container item and it holds reports i.e. you are still bound to the same approaches to create this layout with this data in a report independently of whether you would be using it as subreport or not.
Setting a TextBox size dynamically based on value length you can calculate the desired size and set it within a Binding.
Property path | Expression |
Size | =CalculateSize(ReportItem) |
To calculate the size you can use an User Function
Copy Code
public
static
SizeU CalculateSize(Telerik.Reporting.Processing.TextBox textBox)
{
int
len = textBox.DataObject[
"Name"
].ToString().Length;
float
width = textBox.Size.Width.Value;
double
size = ((width) / len * 3) + 6;
//this is pseudo calculation
return
new
Telerik.Reporting.Drawing.SizeU(
new
Telerik.Reporting.Drawing.Unit(size, Telerik.Reporting.Drawing.UnitType.Cm),
new
Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm));
}
Kind regards,
Steve
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Sumit
Top achievements
Rank 1
answered on 24 Nov 2011, 12:32 AM
Hi,
Just to share, I worked around it by:
1. Adding a group with grouping on RowType.
2. Added two more groups under it without any grouping (for HeaderData and RowData) and added respective fields (details section is not used and is set to invisible for this particular case).
3. Set the conditional formatting for the two groups (group not visible based on RowType entries).
Thanks.
Sumit
Just to share, I worked around it by:
1. Adding a group with grouping on RowType.
2. Added two more groups under it without any grouping (for HeaderData and RowData) and added respective fields (details section is not used and is set to invisible for this particular case).
3. Set the conditional formatting for the two groups (group not visible based on RowType entries).
Thanks.
Sumit