Showing posts with label sort. Show all posts
Showing posts with label sort. Show all posts

Thursday, March 29, 2012

EDB on WM. Do Do sort Orders generate index tables?

Hi,

I am developing database support for my application and I am using EDB. I would like to use sort orders to make the code easier but I was wondering if sort orders generate index tables. I mean, do they only sort the records during addition or they also generate index tables to speed up queries. In other words, do they make the database file bigger?
In the MSDN documentation I can not find anything on this.

Thanks,
GiulioHi, does anybody know the answer?
I am stuck with this.

thanks,
giulio|||

Hi Giulio2000

Moving to Sql Server compact edition forum where it has got better chances of being answered.

-Thanks,

|||

Yes, indexs do get generated. You can create a sort order and then specify the sort order you want to use while opening the database. EDB supports up to 16 different sort orders.

Manish Agnihotri

Program Manager

SQL Compact

sql

Monday, March 19, 2012

dynamically sort columns?

Hi,
Can you set up a report so that you can dynamically sort columns.
ie.
When viewing a report you click on a header of a column and sort by
this column.
If so can you point me to an example
Thanks in AdvanceHi Paul,
You can rightclick on the columnheaders textbox to display the
properties of this, select the tab "Interactive Sort", and select "Add
an interactive sort action to this textbox".
Below you can specify how you want the data to be sorted, ie.
selecting a field from your dataset.
Regards,
Rune Brahe Bjerregaard
On 30 Jul., 06:03, paulhux...@.hotmail.com wrote:
> Hi,
> Can you set up a report so that you can dynamically sort columns.
> ie.
> When viewing a report you click on a header of a column and sort by
> this column.
> If so can you point me to an example
> Thanks in Advance|||On Jul 30, 12:03 am, paulhux...@.hotmail.com wrote:
> Hi,
> Can you set up a report so that you can dynamically sort columns.
> ie.
> When viewing a report you click on a header of a column and sort by
> this column.
> If so can you point me to an example
> Thanks in Advance
Right Click on the title of the column which you wish to use an
Interactive sort with. On the drop down menu select properties. When
the properties widow pops up go to the tab labeled "Interactive
Sort". Click the check box at the top and under the drop down
selection box pick the column that you are trying to sort by. For
example, you selected the column with the datafield "Order Number" so
select that in your interactive sort drop down... otherwise it will
sort according to another column when you click on it. Preview the
report to make sure it works.|||Thanks

Dynamically Generating SMDL (Report Model Definitions) With C#

My problem is this: How do I dynamically generate a Report Model Definition with c#?

Is there some sort of method I could call from the ReportingService2005 web service? Or some sort of APIs I could use?

If I didn't have a dynamic database structure, I would just create a Report Model Definition with BIS and then deploy the same model to each customer. However, our product creates additional tables in the database, depending on what data users wish to collect.

There are currently 2 solutions for this problem. First, I can manually create a Report Model Definition through the Buisness Intelligence Studio (BIS). However, I wish to be able to dynamically generate the report model without having to go through BIS. Second, I could use C# and manually write the XML of the SMDL. However this seems problematic.

I'm really hoping for some MS API that I'm missing out on here. Thanks for the help.

- Sean

I asked MS about this and they said they currently do not have any APIs to accomplish this at this time.

Still searching for ideas.

|||

I was also looking for similar functionality. Let me know in case you find a solution.

Thanks,

-Suri

|||

Suri,

I was unable to find an API or anything definitive to fix this. However, what I am doing is creating a class to populate with information from my database and then serialize it into XML to insert into the SMDL.

I'm actually just designing the class right now. I'd recommend this page in MSDN

http://msdn2.microsoft.com/en-us/library/ms159611.aspx

I hope this helps.

|||

There is API method GenerateModel

|||

Excellent.

You saved me a lot of time. I'll use the similiar RegenerateModel method:

//Get the webservice
wsRS2005.ReportingService2005 r = new TNTSMDL.wsRS2005.ReportingService2005();

//Set the Credentials
r.Credentials = System.Net.CredentialCache.DefaultCredentials;

//Regenerate the Model in the database
r.RegenerateModel(@."/Models/NewModel");

