Showing posts with label body. Show all posts
Showing posts with label body. Show all posts

Sunday, March 11, 2012

Custom Paper Size

My body width is set to 10. My left and right margins are set to 0.5in. And my page width and height are set to 11in and 8.5in, respectively.

So in essence, I want to print my reports on Letter in Landscape mode.

Yet when I go to print the report and look at the properties, it shows as 215.9 x 279.4 mm Custom paper.

Any ideas?

Thanks.

May have found something. Even though my report is set to 11x8.5 with 0.5 margins (giving me 10in to work with), I found my header, body, and footer set to 10.0000001.

It seems that using snap to grid and the ruler for sizing and positioning add a infinitesmal value which throws off paper selection.

Friday, February 17, 2012

Custom assembly call in footer looses property values.

Custom assembly call in footer looses property values.
I have a custom assembly that uses a method in the body to pass in a data
field. When I fetch the data in the body I get my data back. When I do the
same in the footer I don't get any data. I have an active call in with
Microsoft so will also post there. I thought
we had working code, I was declaring the module scoped variable as static,
but that ends up with other peoples data on occassion when several people
are running reports. MS Support told me don't use static variables, but if
I don't then I can't access my properties in the footer.
I built a sample report and custom assembly to try to figure this out.
In the report I have something like this:
Body:
=Code.DataInFooter_NonStatic.ExpSet_MyData(First(Fields!LoginID.Value))
=Code.DataInFooter_NonStatic.MyData()
Footer:
=Code.DataInFooter_NonStatic.MyData()
What is displayed:
Body:
expected value
Footer:
empty and this is the problem.
Is it an execution order issue?
Here's my sample code:
using System;
using System.Collections.Generic;
using System.Text;
namespace DataInFooter_NonStatic
{
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
Unrestricted = true)]
public class DataInFooter_NonStatic
{
private string _MyData;
public string MyData
{
get
{
return _MyData;
}
set
{
_MyData = MyData;
}
}
public void WriteToFile(string Input)
{
//throw new System.NotImplementedException();
}
public string ExpSet_MyData(string Input)
{
_MyData = Input;
return _MyData;
}
}
}
Steve MunLeeuwDo this instead in your footer:
for the field that is displaying originally the
"=code.DataInFooter_NonStatic.MyData()" have it point to the
ReportItems!<name of control in body>.Value i.e. ReportItems!TextBox17.Value
(where textbox 17 in the body contains your call to
"=Code.DataInFooter_NonStatic.MyData()"
=-Chris
"Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
news:Opk5KuF9GHA.5092@.TK2MSFTNGP04.phx.gbl...
> Custom assembly call in footer looses property values.
> I have a custom assembly that uses a method in the body to pass in a data
> field. When I fetch the data in the body I get my data back. When I do
> the
> same in the footer I don't get any data. I have an active call in with
> Microsoft so will also post there. I thought
> we had working code, I was declaring the module scoped variable as static,
> but that ends up with other peoples data on occassion when several people
> are running reports. MS Support told me don't use static variables, but
> if I don't then I can't access my properties in the footer.
> I built a sample report and custom assembly to try to figure this out.
> In the report I have something like this:
> Body:
> =Code.DataInFooter_NonStatic.ExpSet_MyData(First(Fields!LoginID.Value))
> =Code.DataInFooter_NonStatic.MyData()
> Footer:
> =Code.DataInFooter_NonStatic.MyData()
> What is displayed:
> Body:
> expected value
> Footer:
> empty and this is the problem.
> Is it an execution order issue?
> Here's my sample code:
> using System;
> using System.Collections.Generic;
> using System.Text;
> namespace DataInFooter_NonStatic
> {
> [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
> Unrestricted = true)]
> public class DataInFooter_NonStatic
> {
> private string _MyData;
> public string MyData
> {
> get
> {
> return _MyData;
> }
> set
> {
> _MyData = MyData;
> }
> }
> public void WriteToFile(string Input)
> {
> //throw new System.NotImplementedException();
> }
> public string ExpSet_MyData(string Input)
> {
> _MyData = Input;
> return _MyData;
> }
> }
> }
> Steve MunLeeuw
>|||Ok, thanks I will try that.
I think this causes and exception when you try to access the ReportItems
collection in a footer when the page doesn't have any data fields. For
example if you have a page in the middle of the report that has static text
in a textbox that spans a full page then there are no data rows in the page
and accessing the ReportItems causes the report to fail. Either that or the
ReportItem!MyHiddenFooterData.Value would not show up for that page in
PDF...or something like that. I'll try and experiment around.
Steve MunLeeuw
"Chris Conner" <Chris.Conner@.NOSPAMPolarisLibrary.com> wrote in message
news:u7HPquG9GHA.1492@.TK2MSFTNGP02.phx.gbl...
> Do this instead in your footer:
> for the field that is displaying originally the
> "=code.DataInFooter_NonStatic.MyData()" have it point to the
> ReportItems!<name of control in body>.Value i.e.
> ReportItems!TextBox17.Value (where textbox 17 in the body contains your
> call to "=Code.DataInFooter_NonStatic.MyData()"
> =-Chris
> "Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
> news:Opk5KuF9GHA.5092@.TK2MSFTNGP04.phx.gbl...
>> Custom assembly call in footer looses property values.
>> I have a custom assembly that uses a method in the body to pass in a data
>> field. When I fetch the data in the body I get my data back. When I do
>> the
>> same in the footer I don't get any data. I have an active call in with
>> Microsoft so will also post there. I thought
>> we had working code, I was declaring the module scoped variable as
>> static,
>> but that ends up with other peoples data on occassion when several people
>> are running reports. MS Support told me don't use static variables, but
>> if I don't then I can't access my properties in the footer.
>> I built a sample report and custom assembly to try to figure this out.
>> In the report I have something like this:
>> Body:
>> =Code.DataInFooter_NonStatic.ExpSet_MyData(First(Fields!LoginID.Value))
>> =Code.DataInFooter_NonStatic.MyData()
>> Footer:
>> =Code.DataInFooter_NonStatic.MyData()
>> What is displayed:
>> Body:
>> expected value
>> Footer:
>> empty and this is the problem.
>> Is it an execution order issue?
>> Here's my sample code:
>> using System;
>> using System.Collections.Generic;
>> using System.Text;
>> namespace DataInFooter_NonStatic
>> {
>> [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
>> Unrestricted = true)]
>> public class DataInFooter_NonStatic
>> {
>> private string _MyData;
>> public string MyData
>> {
>> get
>> {
>> return _MyData;
>> }
>> set
>> {
>> _MyData = MyData;
>> }
>> }
>> public void WriteToFile(string Input)
>> {
>> //throw new System.NotImplementedException();
>> }
>> public string ExpSet_MyData(string Input)
>> {
>> _MyData = Input;
>> return _MyData;
>> }
>> }
>> }
>> Steve MunLeeuw
>|||Turns out the custom assembly gets loaded once in the body, then again in
the footer, that's why they don't share data so well.
Steve MunLeeuw
"Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
news:Opk5KuF9GHA.5092@.TK2MSFTNGP04.phx.gbl...
> Custom assembly call in footer looses property values.
> I have a custom assembly that uses a method in the body to pass in a data
> field. When I fetch the data in the body I get my data back. When I do
> the
> same in the footer I don't get any data. I have an active call in with
> Microsoft so will also post there. I thought
> we had working code, I was declaring the module scoped variable as static,
> but that ends up with other peoples data on occassion when several people
> are running reports. MS Support told me don't use static variables, but
> if I don't then I can't access my properties in the footer.
> I built a sample report and custom assembly to try to figure this out.
> In the report I have something like this:
> Body:
> =Code.DataInFooter_NonStatic.ExpSet_MyData(First(Fields!LoginID.Value))
> =Code.DataInFooter_NonStatic.MyData()
> Footer:
> =Code.DataInFooter_NonStatic.MyData()
> What is displayed:
> Body:
> expected value
> Footer:
> empty and this is the problem.
> Is it an execution order issue?
> Here's my sample code:
> using System;
> using System.Collections.Generic;
> using System.Text;
> namespace DataInFooter_NonStatic
> {
> [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
> Unrestricted = true)]
> public class DataInFooter_NonStatic
> {
> private string _MyData;
> public string MyData
> {
> get
> {
> return _MyData;
> }
> set
> {
> _MyData = MyData;
> }
> }
> public void WriteToFile(string Input)
> {
> //throw new System.NotImplementedException();
> }
> public string ExpSet_MyData(string Input)
> {
> _MyData = Input;
> return _MyData;
> }
> }
> }
> Steve MunLeeuw
>|||Here's some sample code of a custom assembly that shows the instance is not
shared between the body of the report and the footer.
http://smunson.blogspot.com/2006/10/rs-custom-assembly-instance-gets-re.html
Steve MunLeeuw
"Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
news:Opk5KuF9GHA.5092@.TK2MSFTNGP04.phx.gbl...
> Custom assembly call in footer looses property values.
> I have a custom assembly that uses a method in the body to pass in a data
> field. When I fetch the data in the body I get my data back. When I do
> the
> same in the footer I don't get any data. I have an active call in with
> Microsoft so will also post there. I thought
> we had working code, I was declaring the module scoped variable as static,
> but that ends up with other peoples data on occassion when several people
> are running reports. MS Support told me don't use static variables, but
> if I don't then I can't access my properties in the footer.
> I built a sample report and custom assembly to try to figure this out.
> In the report I have something like this:
> Body:
> =Code.DataInFooter_NonStatic.ExpSet_MyData(First(Fields!LoginID.Value))
> =Code.DataInFooter_NonStatic.MyData()
> Footer:
> =Code.DataInFooter_NonStatic.MyData()
> What is displayed:
> Body:
> expected value
> Footer:
> empty and this is the problem.
> Is it an execution order issue?
> Here's my sample code:
> using System;
> using System.Collections.Generic;
> using System.Text;
> namespace DataInFooter_NonStatic
> {
> [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
> Unrestricted = true)]
> public class DataInFooter_NonStatic
> {
> private string _MyData;
> public string MyData
> {
> get
> {
> return _MyData;
> }
> set
> {
> _MyData = MyData;
> }
> }
> public void WriteToFile(string Input)
> {
> //throw new System.NotImplementedException();
> }
> public string ExpSet_MyData(string Input)
> {
> _MyData = Input;
> return _MyData;
> }
> }
> }
> Steve MunLeeuw
>