Thursday, March 8, 2012
Assigning a Dataset to a Rectangle
I've created a Rectangle within a SQL Report, and i'd like to tie it
back to a Dataset. Within the Rectangle Properties it lists Data
Region, but none of my Datasets are appearing in the dropdown.
I found the following article on Microsoft's site -
http://technet.microsoft.com/en-us/library/ms159224.aspx - but the
first step is throwing me - "In Layout view, right-click the data
region and then click Properties." Data Region is an option within
the Rectangle Properties and not an object in of itself, so I'm not
sure what "Data Region" it's saying to right-click on.
Can someone point me in the right direction?
Thanks,
AlexOn Feb 14, 9:35=A0am, Alex <sama...@.gmail.com> wrote:
> Hello,
> I've created a Rectangle within a SQL Report, and i'd like to tie it
> back to a Dataset. =A0Within the Rectangle Properties it lists Data
> Region, but none of my Datasets are appearing in the dropdown.
> I found the following article on Microsoft's site -http://technet.microsof=
t.com/en-us/library/ms159224.aspx- but the
> first step is throwing me - "In Layout view, right-click the data
> region and then click Properties." =A0Data Region is an option within
> the Rectangle Properties and not an object in of itself, so I'm not
> sure what "Data Region" it's saying to right-click on.
> Can someone point me in the right direction?
> Thanks,
> Alex
Alex,
First thing to know, a rectangle is not a data region, it is a
graphical "report item" that's more like a container to keep report
items together.
Data regions are table, matrix, chart and list. They can be
associated with a dataset, rectangles cannot.
I'd suggest you try using the list data region as it will give you the
flexibility of freeform layout while still letting you tie back to a
dataset.
Also, take a look at this TechNet article for more info on Data
Regions:
http://technet.microsoft.com/en-us/library/ms157134.aspx
And this one for report items:
http://technet.microsoft.com/en-us/library/ms159268.aspx
HTH
toolman
Saturday, February 25, 2012
Aspx fashion tip... ;)
Hi!
Im building a site for internal use for a company i work at.
And im having hard to decide what to do. The alternatives are
comma separated lists vs separate tables.
For example.. I will use a number of different type of objekt that all will hold 1 or more document links, phone numbers, emails etc
As far as i can i i have 2 possibilitys. One is to add textfields for each of these subojects in each objects tables. Then i add all info as commaseparrated lists in 2-3 layers wich i then save in the respecive objects fields.
(Look like something below for example )
,comment'emailadress,comment'emailadress,
Or i add 1 table for each subobject type wich manage the subobjects or link between different objects
for example:
table layout for email:
id | parent_type | parent_id | comment | email
Or for example contacts a mediator table:
id | parent_type | parent_id | contact_id
Hope you understand what i mean, would really appriechiate suggestions, comments regarding what can be considered as "best practise" in these cases. Putting it in separate tables should make searches easier, and coding easier in my book. But again im thinking if perhaps commalists is a faster and more recource conservative way of doing it + to me it feels like (perhaps i have no reason to think this?) making tables for items like feels like a timebomb if you exhaust your idfields identity count. Though this app will be used by perhaps 100ppl at most so perhaps not an extremely utilized webapp.
Anyway glad if you could give me some input!
I prefer seperate tables, as this gives clearer description of data structure/relationship, and it is much easier to manipulate the data in seperate tables.|||
Yeah well separate tables sure is the easiest way to get around it considering searches, changes when built etc.
Practically for me it will mean perhaps 3-5 querys in one page instead 1-2. So that is the main drawback i guess wich perhaps wont inflict to much.
Anyway my main concern was if there was anything that motivated commalists or its just a small gain for quite a bit more work in creating/changing.
|||"if you exhaust your idfields identity count"? If you were inserting a new record once every second non-stop, it'd take over 68 years to exceed the limits of an int. And when you get there, consider upgrading to SQL Server 2050 which solves that problem automatically for you. But if you think there is the possability that your app will need to run for 68+ years without a change, or if your think you'll need to insert more than 86,000 rows per day, then you might consider a bigint.
|||
Yeah did som calculations and came to the same conclusion ;)
Anyway think i will go for tables, for convineance sake.
Sunday, February 12, 2012
ASP.Net and MS SQL
I am displaying a page of lists of addresses based on state.
.../results.aspx?state=id
I want to add a little "re-sort" links. For example: sort by | name | city | style
.../results.aspx?state=id&sort=city
(if sort is missing default to "sort=name")
But I a having a problems... here is part of my code, following dreamwevers standards for ASP.Net -
CommandText='<%# "SELECT * FROM tblRestaurants WHERE ""State"" = @.State ORDER BY @.Sort ASC" %>'
<parameters>
<parameter name="@.State" value='<%# IIf((Request.QueryString("state") <> Nothing), Request.QueryString("state"), "") %>' type="VarChar" />
<parameter name="@.Sort" value='<%# IIf((Request.QueryString("sort") <> Nothing), Request.QueryString("sort"), "name") %>' type="VarChar" />
</parameters
But "@.Sort" is causing errors, I think @. is a reserved keyword in MS SQL (?),
here is the error message -
System.Data.SqlClient.SqlException: The SELECT item identified by the ORDER BY number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by an expression referencing a column name.
I have tried to change @.Sort about a dozen different names "MMSort", "urlSort" etc.
here is the error message -
System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'urlSort'.
One side note, I displaying the results in a repeating datalist, a datagrid is out.
A rough draft version without working sort is at
http://www.jbmcgregor.com/cira/results.aspx?state=id
Any suggestion, ideas or help would be extremely appreciated. Thanks.
DanielIt would help if you provide the actual sql query that gets executed. Use Try...Catch to catch the exception and use response.write to figure out exactly what was the sql command that gets executed. Probably it is a systax error.