POOF. It is generated. Thanks Again!

|||is there a sample available?

Dynamically Generating SMDL (Report Model Definitions) With C#

My problem is this: How do I dynamically generate a Report Model Definition with c#?

Is there some sort of method I could call from the ReportingService2005 web service? Or some sort of APIs I could use?

If I didn't have a dynamic database structure, I would just create a Report Model Definition with BIS and then deploy the same model to each customer. However, our product creates additional tables in the database, depending on what data users wish to collect.

There are currently 2 solutions for this problem. First, I can manually create a Report Model Definition through the Buisness Intelligence Studio (BIS). However, I wish to be able to dynamically generate the report model without having to go through BIS. Second, I could use C# and manually write the XML of the SMDL. However this seems problematic.

I'm really hoping for some MS API that I'm missing out on here. Thanks for the help.

- Sean

I asked MS about this and they said they currently do not have any APIs to accomplish this at this time.

Still searching for ideas.

|||

I was also looking for similar functionality. Let me know in case you find a solution.

Thanks,

-Suri

|||

Suri,

I was unable to find an API or anything definitive to fix this. However, what I am doing is creating a class to populate with information from my database and then serialize it into XML to insert into the SMDL.

I'm actually just designing the class right now. I'd recommend this page in MSDN

http://msdn2.microsoft.com/en-us/library/ms159611.aspx

I hope this helps.

|||

There is API method GenerateModel

|||

Excellent.

You saved me a lot of time. I'll use the similiar RegenerateModel method:

//Get the webservice
wsRS2005.ReportingService2005 r = new TNTSMDL.wsRS2005.ReportingService2005();

//Set the Credentials
r.Credentials = System.Net.CredentialCache.DefaultCredentials;

//Regenerate the Model in the database
r.RegenerateModel(@."/Models/NewModel");

POOF. It is generated. Thanks Again!

|||is there a sample available?|||

Hello Sean,

Can you post the complete code for "RegenerateModel" method?

It would save lot of development time.

Thanks

Dynamically Generating SMDL (Report Model Definitions) With C#

My problem is this: How do I dynamically generate a Report Model Definition with c#?

Is there some sort of method I could call from the ReportingService2005 web service? Or some sort of APIs I could use?

If I didn't have a dynamic database structure, I would just create a Report Model Definition with BIS and then deploy the same model to each customer. However, our product creates additional tables in the database, depending on what data users wish to collect.

There are currently 2 solutions for this problem. First, I can manually create a Report Model Definition through the Buisness Intelligence Studio (BIS). However, I wish to be able to dynamically generate the report model without having to go through BIS. Second, I could use C# and manually write the XML of the SMDL. However this seems problematic.

I'm really hoping for some MS API that I'm missing out on here. Thanks for the help.

- Sean

I asked MS about this and they said they currently do not have any APIs to accomplish this at this time.

Still searching for ideas.

|||

I was also looking for similar functionality. Let me know in case you find a solution.

Thanks,

-Suri

|||

Suri,

I was unable to find an API or anything definitive to fix this. However, what I am doing is creating a class to populate with information from my database and then serialize it into XML to insert into the SMDL.

I'm actually just designing the class right now. I'd recommend this page in MSDN

http://msdn2.microsoft.com/en-us/library/ms159611.aspx

I hope this helps.

|||

There is API method GenerateModel

|||

Excellent.

You saved me a lot of time. I'll use the similiar RegenerateModel method:

//Get the webservice
wsRS2005.ReportingService2005 r = new TNTSMDL.wsRS2005.ReportingService2005();

//Set the Credentials
r.Credentials = System.Net.CredentialCache.DefaultCredentials;

//Regenerate the Model in the database
r.RegenerateModel(@."/Models/NewModel");

POOF. It is generated. Thanks Again!

|||is there a sample available?|||

Hello Sean,

Can you post the complete code for "RegenerateModel" method?

It would save lot of development time.

Thanks

Friday, March 9, 2012

Dynamically change sort direction

