Monday, March 19, 2012

BODY not getting assigned BackgroundColor and BODY does not have CanShrink property: REPOS

I have simplified the problem I am having down by creating an empty report
with and Page Header, Body and PageFooter. I have set the BackgroundColor
of all three to "White".
I am using VS.NET to design the Report and ASP.NET with C# to call the
Reporting Services web service Render method using HTML4.0 format to render
the report inline on my web page with a blue background.
The css (a1_s) for the Body does not a Background color as seen below in the
Supporting Examples:
The bigger problem is that I have a Table in the Body. Both do not have a
CanGrow or CanShrink property, at least exposed in VS.NET. The Table is the
only thing in the Body. The Table has a Header, Group, Detail and Footer.
If the report returns no detail, I see the Table Header and the Table
Footer. It knew to collapse/shrink the Group and Detail sections but did
not shrink the Table and/or the Body. Under the Table Footer and before the
Page Footer is a gap which is the transparent area.
The Lame workarounds I have found so far are:
- reduce the Height of the Body and the Table to the smallest allowed by the
VS.NET, but during design you have to increase it and not forget to decrease
it when you are done
- put the Table in a rectangle with a "White" BackgroundColor but there is
still a big gap between the Table Footer and Page Footer
Supporting Examples:
The RDL is:
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<PageHeader>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
<Height>0.25in</Height>
</PageHeader>
<RightMargin>1in</RightMargin>
<Body>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
<Height>2in</Height>
</Body>
<TopMargin>1in</TopMargin>
<Width>6.5in</Width>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>89d2899d-7bc6-4d9d-b3f5-1bee26df10a3</rd:ReportID>
<PageFooter>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
<Height>0.25in</Height>
</PageFooter>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>
The CSS snippet is:
.a1_s{HEIGHT:50.80mm;overflow:hidden;WIDTH:165.10mm}
.a3{border:1pt None
Black;background-color:White;background-repeat:Repeat;padding-left:0pt;paddi
ng-top:0pt;padding-right:0pt;padding-bottom:0pt;HEIGHT:6.35mm;overflow:hidde
n;WIDTH:100%}
.a5{border:1pt None
Black;background-color:White;background-repeat:Repeat;padding-left:0pt;paddi
ng-top:0pt;padding-right:0pt;padding-bottom:0pt;HEIGHT:6.35mm;overflow:hidde
n;WIDTH:100%}
The generated HTML for the report is
<div id="oReportDiv" onresize="javascript:OnResizeDiv()" style="OVERFLOW:
auto; WIDTH: 100%; HEIGHT: 100%">
<table cellpadding="0" cellspacing="0">
<tr>
<td id="oReportCell" style="PADDING: 10px">
<DIV class="a3"> </DIV>
<DIV class="a1_s"> </DIV>
<DIV class="a5"> </DIV>
<script language="javascript" type="text/javascript">
<!--
var docMapIds = [];
//-->
</script>
</td><td style="WIDTH: 100%; HEIGHT: 0px"></td>
</tr><tr>
<td style="WIDTH: 0px; HEIGHT: 100%"></td>
</tr>
</table>
</div>Hi Douglas,
I am looking into this issue, I will keep you updated as soon as I find
there is anything useful to add :)
Thank you for your patience and corporation.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Douglas,
From your descriptions, I understood that you are not able to generate
html as you expected when using Render method called from web service. If I
have misunderstood your concern, please feel free to point it out.
BODY do not has CanShrink property, but I am not sure why you are not able
to assign BackgoundColor property? Is it possible for you to assign the
BackgoundColor in the Report Designer?
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Michael,
I am able to assign BackgroundColor in the Report Designer as confirmed by
the RDL I supplied in my first post.
The class generated for the Body ("a1_s") does not have a background-color
where as the Header ("a3") and Footer("a5") do have it. This can also be
seen by the Style Sheet and HTML provided in my first post.
Why doesn't a background-color get generated for the Body?
Doug
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:CzW6x8ENFHA.2900@.TK2MSFTNGXA03.phx.gbl...
> Hi Douglas,
> From your descriptions, I understood that you are not able to generate
> html as you expected when using Render method called from web service. If
I
> have misunderstood your concern, please feel free to point it out.
> BODY do not has CanShrink property, but I am not sure why you are not able
> to assign BackgoundColor property? Is it possible for you to assign the
> BackgoundColor in the Report Designer?
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no
rights.
>|||Hi Doug,
You may also manually write the code to change the background of HTML code
after calling Web service render method as workaround for your scenario.
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Michael,
So, is this a known issue?
If so, might it be corrected in SP2?
With the workaround you suggested, since I have one container for all
reports, a User Control, I would have to query the report to see what color
to change it to.
The only way I have found to query the report is to call the
GetReportDefinition Method of the ReportingService Class and then parse the
.rdl.
Is there an easier way?
Thanks,
Doug
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:nacubipNFHA.2720@.TK2MSFTNGXA03.phx.gbl...
> Hi Doug,
> You may also manually write the code to change the background of HTML code
> after calling Web service render method as workaround for your scenario.
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no
rights.
>|||Hi Douglas,
Thanks for your kindly patience:)
Yes, I am sorry to say that this is currently by design feature of
Reporting Services now.
If the body of the report does not have a border, the background color is
taken to be the background color for the entire page, not just the body. As
a result, it is placed on the <BODY> element rather than in the CSS for the
<DIV> corresponding to the body of the report.
I don't think SP2 will fix this.
Thanks again for your patience and corporation. If you have any questions
or concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Michael,
I tested your findings and setting the BODY border color to white and solid
is the best workaround so far and much more manageable.
Thanks,
Doug
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:9sYecjlOFHA.3136@.TK2MSFTNGXA01.phx.gbl...
> Hi Douglas,
> Thanks for your kindly patience:)
> Yes, I am sorry to say that this is currently by design feature of
> Reporting Services now.
> If the body of the report does not have a border, the background color is
> taken to be the background color for the entire page, not just the body.
As
> a result, it is placed on the <BODY> element rather than in the CSS for
the
> <DIV> corresponding to the body of the report.
> I don't think SP2 will fix this.
> Thanks again for your patience and corporation. If you have any questions
> or concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no
rights.
>|||Hi Doug,
Thanks for your understanding:) If you have any questions or concerns next
time, don't hesitate to let me know. We are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment