Showing posts with label report. Show all posts
Showing posts with label report. Show all posts

Monday, March 19, 2012

Collapsing columns in table mode, part II

I figured out how to collapse a column, but the report generator is maintaining the space that the collapsed columns occupied even when the columns are hidden. For me, it's valuable for space optimization to have all remaining columns to the right "move over" to be flush against the other visible columns. Can this be done?Is this possible?|||

What you explain as your goal is the behavior I see in RS 2005. If I assign a Toggle Item to a table column, columns to the right of it move left when the column is hidden.

Are you sure you're assigning the Toggle Item to the Table Column instead of the individual table cells within the column?

-Chris

|||Hi Chris, thanks for hte response. I tried what you suggest, and that is select an entire column and assign a textbox to control the visibility, but whenever I did that, I get the following error:

"The definition of the report '/ForecastReport' is invalid. The table 'table1' has 'textbox37' as a toggle item. Toggle items must be text boxes that share the same scope as the hidden item or are in a scope that contains the hidden item, and caonnot be contained within the current report item unless current grouping scope has a Parent"

One interesting thing about this error that I just noticed is, in the report designer, I have tripled checked to make sure I've got the desired COLUMN selected, not 'table1'.|||Perhaps more telling, when I select an entire column in the designer and then go to the "visibility" section, the "ToggleItem" drop down is completely empty of available choices.|||

Did you ever found a solution to this. I do have the same problem.

yours sincerely
Johan

Collapsing columns in table mode, part II

I figured out how to collapse a column, but the report generator is maintaining the space that the collapsed columns occupied even when the columns are hidden. For me, it's valuable for space optimization to have all remaining columns to the right "move over" to be flush against the other visible columns. Can this be done?Is this possible?|||

What you explain as your goal is the behavior I see in RS 2005. If I assign a Toggle Item to a table column, columns to the right of it move left when the column is hidden.

Are you sure you're assigning the Toggle Item to the Table Column instead of the individual table cells within the column?

-Chris

|||Hi Chris, thanks for hte response. I tried what you suggest, and that is select an entire column and assign a textbox to control the visibility, but whenever I did that, I get the following error:

"The definition of the report '/ForecastReport' is invalid. The table 'table1' has 'textbox37' as a toggle item. Toggle items must be text boxes that share the same scope as the hidden item or are in a scope that contains the hidden item, and caonnot be contained within the current report item unless current grouping scope has a Parent"

One interesting thing about this error that I just noticed is, in the report designer, I have tripled checked to make sure I've got the desired COLUMN selected, not 'table1'.|||Perhaps more telling, when I select an entire column in the designer and then go to the "visibility" section, the "ToggleItem" drop down is completely empty of available choices.|||

Did you ever found a solution to this. I do have the same problem.

yours sincerely
Johan

Collapsing blank lines in Reporting Services