Hello all! I have a report to be rendered in PDF format. On the report is a
list. I'm trying to dynamically change the sort direction of my list sorting
at run time, depending upon what parameter value is passed into the report
i.e. ascending or descending. Is this possible? I've tried editing my rdl
code numerous ways along these lines but it throws up an error no matter what:
<SortBy>
<SortExpression>Fields!sortby2.Value</SortExpression>
<Direction>=iif(Parameters!sortdir.Value = "Asc", Ascending,
Descending)</Direction>
</SortBy>
Any guidance would be greatly appreciated - either in doing it this way or
some other.
Thanks,
DaveDave,
I used this and it worked for me. I use two parameters, one telling
direction, one telling what column to sort by.
=iif(Parameters!Direction.Value="Ascending" AND
Parameters!SortBy.Value="quantity",Fields!quantity.Value, 0)
Put this in one column, and select Ascending in the other column.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:Dave@.discussions.microsoft.com:
> Hello all! I have a report to be rendered in PDF format. On the report is
> a
> list. I'm trying to dynamically change the sort direction of my list
> sorting
> at run time, depending upon what parameter value is passed into the report
> i.e. ascending or descending. Is this possible? I've tried editing my rdl
> code numerous ways along these lines but it throws up an error no matter
> what:
> <SortBy>
> <SortExpression>Fields!sortby2.Value</SortExpression>
> <Direction>=iif(Parameters!sortdir.Value = "Asc", Ascending,
> Descending)</Direction>
> </SortBy>
> Any guidance would be greatly appreciated - either in doing it this way or
> some other.
> Thanks,
> Dave

Friday, February 17, 2012

Dynamic SQL or CASE statement?

hi all,
we are having an asp app that is fetching a big resultset to display in a
list screen. The screen has 4 or 5 columns which have the click sort option
(ie., on clicking the column hdr, the list needs to be sorted out).
Currently, we are using a procedure which would dynamically construct the
sort order and use exec(@.stmt) to send back the resultset. Coz of perf issue
s
of late, we are thinking of removing dyn sql in the proc and recreating it
using CASE/IF statements. Which option would be better in general? Currently
,
the dyn sql has high counts of CPU.
would appreciate any help in this regards
thx
paraaWhy sort it at all? Can't ASP handle that? It would be more scalable than
making SQL Server do all the sorting.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"paraa" <paraa@.discussions.microsoft.com> wrote in message
news:6D3D38EC-AAB8-4BF0-A74F-AAE898D73BBD@.microsoft.com...
hi all,
we are having an asp app that is fetching a big resultset to display in a
list screen. The screen has 4 or 5 columns which have the click sort option
(ie., on clicking the column hdr, the list needs to be sorted out).
Currently, we are using a procedure which would dynamically construct the
sort order and use exec(@.stmt) to send back the resultset. Coz of perf
issues
of late, we are thinking of removing dyn sql in the proc and recreating it
using CASE/IF statements. Which option would be better in general?
Currently,
the dyn sql has high counts of CPU.
would appreciate any help in this regards
thx
paraa|||tom,
we have lean clients and so after lot of brainstorming have put the sorting
on the server side..sorting on client is not an option over here..as per the
scalability factor - may not be that much of an issue..thatz why we are
thinking abt using CASE on the proc side...wanted to know if that would buy
us something vis a vis dyn sql
thx
"Tom Moreau" wrote:

> Why sort it at all? Can't ASP handle that? It would be more scalable tha
n
> making SQL Server do all the sorting.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "paraa" <paraa@.discussions.microsoft.com> wrote in message
> news:6D3D38EC-AAB8-4BF0-A74F-AAE898D73BBD@.microsoft.com...
> hi all,
> we are having an asp app that is fetching a big resultset to display in a
> list screen. The screen has 4 or 5 columns which have the click sort optio
n
> (ie., on clicking the column hdr, the list needs to be sorted out).
> Currently, we are using a procedure which would dynamically construct the
> sort order and use exec(@.stmt) to send back the resultset. Coz of perf
> issues
> of late, we are thinking of removing dyn sql in the proc and recreating it
> using CASE/IF statements. Which option would be better in general?
> Currently,
> the dyn sql has high counts of CPU.
> would appreciate any help in this regards
> thx
> paraa
>|||How "lean" are we talking? I find it hard to believe that an IIS server
can't handle this.
That said, you can do dynamic sorting without resorting to dynamic SQL:
declare @.sort varchar (100)
set @.sort = 'Country'
select
*
from
dbo.Customers
order by
case when @.sort = 'Country' then Country end
, case when @.sort = 'CustomerID' then CustomerID end
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"paraa" <paraa@.discussions.microsoft.com> wrote in message
news:C3B84B96-3839-4A66-8FAE-0F737FBE21C5@.microsoft.com...
tom,
we have lean clients and so after lot of brainstorming have put the sorting
on the server side..sorting on client is not an option over here..as per the
scalability factor - may not be that much of an issue..thatz why we are
thinking abt using CASE on the proc side...wanted to know if that would buy
us something vis a vis dyn sql
thx
"Tom Moreau" wrote:

