Showing posts with label urgent. Show all posts
Showing posts with label urgent. Show all posts

Monday, March 26, 2012

Passing list values in drill through! URGENT

I have a custom list(say a list for account numbers, account numbers starting with 13 form a group, then starting with 14 form a group and like that)

and then there are tables inside this list. the report will be displayed based on the values of this custom list.

i also have a drill through report for this. now when i pass fields!accountnumber.uniquename for this list only the first of the group values say 130001 is selected..

what shud i do to select the whole grp?

thanks!

Any workaround on this?

|||

R4BI wrote:

Any workaround on this?

Not sure if this will work but you might try Join(Parameters!accountnumber.Value,",")

|||

let me again explain the scenario:

Main report: One list which is group by a field customaccountnumber.

CustomAccountNumber is formed like this: IIF(left(Accountnumber),2) ="13", 130000 grp , IIF(left(Accountnumber),2) ="14", 140000 grp ,IIF(left(Accountnumber),2) ="15", 150000 grp ,other grps)))

All the tables inside the list are displayed based on the CustomAccountNumber.

SubReport: This report has one of the parameter Accountnumber

Now, Currently from the main report navigation property i am passing ""fields!accountnumber.uniquename"" as the value for this parameter then the subreport gets only the first grp value e.g. 130001 if clicked on the table based on 130000 grp.

What to do so that it gets the whole grp of values?

Please look at it.. I am desperately looking for a solution.

Thanks,

|||

Rohit,

Have you found your solution yet? If not, please post your SQL code and I'll try to assist you.

Passing list values in drill through! URGENT

I have a custom list(say a list for account numbers, account numbers starting with 13 form a group, then starting with 14 form a group and like that)

and then there are tables inside this list. the report will be displayed based on the values of this custom list.

i also have a drill through report for this. now when i pass fields!accountnumber.uniquename for this list only the first of the group values say 130001 is selected..

what shud i do to select the whole grp?

thanks!

Any workaround on this?

|||

R4BI wrote:

Any workaround on this?

Not sure if this will work but you might try Join(Parameters!accountnumber.Value,",")

|||

let me again explain the scenario:

Main report: One list which is group by a field customaccountnumber.

CustomAccountNumber is formed like this: IIF(left(Accountnumber),2) ="13", 130000 grp , IIF(left(Accountnumber),2) ="14", 140000 grp ,IIF(left(Accountnumber),2) ="15", 150000 grp ,other grps)))

All the tables inside the list are displayed based on the CustomAccountNumber.

SubReport: This report has one of the parameter Accountnumber

Now, Currently from the main report navigation property i am passing ""fields!accountnumber.uniquename"" as the value for this parameter then the subreport gets only the first grp value e.g. 130001 if clicked on the table based on 130000 grp.

What to do so that it gets the whole grp of values?

Please look at it.. I am desperately looking for a solution.

Thanks,

|||

Rohit,

Have you found your solution yet? If not, please post your SQL code and I'll try to assist you.

sql

Passing list values in drill through! URGENT

I have a custom list(say a list for account numbers, account numbers starting with 13 form a group, then starting with 14 form a group and like that)

and then there are tables inside this list. the report will be displayed based on the values of this custom list.

i also have a drill through report for this. now when i pass fields!accountnumber.uniquename for this list only the first of the group values say 130001 is selected..

what shud i do to select the whole grp?

thanks!

Any workaround on this?

|||

R4BI wrote:

Any workaround on this?

Not sure if this will work but you might try Join(Parameters!accountnumber.Value,",")

|||

let me again explain the scenario:

Main report: One list which is group by a field customaccountnumber.

CustomAccountNumber is formed like this: IIF(left(Accountnumber),2) ="13", 130000 grp , IIF(left(Accountnumber),2) ="14", 140000 grp ,IIF(left(Accountnumber),2) ="15", 150000 grp ,other grps)))

All the tables inside the list are displayed based on the CustomAccountNumber.

SubReport: This report has one of the parameter Accountnumber

