Showing posts with label building. Show all posts
Showing posts with label building. Show all posts

Tuesday, March 27, 2012

Combining subquery results into one field

Hello there

I have an application that allows users to book rooms in a building. I have a booking request table and a rooms booked table since there is a booking that can be made that includes multiple rooms. I have an instance where i need to select the booking requests for a particular date and need to display the rooms for each booking. Since the rooms booked table has the booking request id i'm wondering if there is a way to combine all the subquery results into one record to get around the error of having multiple records being returned in a sub query. The table structures are as follow:

bookingrequestion - bookingrequestid, startdate, enddate

roomsbooked-id, bookingrequestid, roomname

i'm basically trying to use the following query

select br.bookingrequestid, (select roomname from roomsbooked where id = br.bookingrequest) as rooms

i'd like the results of the subquery to return the room names as A,B,C. I'm trying to avoid having to obtain the recordset for the booking requests and then loop through them and for each one obtain a recordset for the rooms, seems like too many database hits to me.

thanks

I would look at returning two results to a dataset then creating a relationship between them. Displaying the results is pretty easy using nested repeaters:http://gridviewguy.com/ArticleDetails.aspx?articleID=185

Thursday, March 22, 2012

Combine two or more reports into one PDF Report

We are building a "Annual Statement" which will include a series or Reports
that will be bound into a Booklet. We will need a table of Contents (With
Page Numbers) and also need the pages to be continuous throughout.
Our question is what is the best approach to build this dynamically in
Report Server?
Build One "Master Report which includes Sub-Reports or Build the Sub Reports
and pass them into the Master?
We have a middle "Business Logic" Tier that we will be driving the creation
of these reoprts from.
Thanks!
...BryanUpdate:
I am thinking that we can programattically create a "Master RDL" that
includes the Sub Reports.
Question: would we be able to control the processing of the sub reports so
that they generate first then generate the Master Report genterating the
Table of Contents after the Sub Reports have been created (and we know the
sub Report Page Counts)
Any Suggestions would be really appreachiated
Thanks!
...Bryan
"Bryan E." wrote:
> We are building a "Annual Statement" which will include a series or Reports
> that will be bound into a Booklet. We will need a table of Contents (With
> Page Numbers) and also need the pages to be continuous throughout.
> Our question is what is the best approach to build this dynamically in
> Report Server?
> Build One "Master Report which includes Sub-Reports or Build the Sub Reports
> and pass them into the Master?
> We have a middle "Business Logic" Tier that we will be driving the creation
> of these reoprts from.
> Thanks!
> ...Bryan|||Bryan -
Did you ever get an answer? We are looking to do something similar. The
first page of one of our reports needs to be a table of contents.
Thanks
Jen
"Bryan E." wrote:
> Update:
> I am thinking that we can programattically create a "Master RDL" that
> includes the Sub Reports.
> Question: would we be able to control the processing of the sub reports so
> that they generate first then generate the Master Report genterating the
> Table of Contents after the Sub Reports have been created (and we know the
> sub Report Page Counts)
> Any Suggestions would be really appreachiated
> Thanks!
> ...Bryan
> "Bryan E." wrote:
> > We are building a "Annual Statement" which will include a series or Reports
> > that will be bound into a Booklet. We will need a table of Contents (With
> > Page Numbers) and also need the pages to be continuous throughout.
> >
> > Our question is what is the best approach to build this dynamically in
> > Report Server?
> >
> > Build One "Master Report which includes Sub-Reports or Build the Sub Reports
> > and pass them into the Master?
> >
> > We have a middle "Business Logic" Tier that we will be driving the creation
> > of these reoprts from.
> >
> > Thanks!
> > ...Bryan

Sunday, March 11, 2012

Columns vs. Rows

hi,

I'm building a multi-lingual website

In my database tables I have, in some of them, a column with the Language, because some of the columns depend on what language the user wants to see the site.

My question is: what is better? have that column and consequently two row (for two languages) with repeated column information? or have two column within a row with the language specification?

e.g.

table: id, description, price

(1) With language:

id,description, price, language='EX'

id,description, price, language='EN'

vs.

(2)

id, descriptionEN,descriptionEX,price

if I have 500 products

in 1 whould result in 1000 entries

in 2 just 500 results

can anyone tell me a diference/advantage between the two approachs?

thanks in advance.

In a problem like this, I would be guided by the following:

If the number of languages is fixed (i.e. the number of columns is not expected to change), go with the second approach (each language in a different field)

In case the number of languages can increase, go with the first approach as it gives you the flexibility to add another row for every new language.

Friday, February 10, 2012

Collation question

Hello!
I am building a Russian web site. Site request and response encoding is set
to windows-1251, data is displayed correctly. But in MS SQL Manager
evrything is messed up... like this ? ? ?
Database table field colaltion is set to: COLLATE Cyrillic_General_CI_AS
What I am doing wrong?
Thank you!
James
James
Did you define NVARCHAR(n) datatype for this column?
"James T." <gimenei@.hotmail.com> wrote in message
news:OLA2iyXUFHA.1148@.tk2msftngp13.phx.gbl...
> Hello!
> I am building a Russian web site. Site request and response encoding is
set
> to windows-1251, data is displayed correctly. But in MS SQL Manager
> evrything is messed up... like this ? ? ?
> Database table field colaltion is set to: COLLATE Cyrillic_General_CI_AS
> What I am doing wrong?
> Thank you!
> James
>

Collation question

Hello!
I am building a Russian web site. Site request and response encoding is set
to windows-1251, data is displayed correctly. But in MS SQL Manager
evrything is messed up... like this ? ' '
Database table field colaltion is set to: COLLATE Cyrillic_General_CI_AS
What I am doing wrong?
Thank you!
JamesJames
Did you define NVARCHAR(n) datatype for this column?
"James T." <gimenei@.hotmail.com> wrote in message
news:OLA2iyXUFHA.1148@.tk2msftngp13.phx.gbl...
> Hello!
> I am building a Russian web site. Site request and response encoding is
set
> to windows-1251, data is displayed correctly. But in MS SQL Manager
> evrything is messed up... like this ? ' '
> Database table field colaltion is set to: COLLATE Cyrillic_General_CI_AS
> What I am doing wrong?
> Thank you!
> James
>

Collation question

Hello!
I am building a Russian web site. Site request and response encoding is set
to windows-1251, data is displayed correctly. But in MS SQL Manager
evrything is messed up... like this ? ' '
Database table field colaltion is set to: COLLATE Cyrillic_General_CI_AS
What I am doing wrong?
Thank you!
JamesJames
Did you define NVARCHAR(n) datatype for this column?
"James T." <gimenei@.hotmail.com> wrote in message
news:OLA2iyXUFHA.1148@.tk2msftngp13.phx.gbl...
> Hello!
> I am building a Russian web site. Site request and response encoding is
set
> to windows-1251, data is displayed correctly. But in MS SQL Manager
> evrything is messed up... like this ? ' '
> Database table field colaltion is set to: COLLATE Cyrillic_General_CI_AS
> What I am doing wrong?
> Thank you!
> James
>