> Why sort it at all? Can't ASP handle that? It would be more scalable
> than
> making SQL Server do all the sorting.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "paraa" <paraa@.discussions.microsoft.com> wrote in message
> news:6D3D38EC-AAB8-4BF0-A74F-AAE898D73BBD@.microsoft.com...
> hi all,
> we are having an asp app that is fetching a big resultset to display in a
> list screen. The screen has 4 or 5 columns which have the click sort
> option
> (ie., on clicking the column hdr, the list needs to be sorted out).
> Currently, we are using a procedure which would dynamically construct the
> sort order and use exec(@.stmt) to send back the resultset. Coz of perf
> issues
> of late, we are thinking of removing dyn sql in the proc and recreating it
> using CASE/IF statements. Which option would be better in general?
> Currently,
> the dyn sql has high counts of CPU.
> would appreciate any help in this regards
> thx
> paraa
>|||If you simply need to sort by a single column, then the ASP.NET DataGrid
could handle this. However, if your sort requirements are more complex
involving multiple columns or complex conditions, then it would probably
need to be done within the stored procedure. A conditional [order by] clause
using a case expression would be much preferable than dynamic SQL. Just as a
side note, you can also include case expressions in the [where] clause as
well for conditional row filtering, or even in the [group by] clause for
conditional grouping.
In the example below, there are 3 different sort options enabled using a
parameter called @.sort :
. . .
order by
case @.sort
when 0 then NULL
when 1 then company
when 2 then region
end,
case @.sort
when 0 then accountno
when 1 then lastname
when 2 then lastname
end
"paraa" <paraa@.discussions.microsoft.com> wrote in message
news:6D3D38EC-AAB8-4BF0-A74F-AAE898D73BBD@.microsoft.com...
> hi all,
> we are having an asp app that is fetching a big resultset to display in a
> list screen. The screen has 4 or 5 columns which have the click sort
> option
> (ie., on clicking the column hdr, the list needs to be sorted out).
> Currently, we are using a procedure which would dynamically construct the
> sort order and use exec(@.stmt) to send back the resultset. Coz of perf
> issues
> of late, we are thinking of removing dyn sql in the proc and recreating it
> using CASE/IF statements. Which option would be better in general?
> Currently,
> the dyn sql has high counts of CPU.
> would appreciate any help in this regards
> thx
> paraa|||thx a bunch JT and tom..thatz what i was arriving at when i mentioned CASE
stmt v/s dyn sql...just wanted to make sure with the xperts
"JT" wrote:

> If you simply need to sort by a single column, then the ASP.NET DataGrid
> could handle this. However, if your sort requirements are more complex
> involving multiple columns or complex conditions, then it would probably
> need to be done within the stored procedure. A conditional [order by] clau
se
> using a case expression would be much preferable than dynamic SQL. Just as
a
> side note, you can also include case expressions in the [where] clause as
> well for conditional row filtering, or even in the [group by] clause for
> conditional grouping.
> In the example below, there are 3 different sort options enabled using a
> parameter called @.sort :
> .. . .
> order by
> case @.sort
> when 0 then NULL
> when 1 then company
> when 2 then region
> end,
> case @.sort
> when 0 then accountno
> when 1 then lastname
> when 2 then lastname
> end
> "paraa" <paraa@.discussions.microsoft.com> wrote in message
> news:6D3D38EC-AAB8-4BF0-A74F-AAE898D73BBD@.microsoft.com...
>
>