Now, Currently from the main report navigation property i am passing ""fields!accountnumber.uniquename"" as the value for this parameter then the subreport gets only the first grp value e.g. 130001 if clicked on the table based on 130000 grp.

What to do so that it gets the whole grp of values?

Please look at it.. I am desperately looking for a solution.

Thanks,

|||

Rohit,

Have you found your solution yet? If not, please post your SQL code and I'll try to assist you.

Passing list values in drill through! URGENT

I have a custom list(say a list for account numbers, account numbers starting with 13 form a group, then starting with 14 form a group and like that)

and then there are tables inside this list. the report will be displayed based on the values of this custom list.

i also have a drill through report for this. now when i pass fields!accountnumber.uniquename for this list only the first of the group values say 130001 is selected..

what shud i do to select the whole grp?

thanks!

Any workaround on this?

|||

R4BI wrote:

Any workaround on this?

Not sure if this will work but you might try Join(Parameters!accountnumber.Value,",")

|||

let me again explain the scenario:

Main report: One list which is group by a field customaccountnumber.

CustomAccountNumber is formed like this: IIF(left(Accountnumber),2) ="13", 130000 grp , IIF(left(Accountnumber),2) ="14", 140000 grp ,IIF(left(Accountnumber),2) ="15", 150000 grp ,other grps)))

All the tables inside the list are displayed based on the CustomAccountNumber.

SubReport: This report has one of the parameter Accountnumber

Now, Currently from the main report navigation property i am passing ""fields!accountnumber.uniquename"" as the value for this parameter then the subreport gets only the first grp value e.g. 130001 if clicked on the table based on 130000 grp.

What to do so that it gets the whole grp of values?

Please look at it.. I am desperately looking for a solution.

Thanks,

|||

Rohit,

Have you found your solution yet? If not, please post your SQL code and I'll try to assist you.

Friday, March 23, 2012

Passing Date as aparameter to linked report from Parent report and then Dates format is Au

Hi
I need one urgent help.
When Passing Date as aparameter to linked report from Parent report,
the format of date is Automatically changing from dd/mm/yy to mm/dd/
yy. How to restrict it?
What is the solution for it in SP or rdl?
TIA.
PuneetPuneet,
Maybe you can also pass a parameter with the desired format, like "dd/mm/yy"
(this can be kept as a parameter in your application or database, so you can
change it dynamically).
Then, in the subreport, use formatting to display the date using the desired
format.
Andrei.
"appu" <ajmera.puneet@.gmail.com> wrote in message
news:1192120804.765315.73850@.o80g2000hse.googlegroups.com...
> Hi
> I need one urgent help.
> When Passing Date as aparameter to linked report from Parent report,
> the format of date is Automatically changing from dd/mm/yy to mm/dd/
> yy. How to restrict it?
> What is the solution for it in SP or rdl?
> TIA.
> Puneet
>

Tuesday, March 20, 2012

Passing a value to another stored procedure...need urgent help

Hi i have been working on these stored procedures for what seems like ages now and i just cant understand why they dont work. I have followed many tutorials and think i have the correct synat but i jus keep getting errors.

Basically, i have SPOne and SPTwo - SPOne is writing to a table called Publication that has PublicationID as its PK (auto generated). SPtwo needs to get this PublicationID from SPOne and use it to insert rows into a second table PublicationAuthors - the PublicationID is hence a FK in the table PublicationAuthors.

The error i get is: Procedure or function 'SPOne' expects parameter '@.publicationID', which was not supplied. Cannot insert the value NULL into column 'publicationID', table .dbo.PublicationAuthors'; column does not allow nulls. INSERT fails.

SPOne is as follows:

ALTER PROCEDUREdbo.StoredProcedureOne @.typeIDsmallint=null, @.titlenvarchar(MAX)=null, @.publicationIDsmallint OUTPUTASBEGINSET NOCOUNT ON INSERT INTOPublication (typeID, title) VALUES(@.typeID, @.title) SELECT@.publicationID =scope_identity()

END

and SPtwo is as follows:

