Thursday, March 29, 2012
Can I Insert Line Numbers?
assigned to each row. For example, the values 1-99 below would be computed at
report run time:
1 Transaction-A
2 Transaction-B
:
99 Transaction-x
I thought I could solve this by using a global variable and function within
the report code block such as:
Private Dim itemCount As Integer
Public Function GetCount() As Integer
itemCount += 1
Return itemCount
End Function
And then create a calculated field (Called LineNumber) that calls the
function:
=Code.GetCount()
But what I get is a seemingly random assignment of line numbers; I assume
due to ReptSvcs resolving the rows in a non-linear fashion.
Any thoughts on how I can get ordered line numbers?Try using static variables in the code
>--Original Message--
>Hi. We are creating long reports that need to have unique
reference numbers
>assigned to each row. For example, the values 1-99 below
would be computed at
>report run time:
>1 Transaction-A
>2 Transaction-B
> :
>99 Transaction-x
>I thought I could solve this by using a global variable
and function within
>the report code block such as:
>Private Dim itemCount As Integer
>Public Function GetCount() As Integer
> itemCount += 1
> Return itemCount
>End Function
>And then create a calculated field (Called LineNumber)
that calls the
>function:
>=Code.GetCount()
>But what I get is a seemingly random assignment of line
numbers; I assume
>due to ReptSvcs resolving the rows in a non-linear
fashion.
>Any thoughts on how I can get ordered line numbers?
>
>
>.
>|||The problem with statics in embedded code is that they are shared
among all instances of the report that are running. If two of the
reports using the static execute at the same time the results could
interleave.
--
Scott
http://www.OdeToCode.com
On Sat, 4 Sep 2004 11:51:17 -0700, "Ravi" <ravikantkv@.rediffmail.com>
wrote:
>Try using static variables in the code|||Thanks for the tips, but I think I got it working.
I used the same code as I mentioned below, but added an "ORDER BY"
quailifier to the dataset to sort the data in the same sequence as the report
displayed. This gave me sequentual numbers.
"Scott Allen" wrote:
> The problem with statics in embedded code is that they are shared
> among all instances of the report that are running. If two of the
> reports using the static execute at the same time the results could
> interleave.
> --
> Scott
> http://www.OdeToCode.com
> On Sat, 4 Sep 2004 11:51:17 -0700, "Ravi" <ravikantkv@.rediffmail.com>
> wrote:
> >Try using static variables in the code
>sql
Tuesday, March 20, 2012
Can I convert/reference a string to a var?
hey, guys
I got a strange question. :)
In SQL Server,
declare @.Item8 as varchar(100)
declare @.str as varchar(100)
set @.str = '@.Item8'
Is there any way I can reference @.str to @.Item8 ?
Thanks
No. This is not possible. Variables are scoped to batch or module or dynamic SQL batch.Monday, March 19, 2012
Can I add a foriegn key on a indexed view to reference other table
Is there anybody familiar with indexed view here?
Can I add a foriegn key on a indexed view to reference other table?
Thanks!
No, and you wouldn't want to. Put the constraint on the table - that's the real data. The view is just that - a view, on the data in the table. The fact that you can index the view doesn't change that. You can use INSTEAD OF triggers on views to get things to happen when data is modified through the view but that wouldn't replace a foreign key constraint, rather it would be subject to the constraint as it should be.Friday, February 24, 2012
Can AMO be used on VB.Net
Hi,
I want to program the Analysis Roles in AMO. Can I use VB.Net? What is the reference that I have to add to my project? Can you provide a simple sample connection.
Thanks a lot!
cherriesh
Hello,
you can find a kind of tutorial about AMO here
http://msdn2.microsoft.com/en-us/library/ms345081.aspx
HTH
J?rg
Tuesday, February 14, 2012
Can a data region...
reference a parameter? For instance, I have a table control and in the detail field I have an expression.
=IIf(Parameters!Consignee.Value = True, "True","False")
But it doens't work.....any suggestions?
Michael
That should work - what happens when you try it? Did you make the data type Boolean?|||I get "#Error" in the field.
All I did to get around this was to make a derived table in my main query that filters for the specific parameter, and then joined it back in appropriately. This made it a field instead of a parameter reference and it worked fine. Thanks for the response.
Michael