Showing posts with label rows. Show all posts
Showing posts with label rows. Show all posts

Friday, February 17, 2012

Empty Subreport in Table

I have a problem with an subreport. I have master-detail relatinship
between tables. My table has three rows, 1st row is table header, 2nd
row is Master data and 3rd row is place where I put mine child
table(subreport).
If my subreport doesnt have any data this row is still visible(empty
space), I search all over internet and didnt find resolve for this
problem. Im working with Visual Studio 20005.
Is there any way for finding out number of rows in subreport, and use
that in Visibility expression of the 3rd row'
Thanks in advance,
Alen Husanovicanyone?|||I am having the exact same problem. Anybody have a proposed solution?
"alenhusanovic@.gmail.com" wrote:
> anyone?
>|||I am, also, having the same problem. Does anyone have a solution or isn't
there one? I would appreciate some kind of a reply.
"bjkaledas" wrote:
> I am having the exact same problem. Anybody have a proposed solution?
> "alenhusanovic@.gmail.com" wrote:
> > anyone?
> >
> >|||And the problem is?
When asking for help you need to include the question. If you make it
difficult to find out the question then you decrease the chance of someone
answering it. In this case I don't have the starting post on this thread so
I don't have a clue what your problem is.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"MikeS" <MikeS@.discussions.microsoft.com> wrote in message
news:5015E622-82AA-4446-846A-A5A039891708@.microsoft.com...
>I am, also, having the same problem. Does anyone have a solution or isn't
> there one? I would appreciate some kind of a reply.
> "bjkaledas" wrote:
>> I am having the exact same problem. Anybody have a proposed solution?
>> "alenhusanovic@.gmail.com" wrote:
>> > anyone?
>> >
>> >|||Sorry, here is the starting post:
I have a problem with an subreport. I have master-detail relatinship
between tables. My table has three rows, 1st row is table header, 2nd
row is Master data and 3rd row is place where I put mine child
table(subreport).
If my subreport doesnt have any data this row is still visible(empty
space), I search all over internet and didnt find resolve for this
problem. Im working with Visual Studio 20005.
Is there any way for finding out number of rows in subreport, and use
that in Visibility expression of the 3rd row'
Thanks in advance,
Alen Husanovic
"Bruce L-C [MVP]" wrote:
> And the problem is?
> When asking for help you need to include the question. If you make it
> difficult to find out the question then you decrease the chance of someone
> answering it. In this case I don't have the starting post on this thread so
> I don't have a clue what your problem is.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MikeS" <MikeS@.discussions.microsoft.com> wrote in message
> news:5015E622-82AA-4446-846A-A5A039891708@.microsoft.com...
> >I am, also, having the same problem. Does anyone have a solution or isn't
> > there one? I would appreciate some kind of a reply.
> >
> > "bjkaledas" wrote:
> >
> >> I am having the exact same problem. Anybody have a proposed solution?
> >>
> >> "alenhusanovic@.gmail.com" wrote:
> >>
> >> > anyone?
> >> >
> >> >
>
>|||There is a norows property where you can have text be displayed when there
is no data but I am not aware of a way to do what you desire here.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:ek%23Wv%23MCHHA.3924@.TK2MSFTNGP02.phx.gbl...
> And the problem is?
> When asking for help you need to include the question. If you make it
> difficult to find out the question then you decrease the chance of someone
> answering it. In this case I don't have the starting post on this thread
> so I don't have a clue what your problem is.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MikeS" <MikeS@.discussions.microsoft.com> wrote in message
> news:5015E622-82AA-4446-846A-A5A039891708@.microsoft.com...
>>I am, also, having the same problem. Does anyone have a solution or isn't
>> there one? I would appreciate some kind of a reply.
>> "bjkaledas" wrote:
>> I am having the exact same problem. Anybody have a proposed solution?
>> "alenhusanovic@.gmail.com" wrote:
>> > anyone?
>> >
>> >
>

Empty rows in excel data sheet used in DTS

Hi Everyone,

I am using a DTS package where one of the inputs is an Excel Sheet. Actually this sheet is updated manually whenever required i.e once a week or sometimes once a month, but the DTS package runs everyday.

Whenever new rows are added or deleted manually in the excel sheet, empty rows are showed in the sheet after the last row of data. This hinders the DTS package, because the destination table to which the data in the Excel sheet is sent has Primary keys in it.

Can anyone suggest me how to avoid getting the empty spaces in the excel sheet.

Thanks in advance.

Regards,
kalyanExcel has a funny habit of recognising that there is data present when there really isn't. The easiest solution is when deleting records don't just press the delete key, actually right click the mouse and choose delete from the available options. It may even be better to run some macro inside the document that deletes all records below the last record in this manner.|||Hi SJP,

Thanks for the prompt reply. I think to run a macro to delete all records below the last record would be the most feasible solution.

Thanks again.

