This is a migrated thread and some comments may be shown as answers.

Why not Margin/Width/Height available in Style?

1 Answer 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sekar
Top achievements
Rank 1
Sekar asked on 17 Apr 2009, 07:38 PM
Hi there
    I have a situation in my report. I have Charts in the report header and also has detail section that shows the tabular report. And i want to turn the chart on or off, so i created a parameter to do that. Also the chart is set with a conditional formatting to set the Layout to false if the report parameter (Show Chart) is false.
Now comes the spacing issue that initially the report header have some fixed width to accomadate Chart and report tabular headings. And while turning the chart off and previewing it, it does the job by applying the conditional format and hides the chart image but the space accomadated by the chart is still there. I checked out the source code and looks like the emitted table rows for chart has one row used for showing the chart image and other rows for styling purpose. One of that style is set to have a fixed (300px) height and thats why i have long whitespace in the header.
I also tried to set some conditional formatting in the report header (on the paramter set to false) to reduce the height / margin so that dynamically report header changes its height, but the current reporting version doesn't have any support for that.

Question 1? How do i deal with dynamically changing the height of report header on Preview click
Question 2? Is there anyway to apply a custom css class on conditional formatting or in general to any report section
Comments? It will be good if we have Margins (allowing negative values), Height and Width available in the Style window
 

1 Answer, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 21 Apr 2009, 04:33 PM
Hi Sekar,

Question 1? How do i deal with dynamically changing the height of report header on Preview click
You can use events (ItemDataBinding/ItemDataBound) and change the Width/Height of any processing item. But this can lead to unexpected result especially if the layout is more complex.

Question 2? Is there anyway to apply a custom css class on conditional formatting or in general to any report section
The reporting conditional formatting works only with styles defined in the formatting rules.
More info about report formatting can be found in the documentation - Styling Reports (for example here).

Comments? It will be good if we have Margins (allowing negative values), Height and Width available in the Style window
Reporting styles can control only the formatting (or presentation) not the layout as opposite to the css styles in html. The main purpose of the reporting engine is to represent data in many different formats. The css is applicable only to one format - html.

One possible solution to your problem is demonstrated in the attached example report. The report structure outline looks like this:

ReportHeader
    group1Header  (contains the chart)
        detail section
    group1Footer (with Visible=False)

The added group is unbound (the grouping criteria is not set). Conditional formatting is applied to the group1Header.

Please do not hesitate to contact us if this solution is not applicable for you.

All the best,
Hrisi
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Sekar
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
Share this question
or