Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Friday, March 30, 2012

Page Break after sub report - Not by design

All,

I have a report for a Quote print that has 1 table with 1 group in it by Quote #. The detail level is showing the line items on the quote and a second detail line for a sub report to show any notes. If the quote has 1 line on it, I am always getting a page break after the sub report even if it doesn't display anything.

The report shows the following:

Note each of these will contain a rectangle that the text boxes are displayed in unless it is a sub-report then no rectange.

    Group header 1 - Address information

    Group header 1 - contains a sub report for some notes

    Group header 1 - Opening paragraph

    Group header 1 - Blank line

    Group header 1 - contains the line headings

    Detail - contains the line details

    Detail - contains the sub report for line notes

    Detail - blank line for spacing

    Group footer 1 - hidden based on expression

    Group footer 1 - hidden based on expression ** One of these 2 lines will print based on the expression

    Group footer 1 - sub report for more notes

    Group footer 1 - Closing paragraph

    Group footer 1 - Signature area

    Group footer 1 - sub report for last page of terms / scope notes. NOTE: This sub report also contains a table and the table has a page break before so that I can get these on another page.

So, after # 8 above there is a page break. The remaining footers before # 14 easily fit on the rest of the page. The group 1 also has a page break at the end so it breaks between quotes. I have tried to insert a page break on the rectangle for # 13 and remove the page break on the sub report in # 14 but although everything fits it doesn't page break before the sub report.

It looks like it always page breaks after the last page in the sub report.

Any ideas on how to get around this?

Thanks in advance,

Sherry

Try this:
1.- In the sub report (on every List or Rectangle you have):
1.1.- Right click, Properties.
1.2.- uncheck "Insert a page break after this list".
1.3.- Click on "Edit details group"
1.4.- uncheck "Page break at end".|||

Thanks for the feedback. I had tried that and then it wouldn't page break.

I did resolve it although I feel the original way should have worked.