Regards,
kalyan|||The simple solution I applied was to delete all the named ranges in the Excel worksheet (From the Excel menu: Insert > Name > Define. It seems that after rows are deleted in the Excel sheet, the named ranges do not get updated. After deleting the named ranges, it was easy to Import the data.

Wednesday, February 15, 2012

Empty a table before using DTS to append records?

In Access I have a macro that, each night, takes a table with a
primary key defined in it, and deletes all the rows. Then it
imports/appends records from a fixed width text file. In this way,
since the table is not deleted and recreated, the primary key is kept
intact.

What would be the equivalent SQL method for doing this in an automated
way? I've tried letting DTS import the table from Access, but the
primary key is lost. Is there some way to "empty" a table instead of
dropping it, and then append new records so that the table will end up
having the primary key I want it to have?

Thanks.

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown.""Larry Rekow" <larry@.netgeexdotcom> wrote in message
news:2gjej0hqagf196sp7ec3gn1uf96don3hgv@.4ax.com...
> In Access I have a macro that, each night, takes a table with a
> primary key defined in it, and deletes all the rows. Then it
> imports/appends records from a fixed width text file. In this way,
> since the table is not deleted and recreated, the primary key is kept
> intact.
> What would be the equivalent SQL method for doing this in an automated
> way? I've tried letting DTS import the table from Access, but the
> primary key is lost. Is there some way to "empty" a table instead of
> dropping it, and then append new records so that the table will end up
> having the primary key I want it to have?
> Thanks.
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."

I don't really understand what you mean, but I guess that your primary key
column is an IDENTITY column, and you want to remove all data in the table
without resetting the identity value back to 1 (or whatever your seed was)?
The simple way is just this:

delete from dbo.MyTable

This can be slow on large tables with many rows, which is why TRUNCATE TABLE
is often used instead, although it will reset the identity seed.

If this isn't helpful, or if I didn't understand correctly, then you should
post some more detailed information, in particular the CREATE TABLE
statement for your target table (including constraints), and what the data
looks like that you want to import. It would also be good to know if you
want MSSQL to generate new identity values for your primary key, or if you
already have values in the source data which you want to keep.

Simon|||On Thu, 2 Sep 2004 19:43:18 +0200, "Simon Hayes" <sql@.hayes.ch> wrote:

>If this isn't helpful, or if I didn't understand correctly, then you should
>post some more detailed information, in particular the CREATE TABLE
>statement for your target table (including constraints), and what the data
>looks like that you want to import. It would also be good to know if you
>want MSSQL to generate new identity values for your primary key, or if you
>already have values in the source data which you want to keep.
>Simon
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++
Already have values in the source data, a unique field called
"FILE_NUM".

The default statement that DTS creates for me starts out with:

CREATE TABLE [hoyt].[dbo].[IMP7TEXT] (
[IMP_ID] nvarchar (12) NULL,
[CUST_ID] nvarchar (12) NULL,
[FILE_NUM] nvarchar (8) NULL,
etc.....

Because I'm using this table in an ASP.Net website, I want to relate
it to other tables that also have the FILE_NUM values.

Would it be as simple as editing the CREATE TABLE statement to specify
that FILE_NUM is the primary key? (yes, i'm very new at MS SQL).

Thanks,

Larry

- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."|||Larry Rekow (larry@.netgeexdotcom) writes:
> The default statement that DTS creates for me starts out with:
> CREATE TABLE [hoyt].[dbo].[IMP7TEXT] (
> [IMP_ID] nvarchar (12) NULL,
> [CUST_ID] nvarchar (12) NULL,
> [FILE_NUM] nvarchar (8) NULL,
> etc.....
> Because I'm using this table in an ASP.Net website, I want to relate
> it to other tables that also have the FILE_NUM values.
> Would it be as simple as editing the CREATE TABLE statement to specify
> that FILE_NUM is the primary key? (yes, i'm very new at MS SQL).

Not really. First you would have to make the column NOT NULL before you
can make it a primary key. Then you probably would have to set up foriegn-
key relations as well. Then again, that depends on what you mean with
relate. I don't know ASP .Net, but may you are really talking data tables
in ADO .Net?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||On Thu, 2 Sep 2004 22:00:18 +0000 (UTC), Erland Sommarskog
<esquel@.sommarskog.se> wrote:

>Larry Rekow (larry@.netgeexdotcom) writes:
>> The default statement that DTS creates for me starts out with:
>>
>> CREATE TABLE [hoyt].[dbo].[IMP7TEXT] (
>> [IMP_ID] nvarchar (12) NULL,
>> [CUST_ID] nvarchar (12) NULL,
>> [FILE_NUM] nvarchar (8) NULL,
>> etc.....
>>
>> Because I'm using this table in an ASP.Net website, I want to relate
>> it to other tables that also have the FILE_NUM values.
>>
>> Would it be as simple as editing the CREATE TABLE statement to specify
>> that FILE_NUM is the primary key? (yes, i'm very new at MS SQL).
>Not really. First you would have to make the column NOT NULL before you
>can make it a primary key. Then you probably would have to set up foriegn-
>key relations as well. Then again, that depends on what you mean with
>relate. I don't know ASP .Net, but may you are really talking data tables
>in ADO .Net?
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++
Thanks to you and Simon for responses and hints. Yes, after more
googling, reading, discovering, I made FILE_NUM NOT NULL and was able
to make it the primary key by editing the MAKE TABLE query DTS put
together; now looking into defining the foreign keys, etc.

The penny is starting to drop :)

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."