Is there a way to collapse blank lines in Reporting Services? I have a
report where I stack contact information -- address, phone, email -- and some
records don't have one or another of these items. Rather than leaving blank
lines in between data, makin the report difficult to read, I would like to
collapse those lines and get rid of them. Is this possible? Using the
shrink/expand to fit data doesn't work.What's the container that the rows are in?
If you remove the space between the containers (textboxes?), that may be
what you are looking for. If not, you may need to go to a matrix or table.
"HHoward" <HHoward@.discussions.microsoft.com> wrote in message
news:6098B06F-686D-4EB1-ACC3-1D7B5F7BF08F@.microsoft.com...
> Is there a way to collapse blank lines in Reporting Services? I have a
> report where I stack contact information -- address, phone, email -- and
> some
> records don't have one or another of these items. Rather than leaving
> blank
> lines in between data, makin the report difficult to read, I would like to
> collapse those lines and get rid of them. Is this possible? Using the
> shrink/expand to fit data doesn't work.|||If the information is in a table and you have the value in a text box you can
click the left end of the line and in the visibility hidden you can put
=iif(len(Fields!Address.value)>0, false, true) Or you can just put a
condition on your data (iif(len(Fields!Address1.value)>0,
Fields!Address1.value & vbcrlf & Fields!Address2.value,"") Hope that makes
sense.
"HHoward" wrote:
> Is there a way to collapse blank lines in Reporting Services? I have a
> report where I stack contact information -- address, phone, email -- and some
> records don't have one or another of these items. Rather than leaving blank
> lines in between data, makin the report difficult to read, I would like to
> collapse those lines and get rid of them. Is this possible? Using the
> shrink/expand to fit data doesn't work.|||Great tip -- worked like a charm. Thanks so much!
"KimB" wrote:
> If the information is in a table and you have the value in a text box you can
> click the left end of the line and in the visibility hidden you can put
> =iif(len(Fields!Address.value)>0, false, true) Or you can just put a
> condition on your data (iif(len(Fields!Address1.value)>0,
> Fields!Address1.value & vbcrlf & Fields!Address2.value,"") Hope that makes
> sense.
> "HHoward" wrote:
> > Is there a way to collapse blank lines in Reporting Services? I have a
> > report where I stack contact information -- address, phone, email -- and some
> > records don't have one or another of these items. Rather than leaving blank
> > lines in between data, makin the report difficult to read, I would like to
> > collapse those lines and get rid of them. Is this possible? Using the
> > shrink/expand to fit data doesn't work.|||I'm glad that it worked for you!
"HHoward" wrote:
> Great tip -- worked like a charm. Thanks so much!
> "KimB" wrote:
> > If the information is in a table and you have the value in a text box you can
> > click the left end of the line and in the visibility hidden you can put
> > =iif(len(Fields!Address.value)>0, false, true) Or you can just put a
> > condition on your data (iif(len(Fields!Address1.value)>0,
> > Fields!Address1.value & vbcrlf & Fields!Address2.value,"") Hope that makes
> > sense.
> >
> > "HHoward" wrote:
> >
> > > Is there a way to collapse blank lines in Reporting Services? I have a
> > > report where I stack contact information -- address, phone, email -- and some
> > > records don't have one or another of these items. Rather than leaving blank
> > > lines in between data, makin the report difficult to read, I would like to
> > > collapse those lines and get rid of them. Is this possible? Using the
> > > shrink/expand to fit data doesn't work.

Collapse the parameters when I click view report

Hi, I am using RS 2005.
I have around 25-30 parameters which cover almost the whole screen, so
when I click on View Report, is it possible to automatically collapse
the parameters part of the window?
Thanks
AnupHi guys,
It's urgent, I am stuck at this and our requirement is when the view
report is clicked or when the report is displayed for the first time,
the parameters part of the report should be automatically collapse?
Thanks
Anup
Anup wrote:
> Hi, I am using RS 2005.
> I have around 25-30 parameters which cover almost the whole screen, so
> when I click on View Report, is it possible to automatically collapse
> the parameters part of the window?
> Thanks
> Anup|||If you are getting to the report via an href add:
&rc:Parameters=False
to the query string
Chris E
"Anup" <anupkm@.gmail.com> wrote in message
news:1166115447.858873.68660@.t46g2000cwa.googlegroups.com...
> Hi guys,
> It's urgent, I am stuck at this and our requirement is when the view
> report is clicked or when the report is displayed for the first time,
> the parameters part of the report should be automatically collapse?
> Thanks
> Anup
> Anup wrote:
>> Hi, I am using RS 2005.
>> I have around 25-30 parameters which cover almost the whole screen, so
>> when I click on View Report, is it possible to automatically collapse
>> the parameters part of the window?
>> Thanks
>> Anup
>

collapse or hide Report Manager header bar

Is there a way to automatically collapse or hide the Report Manager header
bar, the one with SQL Server Reporting Services > Home on it?
StephanieOn May 3, 9:28 am, Stephanie <Stepha...@.discussions.microsoft.com>
wrote:
> Is there a way to automatically collapse or hide the Report Manager header
> bar, the one with SQL Server Reporting Services > Home on it?
> Stephanie
As far as I know, there is not. The only thing I can think of is to
create a custom application w/a report viewer control. Sorry I
couldn't be of greater assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Collapse all details in SSRS 2005 report?

Hello,

I have a report that contains a single group for customers. Each customer order is placed as a detail record under the group. I have the group header setup to toggle the detail records (so if a user clicks the plus sign image, the details are shown, if the user clicks the minus image, the details are hidden). By default when the report opens up the details are shown.

Rather than having the user click through each customer row to collapse all the details, is it possible to place a "collapse all" image or control somewhere on the report that will handle the collapsing of all the detail rows for each customer record? I assume if there is a way, there is something similar for expanding all as well?

Thanks!

The "initial state" of toggles on groups can be determined by expressions. You could add e.g. a boolean report parameter and then set the initial toggle state of all toggles to be based on the report parameter value.

-- Robert

collapse all

Hello,

I have a table in the report.

the table contain group and details

the details are hide by default and the groups have a toggled to collapse the details

so in order to see all details for all group user need to open every group.

is there any option to collapse all ?

Also I have several tables in the reports that hide by default and user have a toggled to view the table.

any option for one click to collapse all tables ?

Thanks

Idan

Hi,

no, there is no collapse all switch. You can use a report parameter and check this one in every hideable table / object.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

Collapsable Columns not showing up in export to Excel

Dear Anyone,

I have created a report that has collapsable columns. We had used the visible toggle property in reporting services. While the colpsable column works well in report manager, it doesnt work anyone when we export the report to excel. Even of the report is expanded, the report in excel would always show up with just the columns that are the basis for the collapsable column.

Is this really the behavior when it comes to collapsable columns and exporting to excel?

Example:

Column A toggles Column B, Column C and Column D.

Thanks,

Joseph

I've solved this issue setting the hidden columns to be by defualt visible and then letting the user decide if to hide them or not.

In this way excel export it is correct.

HTH.

Alberto

|||

Hello Alberto,

Would you mind sharing your findings?

Thanks,

Joseph

|||I will appreciate if you could post the code and explanation how you did that.

Collapsable Columns not showing up in export to Excel

Dear Anyone,

I have created a report that has collapsable columns. We had used the visible toggle property in reporting services. While the colpsable column works well in report manager, it doesnt work anyone when we export the report to excel. Even of the report is expanded, the report in excel would always show up with just the columns that are the basis for the collapsable column.

Is this really the behavior when it comes to collapsable columns and exporting to excel?

Example:

Column A toggles Column B, Column C and Column D.

Thanks,

Joseph

I've solved this issue setting the hidden columns to be by defualt visible and then letting the user decide if to hide them or not.

In this way excel export it is correct.

HTH.

Alberto

|||

Hello Alberto,

Would you mind sharing your findings?

Thanks,

Joseph

|||I will appreciate if you could post the code and explanation how you did that.

Collapsable Columns not showing up in export to Excel

Dear Anyone,

I have created a report that has collapsable columns. We had used the visible toggle property in reporting services. While the colpsable column works well in report manager, it doesnt work anyone when we export the report to excel. Even of the report is expanded, the report in excel would always show up with just the columns that are the basis for the collapsable column.

Is this really the behavior when it comes to collapsable columns and exporting to excel?

Example:

Column A toggles Column B, Column C and Column D.

Thanks,

Joseph

I've solved this issue setting the hidden columns to be by defualt visible and then letting the user decide if to hide them or not.

In this way excel export it is correct.

HTH.

Alberto

|||

Hello Alberto,

Would you mind sharing your findings?

Thanks,

Joseph

|||I will appreciate if you could post the code and explanation how you did that.

Cognos to RS

Hi all!

I am taking a cognos report and created an identical one in RS. Can anyone tell me what this means and help figure out how to do it in RS?
cognos
TO_DATE(SUBSTR(DATE_TIME_STAMP,1,14),'YYYYMMDDHH24MISS')

RS (i am guessing)
CONVERT(SUBSTRING(DATE_TIME_STAMP,1,14),yyyyMMddhh?m?ss)

can anyone help?

Thanks in avance,
KerrieIs this a SQL function or a function in the report? If it is the latter, the function for SUBSTR is Mid() (http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbalr/html/8b6caa3e-973a-4f18-b0e4-93956a9dee9b.asp). You probably want to use the Format() function (http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbalr/html/c6f5bdda-a7c3-4f38-86cc-1cf47aa940b3.asp) in place of the TO_DATE.|||you could try :

http://www.sqlobserver.com

SQLobSERVER is a new independent forum specialising in BI/ETL including across the vendors (ie., Cognos)

Sorry about the blurb, but thought it might to be useful..

Cognos to RS

Hi all!

I am taking a cognos report and created an identical one in RS. Can anyone tell me what this means and help figure out how to do it in RS?
cognos
TO_DATE(SUBSTR(DATE_TIME_STAMP,1,14),'YYYYMMDDHH24MISS')

RS (i am guessing)
CONVERT(SUBSTRING(DATE_TIME_STAMP,1,14),yyyyMMddhh?m?ss)

can anyone help?

Thanks in avance,
KerrieIs this a SQL function or a function in the report? If it is the latter, the function for SUBSTR is Mid() (http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbalr/html/8b6caa3e-973a-4f18-b0e4-93956a9dee9b.asp). You probably want to use the Format() function (http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbalr/html/c6f5bdda-a7c3-4f38-86cc-1cf47aa940b3.asp) in place of the TO_DATE.|||you could try :

http://www.sqlobserver.com

SQLobSERVER is a new independent forum specialising in BI/ETL including across the vendors (ie., Cognos)

Sorry about the blurb, but thought it might to be useful..

Sunday, March 11, 2012

code to return a dataset

Our database is normalized to the point that I need to build a dataset to
render a report from. The code to build the dataset has logic that I would
like to keep in a custom assembly. What is the best way to call that code
and have it pass the dataset back for use by the report?
Thanks,
ShawnYou'd make life alot easier for yourself if you build the code using a
stored procedure... Any reason not to? You can encrypt it if that is your
concern.
--
Mary Bray [SQL Server MVP]
Please reply only to newsgroups
"sysdesigner" <sysdesigner@.discussions.microsoft.com> wrote in message
news:AA8B7D2A-4A54-4BA8-B7F5-598FFF1BBCF1@.microsoft.com...
> Our database is normalized to the point that I need to build a dataset to
> render a report from. The code to build the dataset has logic that I
> would
> like to keep in a custom assembly. What is the best way to call that code
> and have it pass the dataset back for use by the report?
> Thanks,
> Shawn|||Thanks, but the users that will be implementing the reports won't have the
ability to make stored procedures. Is there another way?
"Mary Bray [MVP]" wrote:
> You'd make life alot easier for yourself if you build the code using a
> stored procedure... Any reason not to? You can encrypt it if that is your
> concern.
> --
> Mary Bray [SQL Server MVP]
> Please reply only to newsgroups
> "sysdesigner" <sysdesigner@.discussions.microsoft.com> wrote in message
> news:AA8B7D2A-4A54-4BA8-B7F5-598FFF1BBCF1@.microsoft.com...
> > Our database is normalized to the point that I need to build a dataset to
> > render a report from. The code to build the dataset has logic that I
> > would
> > like to keep in a custom assembly. What is the best way to call that code
> > and have it pass the dataset back for use by the report?
> >
> > Thanks,
> > Shawn
>
>

Code Section and Report Obejcts

hi,
i would have to access to report obect from Code Section Report, but i
didin't find a solution so far.
For example:
'In Code Section Report
Public MyFunction() as Integer
...
'MyParam is a defined parameter in the report
MyParma.Value=....
...
'Texbox1 is a defined textbox object in the report
'Texbox1.Value=....
...
Return ....
End Function
someone have any solution?On Jan 20, 1:14 am, "giampi" <mm...@.libero.it> wrote:
> hi,
> i would have to access to report obect from Code Section Report, but i
> didin't find a solution so far.
> For example:
> 'In Code Section Report
> Public MyFunction() as Integer
> ...
> 'MyParam is a defined parameter in the report
> MyParma.Value=....
> ...
> 'Texbox1 is a defined textbox object in the report
> 'Texbox1.Value=....
> ...
> Return ....
> End Function
> someone have any solution?
These links might be helpful.
http://www.msdner.net/dev-archive/57/19-82-574469.shtm
http://msdn.microsoft.com/msdnmag/issues/06/07/DataPoints/
Regards,
Enrique Martinez
Sr. Software Consultant

Thursday, March 8, 2012

Code Question

I have this in the Code section under Report->Properties:

Public Function GetSort() As String
Select Case Report.Parameters!SortBy.Value
Case "GM"
Return CStr(Fields!GM.Value)

Case "STYLECODE"
Return Fields!STYLECODE.Value

Case "CUSTOMER"
Return Fields!CUSTOMER.Value

End Select
End Function

I have a call to Code.GetSort() in the sorting tab of the report data table.

I get this error when I build:

Error 1 [rsCompilerErrorInCode] There is an error on line 4 of custom code: [BC30469] Reference to a non-shared member requires an object reference.

i think the problem is in the code body can't use report parameters.
so the code maybe is:
public Function GetSort(SortType as String) As String
Select Case SortType

then use it like GetSort(Report.Parameters!SortBy.Value) in the expression.
|||

Just pass the paremeter value to the function in the code and use that inside your code like this

Public Function GetSort(SortBy as String) As String

Select Case SortBy

........

End Function

Shyam

|||

Hi Sam,

You have to use GetSort= instead of Return (VB not accepts return keyword)

Public Function GetSort() As String
Select Case Report.Parameters!SortBy.Value
Case "GM"
GetSort=CStr(Fields!GM.Value)

Case "STYLECODE"
GetSort= Fields!STYLECODE.Value

Case "CUSTOMER"
GetSort= Fields!CUSTOMER.Value

End Select
End Function

Regards,

Nanda kumar R

|||

Mr Nanda Kumar,

Please get your basics right. You can use Return keyword in the code in report.

The error is because Parameter is being referenced in the code the way it is referenced in expressions.

Shyam

|||Looks like we all need to get our basics right.
Problem was not that the parameter was referenced in the body, but that fields were referenced in the header. So now I have this in Report->Properties ->Code:

Public Function GetSort(sortby As String, sc As String, cu As String) As String
Select Case sortby

Case "STYLECODE"
Return sc

Case "CUSTOMER"
Return cu

End Select
End Function

And this in the sort tab of the data table properties:

=IIF(Parameters!SortBy.Value="GM",
Fields!GM.Value,
Code.GetSort(Parameters!SortBy.Value,Fields!STYLECODE.Value,Fields!CUSTOMER.Value))

I really wanted to avoid a mind bending iif statement hence the desire for the select case statement in the code. The GM field is numeric and it does not sort as a string so I have to handle that one separately.

|||I have another question if you all will so indulge me: In Visual Studio Report Designer, Click File-> New -> New File -> VBScript File.

If I create a code file this way, how do I call a function in it from the report?

Thanks
|||

Dont you get the same error when you use Parameters!something.Value in code?

It will give that error!!!!!!

You can only add reference to .dll assemblies and use the methods in those assemblies.

Shyam

|||>>You can only add reference to .dll assemblies and use the methods in those assemblies.

Sorry for asking silly questions but what is the purpose of the vbscript file capability if you cant call functions in your script?

|||

For SSRS, the referenced code should be pre-compiled but vbscript can only be compiled to an exe or interpreted at runtime.

You can transform your vbscript code to .net code and place it under code section directly.

Can u please mark the previous issue as marked?

Shyam

Code Question

I have this in the Code section under Report->Properties:

Public Function GetSort() As String
Select Case Report.Parameters!SortBy.Value
Case "GM"
Return CStr(Fields!GM.Value)

Case "STYLECODE"
Return Fields!STYLECODE.Value

Case "CUSTOMER"
Return Fields!CUSTOMER.Value

End Select
End Function

I have a call to Code.GetSort() in the sorting tab of the report data table.

I get this error when I build:

Error 1 [rsCompilerErrorInCode] There is an error on line 4 of custom code: [BC30469] Reference to a non-shared member requires an object reference.i think the problem is in the code body can't use report parameters.
so the code maybe is:
public Function GetSort(SortType as String) As String
Select Case SortType

then use it like GetSort(Report.Parameters!SortBy.Value) in the expression.
|||

Just pass the paremeter value to the function in the code and use that inside your code like this

Public Function GetSort(SortBy as String) As String

Select Case SortBy

........

End Function

Shyam

|||

Hi Sam,

You have to use GetSort= instead of Return (VB not accepts return keyword)

Public Function GetSort() As String
Select Case Report.Parameters!SortBy.Value
Case "GM"
GetSort=CStr(Fields!GM.Value)

Case "STYLECODE"
GetSort= Fields!STYLECODE.Value

Case "CUSTOMER"
GetSort= Fields!CUSTOMER.Value

End Select
End Function

Regards,

Nanda kumar R

|||

Mr Nanda Kumar,

Please get your basics right. You can use Return keyword in the code in report.

The error is because Parameter is being referenced in the code the way it is referenced in expressions.

Shyam

|||Looks like we all need to get our basics right.
Problem was not that the parameter was referenced in the body, but that fields were referenced in the header. So now I have this in Report->Properties ->Code:

Public Function GetSort(sortby As String, sc As String, cu As String) As String
Select Case sortby

Case "STYLECODE"
Return sc

Case "CUSTOMER"
Return cu

End Select
End Function

And this in the sort tab of the data table properties:

=IIF(Parameters!SortBy.Value="GM",
Fields!GM.Value,
Code.GetSort(Parameters!SortBy.Value,Fields!STYLECODE.Value,Fields!CUSTOMER.Value))

I really wanted to avoid a mind bending iif statement hence the desire for the select case statement in the code. The GM field is numeric and it does not sort as a string so I have to handle that one separately.|||I have another question if you all will so indulge me: In Visual Studio Report Designer, Click File-> New -> New File -> VBScript File.

If I create a code file this way, how do I call a function in it from the report?

Thanks|||

Dont you get the same error when you use Parameters!something.Value in code?

It will give that error!!!!!!

You can only add reference to .dll assemblies and use the methods in those assemblies.

Shyam

|||>>You can only add reference to .dll assemblies and use the methods in those assemblies.

Sorry for asking silly questions but what is the purpose of the vbscript file capability if you cant call functions in your script?

|||

For SSRS, the referenced code should be pre-compiled but vbscript can only be compiled to an exe or interpreted at runtime.

You can transform your vbscript code to .net code and place it under code section directly.

Can u please mark the previous issue as marked?

Shyam

Code Problem in Reporting Services 2005

We have just installed SQL Server 2005 Reporting Services and have
encountered an error converting the first report from SQL Server 2000
Reporting Services 2000 to the new version. The error is in using an
embedded code function being used in an expression.
The expression is:
=Code.GetEmployeeId(Fields!EmployeeId.Value).
The code function is:
Public Function GetEmployeeId(ByVal id as Object) As String
Dim text as String
text = iif (IsNothing(id), 0, id)
Return text
End Function
When the expression is edited, the function name. "GetEmployeeId", is
underlined in red and the popup error text says "Unrecognized Identifier."
What do I need to do to be able to get RS 2005 to recognize my function?
Thanks,
Tomits a VB.net code.
try this:
if id is nothing then
return 0
else
return id
end if
"Tom Bean" <tbean@.newsgroup.nospam> wrote in message
news:%23ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl...
> We have just installed SQL Server 2005 Reporting Services and have
> encountered an error converting the first report from SQL Server 2000
> Reporting Services 2000 to the new version. The error is in using an
> embedded code function being used in an expression.
> The expression is:
> =Code.GetEmployeeId(Fields!EmployeeId.Value).
> The code function is:
> Public Function GetEmployeeId(ByVal id as Object) As String
> Dim text as String
> text = iif (IsNothing(id), 0, id)
> Return text
> End Function
> When the expression is edited, the function name. "GetEmployeeId", is
> underlined in red and the popup error text says "Unrecognized Identifier."
> What do I need to do to be able to get RS 2005 to recognize my function?
> Thanks,
> Tom
>|||Hello Tom,
If you use the following expression in a textbox directly, what is the
result?
=Code.GetEmployeeId(nothing)
=Code.GetEmployeeId(1)
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
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.
>From: "Tom Bean" <tbean@.newsgroup.nospam>
>Subject: Code Problem in Reporting Services 2005
>Date: Tue, 17 Jan 2006 18:37:33 -0600
>Lines: 26
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>Message-ID: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67023
>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>We have just installed SQL Server 2005 Reporting Services and have
>encountered an error converting the first report from SQL Server 2000
>Reporting Services 2000 to the new version. The error is in using an
>embedded code function being used in an expression.
>The expression is:
> =Code.GetEmployeeId(Fields!EmployeeId.Value).
>The code function is:
>Public Function GetEmployeeId(ByVal id as Object) As String
> Dim text as String
> text = iif (IsNothing(id), 0, id)
> Return text
>End Function
>When the expression is edited, the function name. "GetEmployeeId", is
>underlined in red and the popup error text says "Unrecognized Identifier."
>What do I need to do to be able to get RS 2005 to recognize my function?
>Thanks,
>Tom
>
>|||Peter,
When I edit the expression, with either 'nothing' or '1' as the parameter,
GetEmployeeId is still underlined in red and the "Unrecognized Identifier"
error still pops up. However, when the report is rendered, the values '0'
and '1' are displayed in the textboxes.
My concern is that some undocumented change has occurred in the way a code
block needs to be formatted in order for the function to be recognized. The
code I showed in my original post is all that is contained in the window on
the Code tab of the reports properties. Does something need to be changed
in the Code window to get the function to be recognized?
Thanks,
Tom
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:93RJy0%23GGHA.3696@.TK2MSFTNGXA02.phx.gbl...
> Hello Tom,
> If you use the following expression in a textbox directly, what is the
> result?
> =Code.GetEmployeeId(nothing)
> =Code.GetEmployeeId(1)
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> 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.
>
> --
>>From: "Tom Bean" <tbean@.newsgroup.nospam>
>>Subject: Code Problem in Reporting Services 2005
>>Date: Tue, 17 Jan 2006 18:37:33 -0600
>>Lines: 26
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>>X-RFC2646: Format=Flowed; Original
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>>Message-ID: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67023
>>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>>We have just installed SQL Server 2005 Reporting Services and have
>>encountered an error converting the first report from SQL Server 2000
>>Reporting Services 2000 to the new version. The error is in using an
>>embedded code function being used in an expression.
>>The expression is:
>> =Code.GetEmployeeId(Fields!EmployeeId.Value).
>>The code function is:
>>Public Function GetEmployeeId(ByVal id as Object) As String
>> Dim text as String
>> text = iif (IsNothing(id), 0, id)
>> Return text
>>End Function
>>When the expression is edited, the function name. "GetEmployeeId", is
>>underlined in red and the popup error text says "Unrecognized Identifier."
>>What do I need to do to be able to get RS 2005 to recognize my function?
>>Thanks,
>>Tom
>>
>|||Peter,
After investigating the problem with my report further, I found that the
problem isn't with the code even though an error is raised in the expression
editor. The problem seems to be due to the location of the subreport.
The subreport with the problem is in a cell of a 3 row table that contains
two groups. The first group, the ServiceGroup, is in the first row and the
second group, the EmployeeGroup, is in the second row. If the subreport is
put in a cell in the first row (first group), it works. If the subreport is
put in a cell in the second row (second group), it fails with an "internal
error" message.
Is there some issue with multiple groups in one table that would cause the
subreport to fail?
Thanks,
Tom
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:93RJy0%23GGHA.3696@.TK2MSFTNGXA02.phx.gbl...
> Hello Tom,
> If you use the following expression in a textbox directly, what is the
> result?
> =Code.GetEmployeeId(nothing)
> =Code.GetEmployeeId(1)
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> 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.
>
> --
>>From: "Tom Bean" <tbean@.newsgroup.nospam>
>>Subject: Code Problem in Reporting Services 2005
>>Date: Tue, 17 Jan 2006 18:37:33 -0600
>>Lines: 26
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>>X-RFC2646: Format=Flowed; Original
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>>Message-ID: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67023
>>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>>We have just installed SQL Server 2005 Reporting Services and have
>>encountered an error converting the first report from SQL Server 2000
>>Reporting Services 2000 to the new version. The error is in using an
>>embedded code function being used in an expression.
>>The expression is:
>> =Code.GetEmployeeId(Fields!EmployeeId.Value).
>>The code function is:
>>Public Function GetEmployeeId(ByVal id as Object) As String
>> Dim text as String
>> text = iif (IsNothing(id), 0, id)
>> Return text
>>End Function
>>When the expression is edited, the function name. "GetEmployeeId", is
>>underlined in red and the popup error text says "Unrecognized Identifier."
>>What do I need to do to be able to get RS 2005 to recognize my function?
>>Thanks,
>>Tom
>>
>|||Hello Tom,
Since the issue occurs consistently on this specific situation, it is more
like a problem in RS2005 though I did not find any known issue related. You
may want to contact CSS directly so they could look into this in timely
manner.
For a complete list of Microsoft Customer Support Services phone numbers,
please go to the following address on the World Wide Web:
<http://support.microsoft.com/directory/overview.asp>
If you are outside the US please see http://support.microsoft.com for
regional support phone numbers.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
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.
>From: "Tom Bean" <tbean@.newsgroup.nospam>
>References: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
<93RJy0#GGHA.3696@.TK2MSFTNGXA02.phx.gbl>
>Subject: Re: Code Problem in Reporting Services 2005
>Date: Wed, 18 Jan 2006 14:46:54 -0600
>Lines: 92
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>Message-ID: <uTsaQBHHGHA.3700@.TK2MSFTNGP15.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67080
>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>Peter,
>After investigating the problem with my report further, I found that the
>problem isn't with the code even though an error is raised in the
expression
>editor. The problem seems to be due to the location of the subreport.
>The subreport with the problem is in a cell of a 3 row table that contains
>two groups. The first group, the ServiceGroup, is in the first row and
the
>second group, the EmployeeGroup, is in the second row. If the subreport
is
>put in a cell in the first row (first group), it works. If the subreport
is
>put in a cell in the second row (second group), it fails with an "internal
>error" message.
>Is there some issue with multiple groups in one table that would cause the
>subreport to fail?
>Thanks,
>Tom
>"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
>news:93RJy0%23GGHA.3696@.TK2MSFTNGXA02.phx.gbl...
>> Hello Tom,
>> If you use the following expression in a textbox directly, what is the
>> result?
>> =Code.GetEmployeeId(nothing)
>> =Code.GetEmployeeId(1)
>> Best Regards,
>> Peter Yang
>> MCSE2000/2003, MCSA, MCDBA
>> 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.
>>
>> --
>>From: "Tom Bean" <tbean@.newsgroup.nospam>
>>Subject: Code Problem in Reporting Services 2005
>>Date: Tue, 17 Jan 2006 18:37:33 -0600
>>Lines: 26
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>>X-RFC2646: Format=Flowed; Original
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>>Message-ID: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>>Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.sqlserver.reportingsvcs:67023
>>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>>We have just installed SQL Server 2005 Reporting Services and have
>>encountered an error converting the first report from SQL Server 2000
>>Reporting Services 2000 to the new version. The error is in using an
>>embedded code function being used in an expression.
>>The expression is:
>> =Code.GetEmployeeId(Fields!EmployeeId.Value).
>>The code function is:
>>Public Function GetEmployeeId(ByVal id as Object) As String
>> Dim text as String
>> text = iif (IsNothing(id), 0, id)
>> Return text
>>End Function
>>When the expression is edited, the function name. "GetEmployeeId", is
>>underlined in red and the popup error text says "Unrecognized
Identifier."
>>What do I need to do to be able to get RS 2005 to recognize my function?
>>Thanks,
>>Tom
>>
>>
>
>|||Peter,
I have rewritten my query so the second subreport, in the second row/group,
is no longer necessary. This provides me with a usable workaround but I
think you should escalate this problem to the Reporting Services group to
they can restore the functionality that was available in RS2000.
Thanks,
Tom
"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
news:fT%23Yc2NHGHA.1240@.TK2MSFTNGXA02.phx.gbl...
> Hello Tom,
> Since the issue occurs consistently on this specific situation, it is more
> like a problem in RS2005 though I did not find any known issue related.
> You
> may want to contact CSS directly so they could look into this in timely
> manner.
> For a complete list of Microsoft Customer Support Services phone numbers,
> please go to the following address on the World Wide Web:
> <http://support.microsoft.com/directory/overview.asp>
> If you are outside the US please see http://support.microsoft.com for
> regional support phone numbers.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> 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.
>
> --
>>From: "Tom Bean" <tbean@.newsgroup.nospam>
>>References: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
> <93RJy0#GGHA.3696@.TK2MSFTNGXA02.phx.gbl>
>>Subject: Re: Code Problem in Reporting Services 2005
>>Date: Wed, 18 Jan 2006 14:46:54 -0600
>>Lines: 92
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>>X-RFC2646: Format=Flowed; Original
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>>Message-ID: <uTsaQBHHGHA.3700@.TK2MSFTNGP15.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
>>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67080
>>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>>Peter,
>>After investigating the problem with my report further, I found that the
>>problem isn't with the code even though an error is raised in the
> expression
>>editor. The problem seems to be due to the location of the subreport.
>>The subreport with the problem is in a cell of a 3 row table that contains
>>two groups. The first group, the ServiceGroup, is in the first row and
> the
>>second group, the EmployeeGroup, is in the second row. If the subreport
> is
>>put in a cell in the first row (first group), it works. If the subreport
> is
>>put in a cell in the second row (second group), it fails with an "internal
>>error" message.
>>Is there some issue with multiple groups in one table that would cause the
>>subreport to fail?
>>Thanks,
>>Tom
>>"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
>>news:93RJy0%23GGHA.3696@.TK2MSFTNGXA02.phx.gbl...
>> Hello Tom,
>> If you use the following expression in a textbox directly, what is the
>> result?
>> =Code.GetEmployeeId(nothing)
>> =Code.GetEmployeeId(1)
>> Best Regards,
>> Peter Yang
>> MCSE2000/2003, MCSA, MCDBA
>> 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.
>>
>> --
>>From: "Tom Bean" <tbean@.newsgroup.nospam>
>>Subject: Code Problem in Reporting Services 2005
>>Date: Tue, 17 Jan 2006 18:37:33 -0600
>>Lines: 26
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>>X-RFC2646: Format=Flowed; Original
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>>Message-ID: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>>Xref: TK2MSFTNGXA02.phx.gbl
> microsoft.public.sqlserver.reportingsvcs:67023
>>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>>We have just installed SQL Server 2005 Reporting Services and have
>>encountered an error converting the first report from SQL Server 2000
>>Reporting Services 2000 to the new version. The error is in using an
>>embedded code function being used in an expression.
>>The expression is:
>> =Code.GetEmployeeId(Fields!EmployeeId.Value).
>>The code function is:
>>Public Function GetEmployeeId(ByVal id as Object) As String
>> Dim text as String
>> text = iif (IsNothing(id), 0, id)
>> Return text
>>End Function
>>When the expression is edited, the function name. "GetEmployeeId", is
>>underlined in red and the popup error text says "Unrecognized
> Identifier."
>>What do I need to do to be able to get RS 2005 to recognize my function?
>>Thanks,
>>Tom
>>
>>
>>
>|||Hello Tom,
Thank you for your feedback. Please rest assured that this issue has been
report to the proper channel. If there is any update about this, we will
let you know.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
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.
>From: "Tom Bean" <tbean@.newsgroup.nospam>
>References: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
<93RJy0#GGHA.3696@.TK2MSFTNGXA02.phx.gbl>
<uTsaQBHHGHA.3700@.TK2MSFTNGP15.phx.gbl>
<fT#Yc2NHGHA.1240@.TK2MSFTNGXA02.phx.gbl>
>Subject: Re: Code Problem in Reporting Services 2005
>Date: Thu, 19 Jan 2006 08:46:54 -0600
>Lines: 165
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>Message-ID: <O676qcQHGHA.984@.tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:67121
>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>Peter,
>I have rewritten my query so the second subreport, in the second
row/group,
>is no longer necessary. This provides me with a usable workaround but I
>think you should escalate this problem to the Reporting Services group to
>they can restore the functionality that was available in RS2000.
>Thanks,
>Tom
>"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
>news:fT%23Yc2NHGHA.1240@.TK2MSFTNGXA02.phx.gbl...
>> Hello Tom,
>> Since the issue occurs consistently on this specific situation, it is
more
>> like a problem in RS2005 though I did not find any known issue related.
>> You
>> may want to contact CSS directly so they could look into this in timely
>> manner.
>> For a complete list of Microsoft Customer Support Services phone numbers,
>> please go to the following address on the World Wide Web:
>> <http://support.microsoft.com/directory/overview.asp>
>> If you are outside the US please see http://support.microsoft.com for
>> regional support phone numbers.
>> Best Regards,
>> Peter Yang
>> MCSE2000/2003, MCSA, MCDBA
>> 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.
>>
>> --
>>From: "Tom Bean" <tbean@.newsgroup.nospam>
>>References: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
>> <93RJy0#GGHA.3696@.TK2MSFTNGXA02.phx.gbl>
>>Subject: Re: Code Problem in Reporting Services 2005
>>Date: Wed, 18 Jan 2006 14:46:54 -0600
>>Lines: 92
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>>X-RFC2646: Format=Flowed; Original
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>>Message-ID: <uTsaQBHHGHA.3700@.TK2MSFTNGP15.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
>>Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.sqlserver.reportingsvcs:67080
>>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>>Peter,
>>After investigating the problem with my report further, I found that the
>>problem isn't with the code even though an error is raised in the
>> expression
>>editor. The problem seems to be due to the location of the subreport.
>>The subreport with the problem is in a cell of a 3 row table that
contains
>>two groups. The first group, the ServiceGroup, is in the first row and
>> the
>>second group, the EmployeeGroup, is in the second row. If the subreport
>> is
>>put in a cell in the first row (first group), it works. If the subreport
>> is
>>put in a cell in the second row (second group), it fails with an
"internal
>>error" message.
>>Is there some issue with multiple groups in one table that would cause
the
>>subreport to fail?
>>Thanks,
>>Tom
>>"Peter Yang [MSFT]" <petery@.online.microsoft.com> wrote in message
>>news:93RJy0%23GGHA.3696@.TK2MSFTNGXA02.phx.gbl...
>> Hello Tom,
>> If you use the following expression in a textbox directly, what is the
>> result?
>> =Code.GetEmployeeId(nothing)
>> =Code.GetEmployeeId(1)
>> Best Regards,
>> Peter Yang
>> MCSE2000/2003, MCSA, MCDBA
>> 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.
>>
>> --
>>From: "Tom Bean" <tbean@.newsgroup.nospam>
>>Subject: Code Problem in Reporting Services 2005
>>Date: Tue, 17 Jan 2006 18:37:33 -0600
>>Lines: 26
>>X-Priority: 3
>>X-MSMail-Priority: Normal
>>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>>X-RFC2646: Format=Flowed; Original
>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>>Message-ID: <#ZXpud8GGHA.1100@.TK2MSFTNGP10.phx.gbl>
>>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>>NNTP-Posting-Host: 71.4.140.141.ptr.us.xo.net 71.4.140.141
>>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>>Xref: TK2MSFTNGXA02.phx.gbl
>> microsoft.public.sqlserver.reportingsvcs:67023
>>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>>We have just installed SQL Server 2005 Reporting Services and have
>>encountered an error converting the first report from SQL Server 2000
>>Reporting Services 2000 to the new version. The error is in using an
>>embedded code function being used in an expression.
>>The expression is:
>> =Code.GetEmployeeId(Fields!EmployeeId.Value).
>>The code function is:
>>Public Function GetEmployeeId(ByVal id as Object) As String
>> Dim text as String
>> text = iif (IsNothing(id), 0, id)
>> Return text
>>End Function
>>When the expression is edited, the function name. "GetEmployeeId", is
>>underlined in red and the popup error text says "Unrecognized
>> Identifier."
>>What do I need to do to be able to get RS 2005 to recognize my
function?
>>Thanks,
>>Tom
>>
>>
>>
>>
>
>

Code for Custom Background Colors

I am building a report that uses green, red, and white as the
background color of the cell. I've tried building a public shared
function with an if-elseif statement. My biggest problem is that I'm
not a VB programmer so I'm hacking away at this. I found a reference
to this at http://www.odetocode.com/Articles/130.aspx and tried to
follow the example but the example is based on older information.
Here is what my code looks like in the RDL:
<Code>Public Shared Function SetColor(ByVal Value As Integer) As
String
SetColor = "Red"
If Value < Fields!benchmark.value And Fields!hilo.value = "H"
SetColor = "Green"
ElseIf Value > Fields!benchmark.value And Fields!hilo.value = "Y"
SetColor = "Green"
ElseIf Value is nothing
SetColor = "White"
End If
End Function</Code>
When I try to compile the report I get this message:
There is an error on line 4 of custom code: [BC30469] Reference to a
non-shared member requires an object reference.
Does anyone know of a source for examples of how to write embedded
code in RS? I could really use the ability to do this but I'm just
too ignorant take advantage of this.On Dec 4, 10:47 am, Fred <fdk0154...@.cox.net> wrote:
> I am building a report that uses green, red, and white as the
> background color of the cell. I've tried building a public shared
> function with an if-elseif statement. My biggest problem is that I'm
> not a VB programmer so I'm hacking away at this. I found a reference
> to this athttp://www.odetocode.com/Articles/130.aspxand tried to
> follow the example but the example is based on older information.
> Here is what my code looks like in the RDL:
> <Code>Public Shared Function SetColor(ByVal Value As Integer) As
> String
> SetColor = "Red"
> If Value < Fields!benchmark.value And Fields!hilo.value = "H"
> SetColor = "Green"
> ElseIf Value > Fields!benchmark.value And Fields!hilo.value = "Y"
> SetColor = "Green"
> ElseIf Value is nothing
> SetColor = "White"
> End If
> End Function</Code>
> When I try to compile the report I get this message:
> There is an error on line 4 of custom code: [BC30469] Reference to a
> non-shared member requires an object reference.
> Does anyone know of a source for examples of how to write embedded
> code in RS? I could really use the ability to do this but I'm just
> too ignorant take advantage of this.
You can't mix the Fields object in a Function, the value has to be
passed as a parameter to the function. Like any other language, the
Fields object would be out of scope when the back color expression is
inside the function. Also, you want to check if the Value object is
Nothing before you attempt to do math expressions against it (<, >).
I also assume you may want to use Double floating points in case you
have fractions and want them rounded correctly.
Function SetColor(ByVal Value As Double, ByVal BenchmarkValue As
Double, hilo As String) As String
If IsNothing( Value ) Then
SetColor = "White"
ElseIf Value < BenchmarkValue And hilo = "Y" Then
SetColor = "Green"
Elseif Value > BenchmarkValue And hilo = "N" Then
SetColor = "Green"
Else
SetColor = "Red"
End If
End Function
Then in the BackgroundColor Property, you would use an Expression like
= Code.SetColor( Fields!Value.Value, Fields!benchmark.Value, Fields!
hilo.Value )
-- Scott

Code elements not showing

Hi
I created a vb function and put it in the code for report properties.
But when I use the =Code. in mye report is doesn't show.
Do I have to do something special to compile it or make it work?
I want to post some information back to the header in my report
and the only way I have found to do that is by using
the Code.-expression.
Regards
KnutSeems like intellisense don't work properly for custom code.
It worked ok.
"Knut" wrote:
> Hi
> I created a vb function and put it in the code for report properties.
> But when I use the =Code. in mye report is doesn't show.
> Do I have to do something special to compile it or make it work?
> I want to post some information back to the header in my report
> and the only way I have found to do that is by using
> the Code.-expression.
> Regards
> Knut

Wednesday, March 7, 2012

Code Behind Cache

I am experiencing an issue of the code-behind variables being cached in
between report renders. This was noticed during a stress test. When
two users generated the same report for a different customer, the first
report was fine, the second report contained the header for the first
report but the correct data in the body for the second report.
The header is created using values from the code-behind page. The body
calls a function and stores certain values to be used in the header.
This is the expression in the body that makes the call:
=Code.SetHeaderInfo(First(Fields!NAME.Value, "HEADER"),
First(Fields!CUSTOMERREFERENCE.Value, "HEADER"),
First(Fields!POLICYEFFECTIVEDATE.Value, "HEADER"),
First(Fields!POLICYEXPIRATIONDATE.Value, "HEADER"),
First(Fields!HISTORICALCLAIMNUMBER.Value, "HEADER"),
First(Fields!ISPCACONVERTED.Value, "HEADER"))
This is the code:
Public Shared strInsuredName As String = Nothing
Public Shared strContractNum As String = Nothing
Public Shared strPolicyEffDate As Date = Nothing
Public Shared strPolicyExpDate As Date = Nothing
Public Shared strHistClaimNum as String = Nothing
Public Shared intISPCAConverted as Integer = Nothing
Public Shared Function SetHeaderInfo(ByVal strInsuredNameTemp As
String, ByVal strContractNumTemp As String, _
ByVal strPolicyEffDateTemp As String, ByVal strPolicyExpDateTemp As
String, ByVal strHistClaimNumTemp As String, _
ByVal intISPCAConvertedTemp as Integer) As String
strInsuredName = Nothing
strContractNum = Nothing
strPolicyEffDate = Nothing
strPolicyExpDate = Nothing
strHistClaimNum = Nothing
intISPCAConverted = Nothing
strInsuredName = strInsuredNameTemp
strContractNum = Mid(strContractNumTemp, 1, 3) & "-" &
Mid(strContractNumTemp, 4, 4) & "-" & Mid(strContractNumTemp, 8, 1)
strPolicyEffDate = strPolicyEffDateTemp
strPolicyExpDate = strPolicyExpDateTemp
strHistClaimNum = strHistClaimNumTemp
intISPCAConverted = intISPCAConvertedTemp
End Function
And an example of an expression in the header:
="Insured: " & iif(Code.strInsuredName = "", "ERROR",
Code.strInsuredName)
I can post the .rdl if anyone thinks it will help. A little more
background, we're using an ASP.NET app and RS's web service to render
the reports. I have been able to duplicate this problem myself, by
opening up two separate IE windows and launching the same report for 2
customers at the same time. This has happened in a load-balanced and
non load-balanced environment.
Thanks for any input.
Kel KoenigStatic (shared) fields defined in report.Code or in custom assemblies are
'shared' between report executions.
This is a known issue.
Do not store report execution values in static fields or if you do then make
a dictionary that will keep the state per some key that is unique for the
current report instance - for example report execution time (Globals)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
<kelkoenig@.gmail.com> wrote in message
news:1124892077.666011.325010@.z14g2000cwz.googlegroups.com...
>I am experiencing an issue of the code-behind variables being cached in
> between report renders. This was noticed during a stress test. When
> two users generated the same report for a different customer, the first
> report was fine, the second report contained the header for the first
> report but the correct data in the body for the second report.
> The header is created using values from the code-behind page. The body
> calls a function and stores certain values to be used in the header.
> This is the expression in the body that makes the call:
> =Code.SetHeaderInfo(First(Fields!NAME.Value, "HEADER"),
> First(Fields!CUSTOMERREFERENCE.Value, "HEADER"),
> First(Fields!POLICYEFFECTIVEDATE.Value, "HEADER"),
> First(Fields!POLICYEXPIRATIONDATE.Value, "HEADER"),
> First(Fields!HISTORICALCLAIMNUMBER.Value, "HEADER"),
> First(Fields!ISPCACONVERTED.Value, "HEADER"))
> This is the code:
> Public Shared strInsuredName As String = Nothing
> Public Shared strContractNum As String = Nothing
> Public Shared strPolicyEffDate As Date = Nothing
> Public Shared strPolicyExpDate As Date = Nothing
> Public Shared strHistClaimNum as String = Nothing
> Public Shared intISPCAConverted as Integer = Nothing
> Public Shared Function SetHeaderInfo(ByVal strInsuredNameTemp As
> String, ByVal strContractNumTemp As String, _
> ByVal strPolicyEffDateTemp As String, ByVal strPolicyExpDateTemp As
> String, ByVal strHistClaimNumTemp As String, _
> ByVal intISPCAConvertedTemp as Integer) As String
> strInsuredName = Nothing
> strContractNum = Nothing
> strPolicyEffDate = Nothing
> strPolicyExpDate = Nothing
> strHistClaimNum = Nothing
> intISPCAConverted = Nothing
> strInsuredName = strInsuredNameTemp
> strContractNum = Mid(strContractNumTemp, 1, 3) & "-" &
> Mid(strContractNumTemp, 4, 4) & "-" & Mid(strContractNumTemp, 8, 1)
> strPolicyEffDate = strPolicyEffDateTemp
> strPolicyExpDate = strPolicyExpDateTemp
> strHistClaimNum = strHistClaimNumTemp
> intISPCAConverted = intISPCAConvertedTemp
> End Function
>
> And an example of an expression in the header:
> ="Insured: " & iif(Code.strInsuredName = "", "ERROR",
> Code.strInsuredName)
> I can post the .rdl if anyone thinks it will help. A little more
> background, we're using an ASP.NET app and RS's web service to render
> the reports. I have been able to duplicate this problem myself, by
> opening up two separate IE windows and launching the same report for 2
> customers at the same time. This has happened in a load-balanced and
> non load-balanced environment.
> Thanks for any input.
> Kel Koenig
>