ASDECLARE@.NewpublicationIDIntEXECStoredProcedureOne @.NewpublicationID =OUTPUTSET@.publicationID = @.NewpublicationIDINSERT INTOPublicationAuthors (publicationID, authorID)VALUES(@.publicationID, @.authorID)

SELECT@.NewpublicationID

Thanks

Gemma

Is there any reason for separating them instead of putting the INSERTs into one proc?

|||

For SP 2, try this:

exec StoredProcedureOne null, null, @.publicationId = @.NewpublicationID output

|||

Thanks for your responses

Mark - it doesnt seem to like the syntax when putting the nulls in?

Dinakar - I have tried in one procedure but had trouble with arrays as i need to pass in multiple values from listbox for the second insert (publicationAuthors) so i gave up and wanted to try this way instead...and now im still stuck :(

|||

What exactly is the error when you use nulls?

Try this, for grins:

exec StoredProcedureOne @.typeId = 0, @.title='test', @.publicationId = @.NewpublicationID output

|||

with the nulls i just get 'Incorrect Syntax near @.publicationID'

with your last selection - exec StoredProcedureOne @.typeId = 0, @.title='test', @.publicationId = @.NewpublicationID output

i get the error:

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Publication_PublicationType". The conflict occurred in database "C:\INETPUB\WWWROOT\SOSYM WEBSITE\APP_DATA\SOSYM DATABASE.MDF", table "dbo.PublicationType", column 'typeID'. Cannot insert the value NULL into column 'publicationID', table 'C:\INETPUB\WWWROOT\SOSYM WEBSITE\APP_DATA\SOSYM DATABASE.MDF.dbo.PublicationAuthors'; column does not allow nulls. INSERT fails

but i shouldnt be referencing the typeID from the PublicationType Table this doesnt get inserted into the PublicaitonAuthors table at all.

|||

Ok, but the good news is that the stored proc is called correctlySmile

The insert probably failed because publicationId wasn't defined as an identity column, and it wasn't part of the insert statement.

|||

but the publicationID isdefined as the identity column in proc one and its part of the insert statement in proc 2 ?

|||

Hi,

From the error you provided, basically it has to do with putting invalid data into a column that references the data in the primary (or unique) key of another table, or what we can say that the value you are going to insert into the foreign key field doesn't exist in the corresponding filed of the parent table.

In order to have a test, you can split your stored procedure into two parts, first to check if the inserting to the parent table can work successfully. If so, we can know is issue is related to the parameter passing between these two procs.

After that ,try the following code:

exec StoredProcedureOne @.typeId = 0, @.title='test', @.publicationIdoutput INSERT INTO PublicationAuthors (publicationID, authorID)VALUES (@.publicationID, @.authorID)SELECT @.publicationId

Thanks.

Wednesday, March 7, 2012

Pass unicode to stored procedures

Hi,
I have an **urgent** need to pass chinese characters into an SQL Server
Express table using a stored procedure. The MSDN documentation informs me
that everything will work 'automatically' if I use NVARCHAR parameters but
all I am getting is question marks. I've found old threads where other
people have the same problem but the only answer available is 'it should
just work'. Hopefully someone here (PLEASE) has more idea why the following
would not work (the result for me is that every unicode character is
converted into a question mark instead of having the correct chinese
charater).
PS The same code works fine for Jet (Access).
CREATE TABLE MyTable (iID INT, sName NVARCHAR(50));
GO
CREATE PROCEDURE MyTable_Insert(@.iID INT, @.sName NVARCHAR(50))
AS INSERT INTO MyTable(iID, sName) VALUES (@.iID, @.sName);
GO
DECLARE @.RC INT
DECLARE @.iID INT
DECLARE @.sName NVARCHAR(50)
SET @.iID = 1
SET @.sName = '''
EXECUTE @.RC = MyTable_Insert @.iID, @.sName
GO
SELECT * FROM MyTable;
--
Result: 1 '
--
NOTE: Prefixing the variable name with an "N" does fix the problem:
SET @.sName = ''' // this inserts '
SET @.sName = N''' // this inserts '
However, this solution is not workable because eventually the parameter will
be set by an existing C# application that passes a string. BTW The
'automatic' detection of string variables should make this unecessary right?
This is an urgent problem for me. A fast response would be greatly
appreciated.
Regards,
Hamilton Colyer-Long
Janusys
www.janusys.com.auIs it an omen that this newsgroup filtered unicode from my original post?
The following lines that contain question marks should actually have Chinese
characters:
SET @.sName = '''
SET @.sName = ''' // this inserts question marks
SET @.sName = N''' // this inserts '
Other instances of question marks in the original post are "as intended":
Result: 1 '
Chinese characters: '
Regards,
Hamilton Colyer-Long
Janusys
www.janusys.com.au|||I've reworked the code in the original post slightly to better illustrate my
point (and because I'm desperate for help!). If you copy code below the
dotted line into studio manager and replace the 'QQQ' with Chinese
characters then the following results are obtained:
1 ? // This is failure
2 QQQ // This is success
---
DROP TABLE MyTable;
GO
DROP PROCEDURE MyTable_Insert;
GO
CREATE TABLE MyTable (iID INT, sName NVARCHAR(50));
GO
CREATE PROCEDURE MyTable_Insert(@.iID INT, @.sName NVARCHAR(50))
AS
INSERT INTO MyTable(iID, sName) VALUES (@.iID, @.sName);
GO
DECLARE @.RC INT
DECLARE @.iID INT
DECLARE @.sName NVARCHAR(50)
/* THIS INSERTS QUESTION MARKS */
SET @.iID = 1
SET @.sName = 'QQQ'
EXECUTE @.RC = MyTable_Insert @.iID, @.sName
/* THIS INSERTS UNICODE */
SET @.iID = 2
SET @.sName = N'QQQ
EXECUTE @.RC = MyTable_Insert @.iID, @.sName
GO
SELECT * FROM MyTable;|||> NOTE: Prefixing the variable name with an "N" does fix the problem:
> SET @.sName = ''' // this inserts '
> SET @.sName = N''' // this inserts '
> However, this solution is not workable because eventually the parameter
> will be set by an existing C# application that passes a string. BTW The
> 'automatic' detection of string variables should make this unecessary
> right?
As Jesse mentioned, strings in C# are Unicode. You'll get the desired
behavior as long as you parameterize your SQL statements with the correct
datatype.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Hamilton Colyer-Long" <hamilton@.NOjanusysSPAM.com.au> wrote in message
news:uD3nDInAIHA.5868@.TK2MSFTNGP05.phx.gbl...
> Hi,
> I have an **urgent** need to pass chinese characters into an SQL Server
> Express table using a stored procedure. The MSDN documentation informs me
> that everything will work 'automatically' if I use NVARCHAR parameters but
> all I am getting is question marks. I've found old threads where other
> people have the same problem but the only answer available is 'it should
> just work'. Hopefully someone here (PLEASE) has more idea why the
> following would not work (the result for me is that every unicode
> character is converted into a question mark instead of having the correct
> chinese charater).
> PS The same code works fine for Jet (Access).
> CREATE TABLE MyTable (iID INT, sName NVARCHAR(50));
> GO
> CREATE PROCEDURE MyTable_Insert(@.iID INT, @.sName NVARCHAR(50))
> AS INSERT INTO MyTable(iID, sName) VALUES (@.iID, @.sName);
> GO
> DECLARE @.RC INT
> DECLARE @.iID INT
> DECLARE @.sName NVARCHAR(50)
> SET @.iID = 1
> SET @.sName = '''
> EXECUTE @.RC = MyTable_Insert @.iID, @.sName
> GO
> SELECT * FROM MyTable;
> --
> Result: 1 '
> --
> NOTE: Prefixing the variable name with an "N" does fix the problem:
> SET @.sName = ''' // this inserts '
> SET @.sName = N''' // this inserts '
> However, this solution is not workable because eventually the parameter
> will be set by an existing C# application that passes a string. BTW The
> 'automatic' detection of string variables should make this unecessary
> right?
> This is an urgent problem for me. A fast response would be greatly
> appreciated.
> Regards,
> Hamilton Colyer-Long
> Janusys
> www.janusys.com.au
>