I created another Group 1 for the same grouping clause (Quote #). This pushed my original grouping to Group 2. I then put a page break after Group #2. I only had a group footer for Group # 1 with the sub report in it. I had to take the sub report page break before off.

Thanks again,

Sherry

Friday, March 9, 2012

ownership chains, users and views

We have a design using views to partition visibility of table rows by sql us
er. Say we have two salesmen Fred and Barney, we wanted to create 2 views:
CREATE VIEW Fred.SALES_LEADS AS SELECT * FROM dbo.ALL_SALES_LEADS WHERE SALE
S_PERSON='Fred'
and
CREATE VIEW Barney.SALES_LEADS AS SELECT * FROM dbo.ALL_SALES_LEADS WHERE SA
LES_PERSON='Barney'
Neither salesman should be able to select from ALL_SALES_LEADS and each, bei
ng amazingly SQL savvy salesmen, can log on to sql and execute SELECT * FROM
SALES_LEADS WHERE STATUS='New'.
Problem is that neither because neither Fred nor Barney owns the ALL_SALES_L
EADS table, they can't select off the view with any combination of GRANT/DEN
Y/REVOKE statements that we can find because the ownership chains are broken
.
Our best fallback is to name the views differently but leave them owned by d
bo. Not as neat and tidy. ie
CREATE VIEW dbo.Fred_SALES_LEADS AS SELECT * FROM dbo.ALL_SALES_LEADS WHERE
SALES_PERSON='Fred'
GRANT SELECT ON dbo.Fred_SALES_LEADS TO Fred
Is there any way around our original problem, SQL gurus? I think this would
be a very good use of user-owned views in a number of realistic scenarios.> Our best fallback is to name the views differently but leave them owned by
dbo.
The table and view need to have the same owner in order to use views as a
security mechanism. If each salesperson accesses the database with their
own userid, you might consider filtering using database userid instead of a
hard-coded constant. This way, you only need one view. For example:
CREATE VIEW dbo.SALES_LEADS AS
SELECT *
FROM dbo.ALL_SALES_LEADS
WHERE SALES_PERSON = CURRENT_USER
GO
GRANT SELECT ON dbo.SALES_LEADS TO SalesRole
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Dave Cattermole" <anonymous@.discussions.microsoft.com> wrote in message
news:726B0928-E93C-4233-A5FE-051E8ADA5684@.microsoft.com...
> We have a design using views to partition visibility of table rows by sql
user. Say we have two salesmen Fred and Barney, we wanted to create 2 views:
> CREATE VIEW Fred.SALES_LEADS AS SELECT * FROM dbo.ALL_SALES_LEADS WHERE
SALES_PERSON='Fred'
> and
> CREATE VIEW Barney.SALES_LEADS AS SELECT * FROM dbo.ALL_SALES_LEADS WHERE
SALES_PERSON='Barney'
> Neither salesman should be able to select from ALL_SALES_LEADS and each,
being amazingly SQL savvy salesmen, can log on to sql and execute SELECT *
FROM SALES_LEADS WHERE STATUS='New'.
> Problem is that neither because neither Fred nor Barney owns the
ALL_SALES_LEADS table, they can't select off the view with any combination
of GRANT/DENY/REVOKE statements that we can find because the ownership
chains are broken .
> Our best fallback is to name the views differently but leave them owned by
dbo. Not as neat and tidy. ie
> CREATE VIEW dbo.Fred_SALES_LEADS AS SELECT * FROM dbo.ALL_SALES_LEADS
WHERE SALES_PERSON='Fred'
> GRANT SELECT ON dbo.Fred_SALES_LEADS TO Fred
> Is there any way around our original problem, SQL gurus? I think this
would be a very good use of user-owned views in a number of realistic
scenarios.

Monday, February 20, 2012

Overlapping or nonoverlapping publication? Which type applies to my design?

I'm going through the documentation for SQL Server 2005 replication
and am trying to understand what type of publication I should be
using. Here is how replication should be working in my system:
I have a database on a server that will be accessible over the
Internet. This database can be used by multiple companies. Tables are
designed so that a company ID is used to identify records that belong
to a specific company. Every record in every table can be filtered out
to belong to a unique company. That means that no two companies ever
share the same data. Each company can have multiple mobile users using
PDAs to communicate with the server. Each user receives data only from
their company. Some of the data is created on the server and
replicated to the PDA. Some data is also created on the PDA and
replicated to the server. Under no condition is data that is created
on the server ever edited on a PDA. Data created on a PDA is always
inserted into the table and once inserted it can never be modified.
Mobile users cannot modify or delete data. When one mobile user
replicates their data with the server, the newly inserted records that
were created on their PDA are also replicated to all other PDAs within
the same company but this data can never be modified by any mobile
user. In essence, the entire database on the server is replicated to
all of the PDA users but the application on the PDA will only allow
inserts into certain tables - no modifications or deletions. All
mobile users should always get newly inserted data made by other
mobile users within the same company.
I'm having a hard time trying to figure out what kind of publication
is required. In a section of the documentation on replication under
the title "Considerations for Nonoverlapping Partitions", it is
written:
* The Subscriber cannot update columns referenced in a parameterized
filter.
*If an insert at a Subscriber does not belong to the partition, it is
not deleted. However, it will not be replicated to other Subscribers.
I'm not sure what these two statements mean. The first statement
mentions "cannot update columns". No columns will be updated, but
inserts will be done.
In the second statement, it refers to an insert "not belonging to the
partition". If all PDA users are subscribing to the same publication,
won't they all get a copy of the inserted records that are made on all
other PDAs?
If you have a nonoverlapping partion, which is what I assume is what I
should be using, how could any insert possibly belong to some other
partition? Isn't there just one partition?
What kind of publication should I be using: overlapping or
nonoverlapping?
Thanks for your help
Polaris
Hi Hilary,
You wrote:
> With overlapping partitions data can be owned by more than two salesmen,
> with non-overlapping it would be only one.
> From what you describe you should use non-overlapping partitions.
So if you recommend non-overlapping, then are you saying that each PDA
client within a single company would be its own "owner"? Yet I want
it such that all the data on ALL PDAs is identical after replication.
Each user on each PDA can insert data but not modify or delete
existing data. Will non-overlapping satisfy this requirement?
Thanks
Johann
On Feb 25, 3:10 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> Basically it means if you are filtering on the salespersonID column for
> example the subscribers will be unable to update this column to have another
> value. Your second question means that if you add a row which has a
> salesmanID value of 5 and your filter for that subscription is 4, this row
> will remain in the subscriber and never move to the publisher.
> The way to look at partitions is that it is a block of related data. So its
> the salesman row, his clients, and all of its orders and all related data.
> Should a salesman take on new clients, the partition will have the new
> clients and their orders added to it. Should the salesman change territories
> with another salesman there would be a partition realignment which would
> include all the new clients, their orders, etc.
> By default if you were to update the client salespersonID on the client
> table, only the client row would move to the subscriber. With join filters
> all the clients data will also move as the update statement on the parent
> table will also affect all child rows.
> With overlapping partitions data can be owned by more than two salesmen,
> with non-overlapping it would be only one.
> From what you describe you should use non-overlapping partitions. You can
> have one partition for every salesman on the publisher, and if you are not
> using hierarchies (or doing republishing) you will only have one partition
> on the subscriber.
> HTH
> --
> Hilary Cotter
|||Perhaps I am missing something here, but I don't think you need to do any
filtering at all, or at least not join filtering which is where partitions
come in.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Polaris431" <polaris431@.gmail.com> wrote in message
news:1172415914.436083.96840@.a75g2000cwd.googlegro ups.com...
> Hi Hilary,
> You wrote:
> So if you recommend non-overlapping, then are you saying that each PDA
> client within a single company would be its own "owner"? Yet I want
> it such that all the data on ALL PDAs is identical after replication.
> Each user on each PDA can insert data but not modify or delete
> existing data. Will non-overlapping satisfy this requirement?
> Thanks
> Johann
>
> On Feb 25, 3:10 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
>
>

Overflow Error: Visual Web Developer

I am using Visual Web Developer to design an interface to query an Access Database. Everything seems to work fine, but when I select the most intensive option I recieve the following error. As I said, everything seems to work fine, unless the user selects all the options I have made available. How do I resolve this issue without limiting the user?

Overflow

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Overflow

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[OleDbException (0x80040e57): Overflow] System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +177 System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +194 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +56 System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +105 System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +91 System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +4 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +140 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1659 System.Web.UI.WebControls.AccessDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +58 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +13 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.GridView.DataBind() +5 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +67 System.Web.UI.Control.EnsureChildControls() +97 System.Web.UI.Control.PreRenderRecursiveInternal() +50 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5729

I can post my code as well. It's three group bys, two sums divided by one another on a 30mb Access Database.

Thanks!

It seems like this would be better posted to an Access or ASP.NET forum.