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

Monday, March 26, 2012

ODBC datasource wont work on report server!!

Hi,

I have VS2005 and sql server express and ive created some reports using sql server
as a backend. everything works as it should.

THEN...

i created a report that uses a system DSN odbc source and it works in VS2005 it works fine.
i have deployed it to the report server and the datasource appears t be there, but when i try and run the report i ge the following message

  • An error has occurred during report processing.
  • An attempt has been made to use a data extension 'ODBC' that is not registered for this report server.anyone got any ideas how i can make this work? i have tried to find an explanation using google, but i cannot seem to see any thing that answers the question.

    Regards,

    Russ
    Express versions of Reporting Services allow for data sources to only be local and must be a matching SKU of SQL Server.

  • ODBC connection with stored procedure on iSeries as data source

    I have created a stored procedure on the iSeries that creates a cursor and opens it. I am trying to write my report to use the stored procedure. I cannot get the data source to work. How do I create my data source so that it uses the stored procedure? My SP has three parameters I am trying to pass from the report. The parms are created in the layout.

    Thank you

    Figured it out. Had to use this syntax: Call procname ('parm1', parm2, 'parm3')

    |||

    I was looking for an answer to my stored procedure problem and I came across your question/answer...I was hoping you'd help me out...we are using ODBC and an iseries and since I'm very much of a newbie to VB and .net, I am using point and click when I can...can you tell me what I'm doing wrong? I have an asp.net master and content pages...the content pages have datagrids (Gridview1) and a SQLDataSource control...Any help is greatly appreciated!

    Imports IBM.Data.DB2.iSeries

    Partial Class SSNName

    Inherits System.Web.UI.Page

    Dim ssnpsn As String = "123456789"

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim conn As New iDB2Connection("DataSource=datasourcename")

    Try

    conn.Open()

    Catch ex As Exception

    End Try

    Dim sqlSSN As String = "call libraryname.SP_QSSNNAME(@.ssn)"

    Dim cmdSSN As New iDB2Command(sqlSSN, conn)

    cmdSSN.Parameters.Add("@.ssn", iDB2DbType.iDB2Numeric, 9)

    cmdSSN.Parameters("@.ssn").Value = ssnpsn

    Dim dr As iDB2DataReader

    dr = cmdSSN.ExecuteReader()

    Gridview1.DataSource = dr

    Gridview1.DataBind()

    conn.Close()

    End Sub

    End Class

    |||

    I have been using the iSeries for some time now and I find this approach the best.

    1. Create a new class under App_code

    2. Create a function with the follwing code:

    Shared Function GetCatByCatID(ByVal CatID As Integer) As System.Data.DataSet

    Dim connectionString As String = ConfigurationManager.ConnectionStrings("gsafleetcs").ConnectionString

    Dim cnn As IBM.Data.DB2.iSeries.iDB2Connection = New IBM.Data.DB2.iSeries.iDB2Connection(connectionString)

    Dim proc As String = "GetCatInfo"

    Dim dbCmd As IBM.Data.DB2.iSeries.iDB2Command = New IBM.Data.DB2.iSeries.iDB2Command

    dbCmd.CommandText = proc

    dbCmd.CommandType = Data.CommandType.StoredProcedure

    dbCmd.Connection = cnn

    Dim dbParam_ID As System.Data.IDataParameter = New IBM.Data.DB2.iSeries.iDB2Parameter

    dbParam_ID.ParameterName = "@.CatID"

    dbParam_ID.Value = CatID

    dbParam_ID.DbType = Data.DbType.Int32

    dbParam_ID.Direction = Data.ParameterDirection.Input

    dbCmd.Parameters.Add(dbParam_ID)

    Dim dataAdapter As IBM.Data.DB2.iSeries.iDB2DataAdapter = New IBM.Data.DB2.iSeries.iDB2DataAdapter

    Dim dataSet As System.Data.DataSet = New System.Data.DataSet

    dataAdapter.SelectCommand = dbCmd

    dataAdapter.Fill(dataSet)

    dbCmd.Dispose()

    cnn.Close()

    Return dataSet

    End Function

    3. Then in your asp page where the grid view create a Object datasource, unclick the Show only data components to expose you class name, then click next and choose you approiate method and finally define your parameter(s).

    These Rebooks helped a lot:

    1. IBM Redbook Stored Procedures, Triggers, and User-Defined Functions on DB2 Universal Database for iSeries

    2. Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET

    Good Luck

    |||

    Are you using the Report Designer?

    In my Dataset definition I've defined my Name, Data Source, Command Type as 'Stored Procedure' and in the Query String I put the name of the stored procedure. When I execute it responds with

    TITLE: Microsoft Report Designer

    An error occurred while executing the query.
    Object reference not set to an instance of an object.


    ADDITIONAL INFORMATION:

    Object reference not set to an instance of an object. (System.Data)


    BUTTONS:

    OK

    I know it finds the store procedure, becuase at first I had a typo and the error message stated it could not find it. When I fix the typo I recieved the above error message. Here is the stored procedure:

    BEGIN
    DECLARE C1 CURSOR FOR
    SELECT PEMS . EMS1548 . EMSDCO , PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT , PEMS . FUELDET . FUDTYP , PEMS . FUELDET . FUDFQ AS GALS , PEMS . FUELDET . FUDFD AS DOLS , PEMS . FUELDET . FUDDAT
    FROM PEMS . EMS1548 , PEMS . EMS1547 , PEMS . FUELDET
    WHERE PEMS . EMS1548 . EMSDCO = PEMS . EMS1547 . EMSDPT AND PEMS . EMS1547 . EMSIDC = PEMS . FUELDET . FUDIDX AND
    ( PEMS . FUELDET . FUDTYP IN ( 'UNL' , 'DSL' ) ) AND ( PEMS . FUELDET . FUDEQT IN ( '022406' , '016460' , '026352' , '017068' , '023207' , '021870' , '019334' , '022754' , '020608' , '019337' ) )
    ORDER BY PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT ;
    OPEN C1 ;
    END

    Any ideas would be appreciated.

    |||

    I found the solution:

    I was missing "RESULT SET 1" before the LANGUAGE SQL and "SET RESULT SETS CURSOR C1;" after the OPEN C1; statement

    ODBC connection with stored procedure on iSeries as data source

    I have created a stored procedure on the iSeries that creates a cursor and opens it. I am trying to write my report to use the stored procedure. I cannot get the data source to work. How do I create my data source so that it uses the stored procedure? My SP has three parameters I am trying to pass from the report. The parms are created in the layout.

    Thank you

    Figured it out. Had to use this syntax: Call procname ('parm1', parm2, 'parm3')

    |||

    I was looking for an answer to my stored procedure problem and I came across your question/answer...I was hoping you'd help me out...we are using ODBC and an iseries and since I'm very much of a newbie to VB and .net, I am using point and click when I can...can you tell me what I'm doing wrong? I have an asp.net master and content pages...the content pages have datagrids (Gridview1) and a SQLDataSource control...Any help is greatly appreciated!

    Imports IBM.Data.DB2.iSeries

    Partial Class SSNName

    Inherits System.Web.UI.Page

    Dim ssnpsn As String = "123456789"

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim conn As New iDB2Connection("DataSource=datasourcename")

    Try

    conn.Open()

    Catch ex As Exception

    End Try

    Dim sqlSSN As String = "call libraryname.SP_QSSNNAME(@.ssn)"

    Dim cmdSSN As New iDB2Command(sqlSSN, conn)

    cmdSSN.Parameters.Add("@.ssn", iDB2DbType.iDB2Numeric, 9)

    cmdSSN.Parameters("@.ssn").Value = ssnpsn

    Dim dr As iDB2DataReader

    dr = cmdSSN.ExecuteReader()

    Gridview1.DataSource = dr

    Gridview1.DataBind()

    conn.Close()

    End Sub

    End Class

    |||

    I have been using the iSeries for some time now and I find this approach the best.

    1. Create a new class under App_code

    2. Create a function with the follwing code:

    Shared Function GetCatByCatID(ByVal CatID As Integer) As System.Data.DataSet

    Dim connectionString As String = ConfigurationManager.ConnectionStrings("gsafleetcs").ConnectionString

    Dim cnn As IBM.Data.DB2.iSeries.iDB2Connection = New IBM.Data.DB2.iSeries.iDB2Connection(connectionString)

    Dim proc As String = "GetCatInfo"

    Dim dbCmd As IBM.Data.DB2.iSeries.iDB2Command = New IBM.Data.DB2.iSeries.iDB2Command

    dbCmd.CommandText = proc

    dbCmd.CommandType = Data.CommandType.StoredProcedure

    dbCmd.Connection = cnn

    Dim dbParam_ID As System.Data.IDataParameter = New IBM.Data.DB2.iSeries.iDB2Parameter

    dbParam_ID.ParameterName = "@.CatID"

    dbParam_ID.Value = CatID

    dbParam_ID.DbType = Data.DbType.Int32

    dbParam_ID.Direction = Data.ParameterDirection.Input

    dbCmd.Parameters.Add(dbParam_ID)

    Dim dataAdapter As IBM.Data.DB2.iSeries.iDB2DataAdapter = New IBM.Data.DB2.iSeries.iDB2DataAdapter

    Dim dataSet As System.Data.DataSet = New System.Data.DataSet

    dataAdapter.SelectCommand = dbCmd

    dataAdapter.Fill(dataSet)

    dbCmd.Dispose()

    cnn.Close()

    Return dataSet

    End Function

    3. Then in your asp page where the grid view create a Object datasource, unclick the Show only data components to expose you class name, then click next and choose you approiate method and finally define your parameter(s).

    These Rebooks helped a lot:

    1. IBM Redbook Stored Procedures, Triggers, and User-Defined Functions on DB2 Universal Database for iSeries

    2. Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET

    Good Luck

    |||

    Are you using the Report Designer?

    In my Dataset definition I've defined my Name, Data Source, Command Type as 'Stored Procedure' and in the Query String I put the name of the stored procedure. When I execute it responds with

    TITLE: Microsoft Report Designer

    An error occurred while executing the query.
    Object reference not set to an instance of an object.


    ADDITIONAL INFORMATION:

    Object reference not set to an instance of an object. (System.Data)


    BUTTONS:

    OK

    I know it finds the store procedure, becuase at first I had a typo and the error message stated it could not find it. When I fix the typo I recieved the above error message. Here is the stored procedure:

    BEGIN
    DECLARE C1 CURSOR FOR
    SELECT PEMS . EMS1548 . EMSDCO , PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT , PEMS . FUELDET . FUDTYP , PEMS . FUELDET . FUDFQ AS GALS , PEMS . FUELDET . FUDFD AS DOLS , PEMS . FUELDET . FUDDAT
    FROM PEMS . EMS1548 , PEMS . EMS1547 , PEMS . FUELDET
    WHERE PEMS . EMS1548 . EMSDCO = PEMS . EMS1547 . EMSDPT AND PEMS . EMS1547 . EMSIDC = PEMS . FUELDET . FUDIDX AND
    ( PEMS . FUELDET . FUDTYP IN ( 'UNL' , 'DSL' ) ) AND ( PEMS . FUELDET . FUDEQT IN ( '022406' , '016460' , '026352' , '017068' , '023207' , '021870' , '019334' , '022754' , '020608' , '019337' ) )
    ORDER BY PEMS . EMS1548 . EMSDDE , PEMS . FUELDET . FUDEQT ;
    OPEN C1 ;
    END

    Any ideas would be appreciated.

    |||

    I found the solution:

    I was missing "RESULT SET 1" before the LANGUAGE SQL and "SET RESULT SETS CURSOR C1;" after the OPEN C1; statement

    Friday, March 23, 2012

    ODBC connection to SQL Server

    I use Business Objects XI R2 (BOXI) to report against a SQL Server 2000 database using an ODBC connection.
    When I query the database using Enterprise Manager on the server I can make use of all functions available within SQL Server, yet when I access it via the ODBC connection I only get a very small subset of SQL Server functions available.

    I can use the inbuilt BOXI functions, which work on the data locally, but would like the functions processed on the server instead.

    Is this constraint a property of the ODBC driver, and if so are there other drivers which would expose all of the available SQL Server functions.

    Any suggestions appreciated.

    Hi Farengi,

    When you refer to "functions available within SQL Server", do you mean stored procedures and user-defined functions? Or you mean the GUI-related features like graphic query design?

    If we are talking about the stored procs and user-defined functions, there's no limitation per client. In fact, Enterprise Manager uses ODBC under the hood. :-)

    However, the stored procs and functions are just database objects - they have permissions granted to them for the appropriate user. Are you using the same login/user in Enterprise Manager as well as in BOXI? In addition, don't forget that the names of the procs and functions is also related to their owner, thus dbo.usp_MyProc is different from JivkoD.usp_MyProc.

    If you are referring to the GUI-related features, unfortunately they are specific to the Enterprise Manager and are not exposed to different client applications.

    HTH,
    Jivko Dobrev - MSFT
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    |||Hi Jivko,

    Thank you for your extensive answer.

    Sorry about the delay in responding to you, but I have been attending some advanced BO courses and my question, which I may not have stated correctly, was answered.

    The functions I wanted to refer to (eg. max, min, stdev, stdevp, var, varp etc.) in my question, are displayed in the Business Objects sql builder interface only if they are contained in a .prm (parameter) file. This file is supplied with a frequently used subset of sql server functions, but it can be edited and added to. All that this file does is to present a list of functions to the interface.

    The functions, which don't appear in the interface, can still be used in a sql statement as long as they are valid functions.

    Thanks

    ODBC connection to SQL Server

    I use Business Objects XI R2 (BOXI) to report against a SQL Server 2000 database using an ODBC connection.
    When I query the database using Enterprise Manager on the server I can make use of all functions available within SQL Server, yet when I access it via the ODBC connection I only get a very small subset of SQL Server functions available.

    I can use the inbuilt BOXI functions, which work on the data locally, but would like the functions processed on the server instead.

    Is this constraint a property of the ODBC driver, and if so are there other drivers which would expose all of the available SQL Server functions.

    Any suggestions appreciated.

    Hi Farengi,

    When you refer to "functions available within SQL Server", do you mean stored procedures and user-defined functions? Or you mean the GUI-related features like graphic query design?

    If we are talking about the stored procs and user-defined functions, there's no limitation per client. In fact, Enterprise Manager uses ODBC under the hood. :-)

    However, the stored procs and functions are just database objects - they have permissions granted to them for the appropriate user. Are you using the same login/user in Enterprise Manager as well as in BOXI? In addition, don't forget that the names of the procs and functions is also related to their owner, thus dbo.usp_MyProc is different from JivkoD.usp_MyProc.

    If you are referring to the GUI-related features, unfortunately they are specific to the Enterprise Manager and are not exposed to different client applications.

    HTH,
    Jivko Dobrev - MSFT
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    |||Hi Jivko,

    Thank you for your extensive answer.

    Sorry about the delay in responding to you, but I have been attending some advanced BO courses and my question, which I may not have stated correctly, was answered.

    The functions I wanted to refer to (eg. max, min, stdev, stdevp, var, varp etc.) in my question, are displayed in the Business Objects sql builder interface only if they are contained in a .prm (parameter) file. This file is supplied with a frequently used subset of sql server functions, but it can be edited and added to. All that this file does is to present a list of functions to the interface.

    The functions, which don't appear in the interface, can still be used in a sql statement as long as they are valid functions.

    Thanks

    Wednesday, March 21, 2012

    ODBC connection

    I am trying to connect to SQL Server using a 3rd party report generating software (dbextra). Everything is located on my local box. I am trying to establish connection through ODBC. Is this installed during setup or is this a function I have to manually set up and configure?

    ODBC connections are defined in the "Data Sources (ODBC)" option in the system's "Administrative Tools". You have to set these up manually. Once done, you point the software to the "name" of the ODBC data source you've created.

    -Ryan / Kardax

    |||

    You can connect using ODBC right out of the box through two different paths:

    MDAC is already on your Windows computers, you write a normal ODBC connection string for SQL. This typcially uses TCP/IP, so you will need to enable the TCP/IP protocol in SQL Server (it's off by default) using SQL Configuration Manager.

    Friday, March 9, 2012

    OCI-22053: overflow error

    I have a report that runs the following in it's query: " (SELECT cast(d
    .ACT_DT as TIMESTAMP)
    FROM GPROD.VSL_ACT d
    WHERE d .ses_num = gprod.vsl_act.ses_num
    AND d .seq_num = gprod.vsl_act.seq_num AND d .act_dt > gprod.vsl_act.act_dt
    AND
    ROWNUM <= 1 AND d
    .ACT_TYP_TXT = 'DEPS') - CAST(act_dt AS TIMESTAMP) ElpsTime,
    (to_date(to_char((SELECT cast(d .ACT_DT as TIMESTAMP)
    FROM GPROD.VSL_ACT d
    WHERE d .ses_num = gprod.vsl_act.ses_num
    AND d .seq_num = gprod.vsl_act.seq_num AND d .act_dt > gprod.vsl_act.act_dt
    AND
    ROWNUM <= 1 AND d
    .ACT_TYP_TXT = 'DEPS'),'mm/dd/yyyy hh24:mi:ss'), 'mm/dd/yyyy
    hh24:mi:ss')-to_date(to_char(act_dt,'mm/dd/yyyy hh24:mi:ss'), 'mm/dd/yyyy
    hh24:mi:ss')) * 24 * 60 * 60 sum_seconds"
    Basically, this takes two date fields, subtracting one from the other. It
    works 99% of the time, but for some records, it get #ERROR in this calculated
    field. I look at the data, and it makes no sense because I get the error
    when the difference could be 10 seconds, or 3 minutes, or whatever. I don't
    see any logic to it. The database is an Oracle 10g database. I am using VS
    2005 sp1. I have created a new project as per a previous post, but still get
    the error. Here is the full error:
    The data set â'dsShuntâ' contains a definition for the Field â'SUM_SECONDSâ'.
    The data extension returned an error during reading the field.
    System.Data.OracleClient.OracleException: OCI-22053: overflow error
    Thanks for any help.
    Darryl.On Apr 11, 7:14 am, Darryl <Dar...@.discussions.microsoft.com> wrote:
    > I have a report that runs the following in it's query: " (SELECT cast(d
    > .ACT_DT as TIMESTAMP)
    > FROM GPROD.VSL_ACT d
    > WHERE d .ses_num = gprod.vsl_act.ses_num
    > AND d .seq_num = gprod.vsl_act.seq_num AND d .act_dt > gprod.vsl_act.act_dt
    > AND
    > ROWNUM <= 1 AND d
    > .ACT_TYP_TXT = 'DEPS') - CAST(act_dt AS TIMESTAMP) ElpsTime,
    > (to_date(to_char((SELECT cast(d .ACT_DT as TIMESTAMP)
    > FROM GPROD.VSL_ACT d
    > WHERE d .ses_num = gprod.vsl_act.ses_num
    > AND d .seq_num = gprod.vsl_act.seq_num AND d .act_dt > gprod.vsl_act.act_dt
    > AND
    > ROWNUM <= 1 AND d
    > .ACT_TYP_TXT = 'DEPS'),'mm/dd/yyyy hh24:mi:ss'), 'mm/dd/yyyy
    > hh24:mi:ss')-to_date(to_char(act_dt,'mm/dd/yyyy hh24:mi:ss'), 'mm/dd/yyyy
    > hh24:mi:ss')) * 24 * 60 * 60 sum_seconds"
    > Basically, this takes two date fields, subtracting one from the other. It
    > works 99% of the time, but for some records, it get #ERROR in this calculated
    > field. I look at the data, and it makes no sense because I get the error
    > when the difference could be 10 seconds, or 3 minutes, or whatever. I don't
    > see any logic to it. The database is an Oracle 10g database. I am using VS
    > 2005 sp1. I have created a new project as per a previous post, but still get
    > the error. Here is the full error:
    > The data set 'dsShunt' contains a definition for the Field 'SUM_SECONDS'.
    > The data extension returned an error during reading the field.
    > System.Data.OracleClient.OracleException: OCI-22053: overflow error
    > Thanks for any help.
    > Darryl.
    This link might provide some insight:
    http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/browse_thread/thread/185b831ab7a267b0/c0106784db18d83f?lnk=st&q=System.Data.OracleClient.OracleException%3A+OCI-22053%3A+overflow+error&rnum=3#c0106784db18d83f
    Regards,
    Enrique Martinez
    Sr. Software Consultant

    Wednesday, March 7, 2012

    Obtaining Running Totals

    I am working on a report and need to figure out a way to come up with
    running totals based on a column value. Let me explain...
    As shown in the query below, I am displaying "totalmealsize", "minmealsize",
    and "maxmealsize" for a particular interval number (which can be anywhere
    between 1 and 24). What I would like to do is display a running total for
    each interval that summarizes all previous intervals. For example, given
    the following data:
    INTERVAL TOTAL RUNNING-TOTAL
    1 5 5
    2 3 8
    3 1 9
    4 7 16
    5 4 20
    As you can see, the RUNNING-TOTAL is the sum of all previous interval values
    (I would want to do something similar with the min/max values as well). I
    have tried various things but have not succeeded. I realize I can do this
    in (C#) code as well as probably even create a user-defined function to
    handle it. However, I would like to keep it in standard SQL if possible.
    Any ideas?
    <BEGIN SQL QUERY>
    SELECT t.Name, tl.Level, id.sequencenumber, id.intervalnumber,
    id.RunAnimalID,
    id.totalmealsize AS SMS, id.minmealsize AS SMS_MIN, id.maxmealsize
    AS SMS_MAX
    FROM intervaldetail id
    INNER JOIN TreatmentLevel tl ON id.RunAnimalID = tl.RunAnimalID
    INNER JOIN Treatment t on t.TreatmentID = tl.TreatmentID
    WHERE id.intervalsetid = 99
    ORDER BY t.Name, tl.Level, id.sequencenumber
    <END SQL QUERY>
    -- Thanks, JeffTry this
    Declare @.t table(INTERVAL int, TOTAL integer)
    insert into @.T values(1,5)
    insert into @.T values(2,3)
    insert into @.T values(3,1)
    insert into @.T values(4,7)
    insert into @.T values(5,4)
    select *,(select sum(total) from @.t where interval <=T.Interval) as
    'Running Total' from @.t T
    Madhivanan|||Here is a repro,
    CREATE TABLE #Totals(ID int IDENTITY(1,1), total int)
    INSERT INTO #Totals VALUES(100)
    INSERT INTO #Totals VALUES(200)
    INSERT INTO #Totals VALUES(300)
    INSERT INTO #Totals VALUES(400)
    SELECT A.ID , A.Total,(SELECT SUM(total)
    FROM #Totals B WHERE B.ID <=A.ID) As RunningTotal
    FROM #Totals A
    DROP TABLE #Totals
    Roji. P. Thomas
    Net Asset Management
    https://www.netassetmanagement.com
    "Jeff B." <jsb@.community.nospam> wrote in message
    news:e6k6GiVHFHA.1476@.TK2MSFTNGP09.phx.gbl...
    >I am working on a report and need to figure out a way to come up with
    >running totals based on a column value. Let me explain...
    > As shown in the query below, I am displaying "totalmealsize",
    > "minmealsize", and "maxmealsize" for a particular interval number (which
    > can be anywhere between 1 and 24). What I would like to do is display a
    > running total for each interval that summarizes all previous intervals.
    > For example, given the following data:
    > INTERVAL TOTAL RUNNING-TOTAL
    > 1 5 5
    > 2 3 8
    > 3 1 9
    > 4 7 16
    > 5 4 20
    > As you can see, the RUNNING-TOTAL is the sum of all previous interval
    > values (I would want to do something similar with the min/max values as
    > well). I have tried various things but have not succeeded. I realize I
    > can do this in (C#) code as well as probably even create a user-defined
    > function to handle it. However, I would like to keep it in standard SQL
    > if possible.
    > Any ideas?
    > <BEGIN SQL QUERY>
    > SELECT t.Name, tl.Level, id.sequencenumber, id.intervalnumber,
    > id.RunAnimalID,
    > id.totalmealsize AS SMS, id.minmealsize AS SMS_MIN, id.maxmealsize
    > AS SMS_MAX
    > FROM intervaldetail id
    > INNER JOIN TreatmentLevel tl ON id.RunAnimalID = tl.RunAnimalID
    > INNER JOIN Treatment t on t.TreatmentID = tl.TreatmentID
    > WHERE id.intervalsetid = 99
    > ORDER BY t.Name, tl.Level, id.sequencenumber
    > <END SQL QUERY>
    > -- Thanks, Jeff
    >|||Thanks everyone for your replies. The subquery did the trick. I had tried
    that one before but I must have had the syntax wrong because I wasn't able
    to get it to work. Now it is working just fine.
    -- Thanks, Jeff
    "Jeff B." <jsb@.community.nospam> wrote in message
    news:e6k6GiVHFHA.1476@.TK2MSFTNGP09.phx.gbl...
    >I am working on a report and need to figure out a way to come up with
    >running totals based on a column value. Let me explain...
    > As shown in the query below, I am displaying "totalmealsize",
    > "minmealsize", and "maxmealsize" for a particular interval number (which
    > can be anywhere between 1 and 24). What I would like to do is display a
    > running total for each interval that summarizes all previous intervals.
    > For example, given the following data:
    > INTERVAL TOTAL RUNNING-TOTAL
    > 1 5 5
    > 2 3 8
    > 3 1 9
    > 4 7 16
    > 5 4 20
    > As you can see, the RUNNING-TOTAL is the sum of all previous interval
    > values (I would want to do something similar with the min/max values as
    > well). I have tried various things but have not succeeded. I realize I
    > can do this in (C#) code as well as probably even create a user-defined
    > function to handle it. However, I would like to keep it in standard SQL
    > if possible.
    > Any ideas?
    > <BEGIN SQL QUERY>
    > SELECT t.Name, tl.Level, id.sequencenumber, id.intervalnumber,
    > id.RunAnimalID,
    > id.totalmealsize AS SMS, id.minmealsize AS SMS_MIN, id.maxmealsize
    > AS SMS_MAX
    > FROM intervaldetail id
    > INNER JOIN TreatmentLevel tl ON id.RunAnimalID = tl.RunAnimalID
    > INNER JOIN Treatment t on t.TreatmentID = tl.TreatmentID
    > WHERE id.intervalsetid = 99
    > ORDER BY t.Name, tl.Level, id.sequencenumber
    > <END SQL QUERY>
    > -- Thanks, Jeff

    obtaining an image from another server

    Hello,
    My report gets an image off another server. It works fine in testing, but
    when I deploy it to my production server the image doesnt show up. I put a
    try/catch around the code and output the error to a text field in my report,
    only to see the following:
    System.UnauthorizedAccessException: Access to the path
    \\server\domain\Applications\myApp\Pictures is denied. at
    System.IO.__Error.WinIOError(Int32 errorCode, String str) at
    System.IO.Directory.InternalGetFileDirectoryNames(String fullPath, String
    userPath, Boolean file) at System.IO.Directory.InternalGetFiles(String path,
    String userPath, String searchPattern) at
    System.IO.Directory.GetFiles(String path, String searchPattern) at
    CustomCodeProxy.test(Int32 PartID)
    The user that is running the report is myself. I have access to the server.
    I'm using the code section in the report (I created a function called
    test()) and within that I'm using System.IO.Directory.GetFiles to see if the
    file exists.I should also mention that I'm displaying the image from a virtual
    directory, but sometimes the image doesnt exist, which is why I'm trying to
    check to see if it exists, but GetFiles doesnt accept URLs.
    Is there any way around this? There should be a "noimage" property for
    images just like theres a "norow" property for rows
    "Brandon" <broberts@.presstran.com> wrote in message
    news:eGMxMvFRGHA.256@.TK2MSFTNGP14.phx.gbl...
    > Hello,
    > My report gets an image off another server. It works fine in testing, but
    > when I deploy it to my production server the image doesnt show up. I put
    > a try/catch around the code and output the error to a text field in my
    > report, only to see the following:
    >
    > System.UnauthorizedAccessException: Access to the path
    > \\server\domain\Applications\myApp\Pictures is denied. at
    > System.IO.__Error.WinIOError(Int32 errorCode, String str) at
    > System.IO.Directory.InternalGetFileDirectoryNames(String fullPath, String
    > userPath, Boolean file) at System.IO.Directory.InternalGetFiles(String
    > path, String userPath, String searchPattern) at
    > System.IO.Directory.GetFiles(String path, String searchPattern) at
    > CustomCodeProxy.test(Int32 PartID)
    >
    > The user that is running the report is myself. I have access to the
    > server.
    >
    > I'm using the code section in the report (I created a function called
    > test()) and within that I'm using System.IO.Directory.GetFiles to see if
    > the file exists.
    >

    Friday, February 24, 2012

    Obtaining a report with alters of a table

    Thank in advance!
    I need to know how Can I obtanin a report or log of alters and deletes in
    some tables in a time period?Hi
    Use sql profiler
    Under the Filters tab
    set Object ID equals to the id of the table you want to audit
    set text data like 'alter%, 'delete%
    Hope this help
    Regards
    VT
    Knowledge is power, share it...
    http://oneplace4sql.blogspot.com/
    "Nacho" <Nacho@.discussions.microsoft.com> wrote in message
    news:93E9178F-6DC9-4C42-9309-760123EB7F78@.microsoft.com...
    > Thank in advance!
    > I need to know how Can I obtanin a report or log of alters and deletes in
    > some tables in a time period?|||Is it for Audit trail? Or you just want to have to monitor it onces in a
    while to check what is happening in the system?
    If for audit, you can create a new table and populate it with the
    information from the table affect with an After Update, Delete trigger on
    table in question. This way you can history going far back as possible. As
    in new table you can track time the delete/update happened and by whom.
    If it's just onces in a while thing then VT's suggestion works ;-).
    Thanks!
    --
    Mohit K. Gupta
    B.Sc. CS, Minor Japanese
    MCTS: SQL Server 2005
    "Nacho" wrote:

    > Thank in advance!
    > I need to know how Can I obtanin a report or log of alters and deletes in
    > some tables in a time period?

    Obtaining a report with alters of a table

    Thank in advance!
    I need to know how Can I obtanin a report or log of alters and deletes in
    some tables in a time period?
    Is it for Audit trail? Or you just want to have to monitor it onces in a
    while to check what is happening in the system?
    If for audit, you can create a new table and populate it with the
    information from the table affect with an After Update, Delete trigger on
    table in question. This way you can history going far back as possible. As
    in new table you can track time the delete/update happened and by whom.
    If it's just onces in a while thing then VT's suggestion works ;-).
    Thanks!
    Mohit K. Gupta
    B.Sc. CS, Minor Japanese
    MCTS: SQL Server 2005
    "Nacho" wrote:

    > Thank in advance!
    > I need to know how Can I obtanin a report or log of alters and deletes in
    > some tables in a time period?

    Obtaining a report with alters of a table

    Thank in advance!
    I need to know how Can I obtanin a report or log of alters and deletes in
    some tables in a time period?Hi
    Use sql profiler
    Under the Filters tab
    set Object ID equals to the id of the table you want to audit
    set text data like 'alter%, 'delete%
    Hope this help
    Regards
    VT
    Knowledge is power, share it...
    http://oneplace4sql.blogspot.com/
    "Nacho" <Nacho@.discussions.microsoft.com> wrote in message
    news:93E9178F-6DC9-4C42-9309-760123EB7F78@.microsoft.com...
    > Thank in advance!
    > I need to know how Can I obtanin a report or log of alters and deletes in
    > some tables in a time period?|||Is it for Audit trail? Or you just want to have to monitor it onces in a
    while to check what is happening in the system?
    If for audit, you can create a new table and populate it with the
    information from the table affect with an After Update, Delete trigger on
    table in question. This way you can history going far back as possible. As
    in new table you can track time the delete/update happened and by whom.
    If it's just onces in a while thing then VT's suggestion works ;-).
    Thanks!
    --
    Mohit K. Gupta
    B.Sc. CS, Minor Japanese
    MCTS: SQL Server 2005
    "Nacho" wrote:
    > Thank in advance!
    > I need to know how Can I obtanin a report or log of alters and deletes in
    > some tables in a time period?

    Obtain the sql server properties by code...

    Hi,
    a need to make a report wich contains the most of properties o an instance o
    SQL Server 2000. The same information that appears on the SQL Server
    Properties in the Enterprise Manager.
    I have 25 servers and I wonder if I can get that information by a
    Transact.SQL Server script. I try to do that and I got some information but
    other like autentication mode, startup service account, audit level I can′t
    .
    thanks in advance...
    ChevyThose settings are in the registry. You will have to get then with
    xp_regread.
    Jason Massie
    www: http://statisticsio.com
    rss: http://statisticsio.com/Home/tabid/.../1/Default.aspx
    "Chevy" <Chevy@.discussions.microsoft.com> wrote in message
    news:230B88E2-13EE-4E33-84D5-D8FD01348B45@.microsoft.com...
    > Hi,
    > a need to make a report wich contains the most of properties o an instance
    > o
    > SQL Server 2000. The same information that appears on the SQL Server
    > Properties in the Enterprise Manager.
    > I have 25 servers and I wonder if I can get that information by a
    > Transact.SQL Server script. I try to do that and I got some information
    > but
    > other like autentication mode, startup service account, audit level I
    > can′t.
    > thanks in advance...
    > --
    > Chevy|||Chevy
    http://dimantdatabasesolutions.blog...er.ht
    ml
    "Chevy" <Chevy@.discussions.microsoft.com> wrote in message
    news:230B88E2-13EE-4E33-84D5-D8FD01348B45@.microsoft.com...
    > Hi,
    > a need to make a report wich contains the most of properties o an instance
    > o
    > SQL Server 2000. The same information that appears on the SQL Server
    > Properties in the Enterprise Manager.
    > I have 25 servers and I wonder if I can get that information by a
    > Transact.SQL Server script. I try to do that and I got some information
    > but
    > other like autentication mode, startup service account, audit level I
    > cant.
    > thanks in advance...
    > --
    > Chevy

    Obtain the sql server properties by code...

    Hi,
    a need to make a report wich contains the most of properties o an instance o
    SQL Server 2000. The same information that appears on the SQL Server
    Properties in the Enterprise Manager.
    I have 25 servers and I wonder if I can get that information by a
    Transact.SQL Server script. I try to do that and I got some information but
    other like autentication mode, startup service account, audit level I can′t.
    thanks in advance...
    Chevy
    Those settings are in the registry. You will have to get then with
    xp_regread.
    Jason Massie
    www: http://statisticsio.com
    rss: http://statisticsio.com/Home/tabid/36/rssid/1/Default.aspx
    "Chevy" <Chevy@.discussions.microsoft.com> wrote in message
    news:230B88E2-13EE-4E33-84D5-D8FD01348B45@.microsoft.com...
    > Hi,
    > a need to make a report wich contains the most of properties o an instance
    > o
    > SQL Server 2000. The same information that appears on the SQL Server
    > Properties in the Enterprise Manager.
    > I have 25 servers and I wonder if I can get that information by a
    > Transact.SQL Server script. I try to do that and I got some information
    > but
    > other like autentication mode, startup service account, audit level I
    > can′t.
    > thanks in advance...
    > --
    > Chevy
    |||Chevy
    http://dimantdatabasesolutions.blogspot.com/2007/04/whats-version-of-sql-server.html
    "Chevy" <Chevy@.discussions.microsoft.com> wrote in message
    news:230B88E2-13EE-4E33-84D5-D8FD01348B45@.microsoft.com...
    > Hi,
    > a need to make a report wich contains the most of properties o an instance
    > o
    > SQL Server 2000. The same information that appears on the SQL Server
    > Properties in the Enterprise Manager.
    > I have 25 servers and I wonder if I can get that information by a
    > Transact.SQL Server script. I try to do that and I got some information
    > but
    > other like autentication mode, startup service account, audit level I
    > cant.
    > thanks in advance...
    > --
    > Chevy

    Obtain the sql server properties by code...

    Hi,
    a need to make a report wich contains the most of properties o an instance o
    SQL Server 2000. The same information that appears on the SQL Server
    Properties in the Enterprise Manager.
    I have 25 servers and I wonder if I can get that information by a
    Transact.SQL Server script. I try to do that and I got some information but
    other like autentication mode, startup service account, audit level I can´t.
    thanks in advance...
    --
    ChevyThose settings are in the registry. You will have to get then with
    xp_regread.
    --
    Jason Massie
    www: http://statisticsio.com
    rss: http://statisticsio.com/Home/tabid/36/rssid/1/Default.aspx
    "Chevy" <Chevy@.discussions.microsoft.com> wrote in message
    news:230B88E2-13EE-4E33-84D5-D8FD01348B45@.microsoft.com...
    > Hi,
    > a need to make a report wich contains the most of properties o an instance
    > o
    > SQL Server 2000. The same information that appears on the SQL Server
    > Properties in the Enterprise Manager.
    > I have 25 servers and I wonder if I can get that information by a
    > Transact.SQL Server script. I try to do that and I got some information
    > but
    > other like autentication mode, startup service account, audit level I
    > can´t.
    > thanks in advance...
    > --
    > Chevy|||Chevy
    http://dimantdatabasesolutions.blogspot.com/2007/04/whats-version-of-sql-server.html
    "Chevy" <Chevy@.discussions.microsoft.com> wrote in message
    news:230B88E2-13EE-4E33-84D5-D8FD01348B45@.microsoft.com...
    > Hi,
    > a need to make a report wich contains the most of properties o an instance
    > o
    > SQL Server 2000. The same information that appears on the SQL Server
    > Properties in the Enterprise Manager.
    > I have 25 servers and I wonder if I can get that information by a
    > Transact.SQL Server script. I try to do that and I got some information
    > but
    > other like autentication mode, startup service account, audit level I
    > can´t.
    > thanks in advance...
    > --
    > Chevy

    obtain the name and path of a report

    how to save the name and the path of a report on my database when the user click save report

    Does this cover what you need?

    http://msdn2.microsoft.com/en-us/ms155836.aspx

    |||

    I need something that doesn't depend on a stored procedure or manual procedure.
    I need to execute something when the user saves the report; something that returns the path for this report.
    I need to generate in my website all paths for reports recently saved.

    thanks again and I′ll be waiting for your answer

    Regards

    |||

    What is "recently saved?" Is it time-bound? Why not use the SOAP API ListItems() and get the created date for every report in the catalog, and then filter for the ones which were recently created?

    There is no supported way to inject your own code into the CreateReport() API which is used to publish reports.

    |||

    Let me try to be a little more specific. What I want is to be able to "catch" the event where the user saves or closes the report, so that I can create the related class, and it has to be right when it happens, it can′t be later. It would also be useful if the event could identify the name and path of the report I just created. I am sorry if I am not able to be a little more clear regarding this subject, but I hope you understand what I want, and if there is no way to do it just let me know either way.

    |||

    There is no built-in way of doing this via reporting services.

    |||

    and with reporting services extensions?

    or is there another possible way to do this?

    |||

    Though you can't do this generically, you can provide a custom user interface for your users to access reports. In this way, you can determine when users click on reports or when they navigate away from them. The RS SOAP API allows you to expose all of the same functionality as you see in SQL Server Management Studio or Report Manager.

    RS Extensions do not help you in this respect.

    Not entirely sure what you want this kind of behavior for...

    -Lukasz

    Monday, February 20, 2012

    ObjectDataSource not passing parameter to report viewer stored proc (sql server)

    I have an ObjectDataSource feeding data to a report viewer control, but when I try to give the objectdatasource a parameter it should be expecting (based on the stored proc that's pulling the data) and the GetData method in the XSD file, I get the error:
    An error has occurred during report processing.ObjectDataSource 'ObjectDataSource2' could not find a non-generic method 'GetData' that has parameters: Date.The table adapter in the XDS shows GetData(@.Date), and I'm trying to bind the objectdatasource to my report viewer like this:

    PlaceHolder1.Controls.Clear()
    Dim rv As New Microsoft.Reporting.WebForms.ReportViewer
    PlaceHolder1.Controls.Add(rv)
    rv.LocalReport.DataSources.Clear()
    ObjectDataSource2.TypeName = "DS_ClosedProjectsSnap2TableAdapters.reports_closedin7days_2TableAdapter"
    ObjectDataSource2.SelectParameters.Clear()
    ObjectDataSource2.SelectParameters.Add("Date", d_collectiondate.SelectedValue)
    ObjectDataSource2.DataBind()
    rv.LocalReport.ReportPath = "secure\reports\ClosedProjectsSnap.rdlc"
    rv.LocalReport.EnableHyperlinks = True
    rv.LocalReport.DataSources.Clear()
    rv.ProcessingMode = ProcessingMode.Local
    rv.LocalReport.DataSources.Add(New ReportDataSource("DS_ClosedProjectsSnap2_reports_closedin7days_2", ObjectDataSource2))
    rv.DataBind()

    I can't see why this wouldn't work, so I would really appreciate any ideas anybody has.

    Thanks

    I used to have this error, but all I did to fix it was configure the datasource and make sure each paramter was assigned to textbox controls which i added above the ReportViewer.